forked from indymedia/epicyon
Replace hr with graphical timeline separators
parent
1cb960be33
commit
62dff9e71d
|
@ -88,17 +88,9 @@
|
|||
--column-left-header-color: #fff;
|
||||
--column-left-header-size: 20px;
|
||||
--column-left-header-size-mobile: 50px;
|
||||
--column-left-header-line-color: #555;
|
||||
--column-left-border-width: 0;
|
||||
--column-right-border-width: 0;
|
||||
--column-left-border-color: black;
|
||||
--column-right-header-line-margin: 2%;
|
||||
--column-right-header-line-width: 0;
|
||||
--column-left-header-line-width: 0;
|
||||
--column-left-header-line-margin: 2%;
|
||||
--post-line-margin: 2%;
|
||||
--post-line-width: 0;
|
||||
--post-line-radius: 0;
|
||||
--column-left-icon-size: 20%;
|
||||
--column-left-icon-size-mobile: 10%;
|
||||
--column-left-image-width-mobile: 40vw;
|
||||
|
@ -169,22 +161,6 @@ body, html {
|
|||
display: block;
|
||||
}
|
||||
|
||||
hr.linksLine {
|
||||
margin: var(--column-left-header-line-margin);
|
||||
border: var(--column-left-header-line-width) solid var(--column-left-header-line-color);
|
||||
}
|
||||
|
||||
hr.newswireLine {
|
||||
margin: var(--column-right-header-line-margin);
|
||||
border: var(--column-right-header-line-width) solid var(--column-left-header-line-color);
|
||||
}
|
||||
|
||||
hr.postLine {
|
||||
margin: var(--post-line-margin);
|
||||
border: var(--post-line-width) solid var(--column-left-header-line-color);
|
||||
border-radius: var(--post-line-radius);
|
||||
}
|
||||
|
||||
.headericons {
|
||||
display: inline-block;
|
||||
float: right;
|
||||
|
|
3
theme.py
3
theme.py
|
@ -1134,9 +1134,6 @@ def setThemeSolidaric(baseDir: str):
|
|||
"post-separator-width": "96.5%",
|
||||
"post-separator-height": "40px",
|
||||
"border-width-header": "0",
|
||||
"post-line-margin": "0 5%",
|
||||
"post-line-width": "1px",
|
||||
"column-left-header-line-color": "#999",
|
||||
"border-width": "0",
|
||||
"banner-height": "35vh",
|
||||
"banner-height-mobile": "15vh",
|
||||
|
|
|
@ -736,6 +736,7 @@ def htmlHashtagSearch(cssCache: {},
|
|||
return None
|
||||
|
||||
iconsDir = getIconsDir(baseDir)
|
||||
separatorStr = htmlPostSeparator(baseDir, None)
|
||||
|
||||
# check that the directory for the nickname exists
|
||||
if nickname:
|
||||
|
@ -829,8 +830,7 @@ def htmlHashtagSearch(cssCache: {},
|
|||
if nickname:
|
||||
showIndividualPostIcons = True
|
||||
allowDeletion = False
|
||||
hashtagSearchForm += \
|
||||
'<hr class="postLine">\n' + \
|
||||
hashtagSearchForm += separatorStr + \
|
||||
individualPostAsHtml(True, recentPostsCache,
|
||||
maxRecentPosts,
|
||||
iconsDir, translate, None,
|
||||
|
@ -1166,6 +1166,7 @@ def htmlHistorySearch(cssCache: {}, translate: {}, baseDir: str,
|
|||
return historySearchForm
|
||||
|
||||
iconsDir = getIconsDir(baseDir)
|
||||
separatorStr = htmlPostSeparator(baseDir, None)
|
||||
|
||||
# ensure that the page number is in bounds
|
||||
if not pageNumber:
|
||||
|
@ -1192,8 +1193,7 @@ def htmlHistorySearch(cssCache: {}, translate: {}, baseDir: str,
|
|||
continue
|
||||
showIndividualPostIcons = True
|
||||
allowDeletion = False
|
||||
historySearchForm += \
|
||||
'<hr class="postLine">\n' + \
|
||||
historySearchForm += separatorStr + \
|
||||
individualPostAsHtml(True, recentPostsCache,
|
||||
maxRecentPosts,
|
||||
iconsDir, translate, None,
|
||||
|
@ -5683,6 +5683,7 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
|
|||
"""
|
||||
htmlStr = ''
|
||||
|
||||
separatorStr = htmlPostSeparator(baseDir, 'left')
|
||||
domain = domainFull
|
||||
if ':' in domain:
|
||||
domain = domain.split(':')
|
||||
|
@ -5809,8 +5810,7 @@ def getLeftColumnContent(baseDir: str, nickname: str, domainFull: str,
|
|||
else:
|
||||
if lineStr.startswith('#') or lineStr.startswith('*'):
|
||||
lineStr = lineStr[1:].strip()
|
||||
htmlStr += \
|
||||
' <hr class="linksLine">\n'
|
||||
htmlStr += separatorStr
|
||||
htmlStr += \
|
||||
' <h3 class="linksHeader">' + \
|
||||
lineStr + '</h3>\n'
|
||||
|
@ -5838,10 +5838,11 @@ def votesIndicator(totalVotes: int, positiveVoting: bool) -> str:
|
|||
return totalVotesStr
|
||||
|
||||
|
||||
def htmlNewswire(newswire: {}, nickname: str, moderator: bool,
|
||||
def htmlNewswire(baseDir: str, newswire: {}, nickname: str, moderator: bool,
|
||||
translate: {}, positiveVoting: bool, iconsDir: str) -> str:
|
||||
"""Converts a newswire dict into html
|
||||
"""
|
||||
separatorStr = htmlPostSeparator(baseDir, 'right')
|
||||
htmlStr = ''
|
||||
for dateStr, item in newswire.items():
|
||||
publishedDate = \
|
||||
|
@ -5851,7 +5852,7 @@ def htmlNewswire(newswire: {}, nickname: str, moderator: bool,
|
|||
dateStrLink = dateStr.replace('T', ' ')
|
||||
dateStrLink = dateStrLink.replace('Z', '')
|
||||
moderatedItem = item[5]
|
||||
htmlStr += '<hr class="newswireLine">\n'
|
||||
htmlStr += separatorStr
|
||||
if moderatedItem and 'vote:' + nickname in item[2]:
|
||||
totalVotesStr = ''
|
||||
totalVotes = 0
|
||||
|
@ -6167,7 +6168,7 @@ def getRightColumnContent(baseDir: str, nickname: str, domainFull: str,
|
|||
|
||||
# show the newswire lines
|
||||
newswireContentStr = \
|
||||
htmlNewswire(newswire, nickname, moderator, translate,
|
||||
htmlNewswire(baseDir, newswire, nickname, moderator, translate,
|
||||
positiveVoting, iconsDir)
|
||||
htmlStr += newswireContentStr
|
||||
|
||||
|
@ -6726,6 +6727,23 @@ def headerButtonsTimeline(defaultTimeline: str,
|
|||
return tlStr
|
||||
|
||||
|
||||
def htmlPostSeparator(baseDir: str, column: str) -> str:
|
||||
"""Returns the html for a timeline post separator image
|
||||
"""
|
||||
iconsDir = getIconsDir(baseDir)
|
||||
filename = 'separator.png'
|
||||
if column:
|
||||
filename = 'separator_' + column + '.png'
|
||||
separatorImageFilename = baseDir + '/img/' + iconsDir + '/' + filename
|
||||
separatorStr = ''
|
||||
if os.path.isfile(separatorImageFilename):
|
||||
separatorStr = \
|
||||
'<div class="postSeparatorImage"><center>' + \
|
||||
'<img src="/' + iconsDir + '/' + filename + '"/>' + \
|
||||
'</center></div>\n'
|
||||
return separatorStr
|
||||
|
||||
|
||||
def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
||||
recentPostsCache: {}, maxRecentPosts: int,
|
||||
translate: {}, pageNumber: int,
|
||||
|
@ -6801,13 +6819,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
|
|||
# This changes depending upon theme
|
||||
iconsDir = getIconsDir(baseDir)
|
||||
|
||||
separatorImageFilename = baseDir + '/img/' + iconsDir + '/separator.png'
|
||||
separatorStr = ''
|
||||
if os.path.isfile(separatorImageFilename):
|
||||
separatorStr = \
|
||||
'<div class="postSeparatorImage"><center>' + \
|
||||
'<img src="/' + iconsDir + '/separator.png"/>' + \
|
||||
'</center></div>\n'
|
||||
separatorStr = htmlPostSeparator(baseDir, None)
|
||||
|
||||
# the css filename
|
||||
cssFilename = baseDir + '/epicyon-profile.css'
|
||||
|
|
Loading…
Reference in New Issue