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