forked from indymedia/epicyon
Add post icons
parent
6c471f48cc
commit
ce0bd875f5
|
@ -199,11 +199,6 @@ body, html {
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.darker {
|
|
||||||
border-color: #ccc;
|
|
||||||
background-color: #ddd;
|
|
||||||
}
|
|
||||||
|
|
||||||
.container::after {
|
.container::after {
|
||||||
content: "";
|
content: "";
|
||||||
clear: both;
|
clear: both;
|
||||||
|
@ -218,6 +213,27 @@ body, html {
|
||||||
border-radius: 10%;
|
border-radius: 10%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.containericons {
|
||||||
|
border: 0px solid #dedede;
|
||||||
|
background-color: #f1f1f1;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 10px;
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.darker {
|
||||||
|
border-color: #ccc;
|
||||||
|
background-color: #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.containericons img {
|
||||||
|
float: right;
|
||||||
|
max-width: 35px;
|
||||||
|
width: 5%;
|
||||||
|
margin-right: 50px;
|
||||||
|
border-radius: 10%;
|
||||||
|
}
|
||||||
|
|
||||||
.container img.attachment {
|
.container img.attachment {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
margin-left: 25%;
|
margin-left: 25%;
|
||||||
|
@ -229,15 +245,22 @@ body, html {
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
margin-right:0;
|
margin-right:0;
|
||||||
}
|
}
|
||||||
|
.containericons img.right {
|
||||||
|
float: right;
|
||||||
|
margin-left: 20px;
|
||||||
|
margin-right:0;
|
||||||
|
}
|
||||||
|
|
||||||
.time-right {
|
.time-right {
|
||||||
float: right;
|
float: right;
|
||||||
color: #aaa;
|
color: #aaa;
|
||||||
|
margin:10px 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.time-left {
|
.time-left {
|
||||||
float: left;
|
float: left;
|
||||||
color: #999;
|
color: #999;
|
||||||
|
margin:10px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.post-title {
|
.post-title {
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 7.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 8.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
|
@ -198,7 +198,7 @@ def htmlProfilePosts(baseDir: str,httpPrefix: str, \
|
||||||
if item['type']=='Create':
|
if item['type']=='Create':
|
||||||
profileStr+= \
|
profileStr+= \
|
||||||
individualPostAsHtml(baseDir,session,wfRequest,personCache, \
|
individualPostAsHtml(baseDir,session,wfRequest,personCache, \
|
||||||
nickname,domain,port,item)
|
nickname,domain,port,item,False)
|
||||||
return profileStr
|
return profileStr
|
||||||
|
|
||||||
def htmlProfileFollowing(baseDir: str,httpPrefix: str, \
|
def htmlProfileFollowing(baseDir: str,httpPrefix: str, \
|
||||||
|
@ -412,14 +412,17 @@ def individualFollowAsHtml(session,wfRequest: {}, \
|
||||||
def individualPostAsHtml(baseDir: str, \
|
def individualPostAsHtml(baseDir: str, \
|
||||||
session,wfRequest: {},personCache: {}, \
|
session,wfRequest: {},personCache: {}, \
|
||||||
nickname: str,domain: str,port: int, \
|
nickname: str,domain: str,port: int, \
|
||||||
postJsonObject: {}) -> str:
|
postJsonObject: {}, \
|
||||||
|
showIcons=False) -> str:
|
||||||
avatarPosition=''
|
avatarPosition=''
|
||||||
containerClass='container'
|
containerClass='container'
|
||||||
|
containerClassIcons='containericons'
|
||||||
timeClass='time-right'
|
timeClass='time-right'
|
||||||
actorNickname=getNicknameFromActor(postJsonObject['actor'])
|
actorNickname=getNicknameFromActor(postJsonObject['actor'])
|
||||||
actorDomain,actorPort=getDomainFromActor(postJsonObject['actor'])
|
actorDomain,actorPort=getDomainFromActor(postJsonObject['actor'])
|
||||||
titleStr='@'+actorNickname+'@'+actorDomain
|
titleStr='@'+actorNickname+'@'+actorDomain
|
||||||
if postJsonObject['object']['inReplyTo']:
|
if postJsonObject['object']['inReplyTo']:
|
||||||
|
containerClassIcons='containericons darker'
|
||||||
containerClass='container darker'
|
containerClass='container darker'
|
||||||
avatarPosition=' class="right"'
|
avatarPosition=' class="right"'
|
||||||
timeClass='time-left'
|
timeClass='time-left'
|
||||||
|
@ -490,13 +493,21 @@ def individualPostAsHtml(baseDir: str, \
|
||||||
' </div>' \
|
' </div>' \
|
||||||
' </div>'
|
' </div>'
|
||||||
|
|
||||||
|
footerStr='<span class="'+timeClass+'">'+postJsonObject['object']['published']+'</span>\n'
|
||||||
|
if showIcons:
|
||||||
|
footerStr='<div class="'+containerClassIcons+'">'
|
||||||
|
footerStr+='<img src="/icons/reply.png"/>'
|
||||||
|
footerStr+='<img src="/icons/repeat_inactive.png"/>'
|
||||||
|
footerStr+='<img src="/icons/like_inactive.png"/>'
|
||||||
|
footerStr+='<span class="'+timeClass+'">'+postJsonObject['object']['published']+'</span>'
|
||||||
|
footerStr+='</div>'
|
||||||
|
|
||||||
return \
|
return \
|
||||||
'<div class="'+containerClass+'">\n'+ \
|
'<div class="'+containerClass+'">\n'+ \
|
||||||
avatarDropdown+ \
|
avatarDropdown+ \
|
||||||
'<p class="post-title">'+titleStr+'</p>'+ \
|
'<p class="post-title">'+titleStr+'</p>'+ \
|
||||||
postJsonObject['object']['content']+'\n'+ \
|
postJsonObject['object']['content']+'\n'+ \
|
||||||
attachmentStr+ \
|
attachmentStr+footerStr+ \
|
||||||
'<span class="'+timeClass+'">'+postJsonObject['object']['published']+'</span>\n'+ \
|
|
||||||
'</div>\n'
|
'</div>\n'
|
||||||
|
|
||||||
def htmlTimeline(session,baseDir: str,wfRequest: {},personCache: {}, \
|
def htmlTimeline(session,baseDir: str,wfRequest: {},personCache: {}, \
|
||||||
|
@ -517,6 +528,10 @@ def htmlTimeline(session,baseDir: str,wfRequest: {},personCache: {}, \
|
||||||
sentButton='buttonselected'
|
sentButton='buttonselected'
|
||||||
actor='/users/'+nickname
|
actor='/users/'+nickname
|
||||||
|
|
||||||
|
showIndividualPostIcons=True
|
||||||
|
if boxName=='inbox':
|
||||||
|
showIndividualPostIcons=True
|
||||||
|
|
||||||
followApprovals=''
|
followApprovals=''
|
||||||
followRequestsFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/followrequests.txt'
|
followRequestsFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/followrequests.txt'
|
||||||
if os.path.isfile(followRequestsFilename):
|
if os.path.isfile(followRequestsFilename):
|
||||||
|
@ -542,7 +557,7 @@ def htmlTimeline(session,baseDir: str,wfRequest: {},personCache: {}, \
|
||||||
for item in timelineJson['orderedItems']:
|
for item in timelineJson['orderedItems']:
|
||||||
if item['type']=='Create':
|
if item['type']=='Create':
|
||||||
tlStr+=individualPostAsHtml(baseDir,session,wfRequest,personCache, \
|
tlStr+=individualPostAsHtml(baseDir,session,wfRequest,personCache, \
|
||||||
nickname,domain,port,item)
|
nickname,domain,port,item,showIndividualPostIcons)
|
||||||
tlStr+=htmlFooter()
|
tlStr+=htmlFooter()
|
||||||
return tlStr
|
return tlStr
|
||||||
|
|
||||||
|
@ -566,7 +581,7 @@ def htmlIndividualPost(baseDir: str,session,wfRequest: {},personCache: {}, \
|
||||||
"""
|
"""
|
||||||
return htmlHeader()+ \
|
return htmlHeader()+ \
|
||||||
individualPostAsHtml(baseDir,session,wfRequest,personCache, \
|
individualPostAsHtml(baseDir,session,wfRequest,personCache, \
|
||||||
nickname,domain,port,postJsonObject)+ \
|
nickname,domain,port,postJsonObject,False)+ \
|
||||||
htmlFooter()
|
htmlFooter()
|
||||||
|
|
||||||
def htmlPostReplies(postJsonObject: {}) -> str:
|
def htmlPostReplies(postJsonObject: {}) -> str:
|
||||||
|
|
Loading…
Reference in New Issue