Merge branch 'main' of gitlab.com:bashrc2/epicyon

merge-requests/30/head
Bob Mottram 2021-11-05 11:53:50 +00:00
commit 1381f74411
12 changed files with 289 additions and 213 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

After

Width:  |  Height:  |  Size: 202 KiB

File diff suppressed because one or more lines are too long

View File

@ -159,6 +159,12 @@
--header-font: 'Arial, Helvetica, sans-serif';
--button-bottom-margin: 10px;
--rendering: normal;
--voteresult-color: #dddddd;
--voteresult-border-color: #aaaaaa;
--voteresult-height: 32px;
--voteresult-height-mobile: 32px;
--voteresult-width: 80%;
--voteresult-width-mobile: 80%;
}
@font-face {
@ -1724,6 +1730,16 @@ div.container {
}
.pageslist {
}
.voteresult {
width: var(--voteresult-width);
height: var(--voteresult-height);
}
.voteresultbar {
height: var(--voteresult-height);
fill: var(--voteresult-color);
stroke-width: 10;
stroke: var(--voteresult-border-color)
}
}
@media screen and (min-width: 2200px) {
@ -2429,4 +2445,14 @@ div.container {
}
.pageslist {
}
.voteresult {
width: var(--voteresult-width-mobile);
height: var(--voteresult-height-mobile);
}
.voteresultbar {
height: var(--voteresult-height-mobile);
fill: var(--voteresult-color);
stroke-width: 10;
stroke: var(--voteresult-border-color)
}
}

View File

@ -2553,7 +2553,16 @@ def _receiveQuestionVote(baseDir: str, nickname: str, domain: str,
session, onionDomain: str, i2pDomain: str, port: int,
federationList: [], sendThreads: [], postLog: [],
cachedWebfingers: {}, personCache: {},
signingPrivateKeyPem: str) -> None:
signingPrivateKeyPem: str,
maxRecentPosts: int, translate: {},
allowDeletion: bool,
YTReplacementDomain: str,
twitterReplacementDomain: str,
peertubeInstances: [],
allowLocalNetworkAccess: bool,
themeName: str, systemLanguage: str,
maxLikeCount: int,
CWlists: {}, listsEnabled: bool) -> None:
"""Updates the votes on a Question/poll
"""
# if this is a reply to a question then update the votes
@ -2565,9 +2574,6 @@ def _receiveQuestionVote(baseDir: str, nickname: str, domain: str,
return
removePostFromCache(questionJson, recentPostsCache)
# add id to inbox index
inboxUpdateIndex('inbox', baseDir, handle,
questionPostFilename, debug)
# ensure that the cached post is removed if it exists, so
# that it then will be recreated
cachedPostFilename = \
@ -2579,6 +2585,37 @@ def _receiveQuestionVote(baseDir: str, nickname: str, domain: str,
except BaseException:
print('EX: replytoQuestion unable to delete ' +
cachedPostFilename)
pageNumber = 1
showPublishedDateOnly = False
showIndividualPostIcons = True
manuallyApproveFollowers = \
followerApprovalActive(baseDir, nickname, domain)
notDM = not isDM(questionJson)
individualPostAsHtml(signingPrivateKeyPem, False,
recentPostsCache, maxRecentPosts,
translate, pageNumber, baseDir,
session, cachedWebfingers, personCache,
nickname, domain, port, questionJson,
None, True, allowDeletion,
httpPrefix, __version__,
'inbox',
YTReplacementDomain,
twitterReplacementDomain,
showPublishedDateOnly,
peertubeInstances,
allowLocalNetworkAccess,
themeName, systemLanguage,
maxLikeCount, notDM,
showIndividualPostIcons,
manuallyApproveFollowers,
False, True, False, CWlists,
listsEnabled)
# add id to inbox index
inboxUpdateIndex('inbox', baseDir, handle,
questionPostFilename, debug)
# Is this a question created by this instance?
idPrefix = httpPrefix + '://' + domain
if not questionJson['object']['id'].startswith(idPrefix):
@ -2940,7 +2977,16 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
session, onionDomain, i2pDomain, port,
federationList, sendThreads, postLog,
cachedWebfingers, personCache,
signingPrivateKeyPem)
signingPrivateKeyPem,
maxRecentPosts, translate,
allowDeletion,
YTReplacementDomain,
twitterReplacementDomain,
peertubeInstances,
allowLocalNetworkAccess,
themeName, systemLanguage,
maxLikeCount,
CWlists, listsEnabled)
isReplyToMutedPost = False

View File

@ -75,7 +75,6 @@ def insertQuestion(baseDir: str, translate: {},
votes = int(questionOption['replies']['totalItems'])
except BaseException:
print('EX: insertQuestion unable to convert to int')
pass
if votes > maxVotes:
maxVotes = int(votes+1)
@ -91,18 +90,19 @@ def insertQuestion(baseDir: str, translate: {},
votes = int(questionOption['replies']['totalItems'])
except BaseException:
print('EX: insertQuestion unable to convert to int 2')
pass
votesPercent = str(int(votes * 100 / maxVotes))
content += \
'<p><input type="text" title="' + str(votes) + \
'" name="skillName' + str(questionCtr) + \
'" value="' + questionOption['name'] + \
' (' + str(votes) + ')" style="width:40%">\n'
content += \
'<input type="range" min="1" max="100" ' + \
'class="slider" title="' + \
str(votes) + '" name="skillValue' + str(questionCtr) + \
'" value="' + votesPercent + '"></p>\n'
'<p>\n' + \
' <label class="labels">' + \
questionOption['name'] + '</label><br>\n' + \
' <svg class="voteresult">\n' + \
' <rect width="' + votesPercent + \
'%" class="voteresultbar" />\n' + \
' </svg>' + \
' <label class="labels">' + votesPercent + '%</label>\n' + \
'</p>\n'
questionCtr += 1
content += '</div>\n'
return content