forked from indymedia/epicyon
Showing shares on profile screen
parent
222c024545
commit
55ccd4cb97
|
@ -740,7 +740,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
return
|
return
|
||||||
authorized=self._isAuthorized()
|
authorized=self._isAuthorized()
|
||||||
|
|
||||||
shares=getSharesFeedForPerson(self.server.baseDir,self.server.domain, \
|
shares=getSharesFeedForPerson(self.server.baseDir, \
|
||||||
|
self.server.domain, \
|
||||||
self.server.port,self.path, \
|
self.server.port,self.path, \
|
||||||
self.server.httpPrefix, \
|
self.server.httpPrefix, \
|
||||||
sharesPerPage)
|
sharesPerPage)
|
||||||
|
|
|
@ -195,7 +195,12 @@ body, html {
|
||||||
|
|
||||||
.post-title {
|
.post-title {
|
||||||
margin-top: 0px;
|
margin-top: 0px;
|
||||||
color: #999;
|
color: #444;
|
||||||
|
}
|
||||||
|
|
||||||
|
.share-title {
|
||||||
|
margin-top: 0px;
|
||||||
|
color: #222;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skill-title {
|
.skill-title {
|
||||||
|
|
|
@ -167,7 +167,7 @@ def expireShares(baseDir: str,nickname: str,domain: str) -> None:
|
||||||
commentjson.dump(sharesJson, fp, indent=4, sort_keys=True)
|
commentjson.dump(sharesJson, fp, indent=4, sort_keys=True)
|
||||||
|
|
||||||
def getSharesFeedForPerson(baseDir: str, \
|
def getSharesFeedForPerson(baseDir: str, \
|
||||||
nickname: str,domain: str,port: int, \
|
domain: str,port: int, \
|
||||||
path: str,httpPrefix: str, \
|
path: str,httpPrefix: str, \
|
||||||
sharesPerPage=12) -> {}:
|
sharesPerPage=12) -> {}:
|
||||||
"""Returns the shares for an account from GET requests
|
"""Returns the shares for an account from GET requests
|
||||||
|
@ -237,6 +237,7 @@ def getSharesFeedForPerson(baseDir: str, \
|
||||||
'type': 'OrderedCollectionPage'}
|
'type': 'OrderedCollectionPage'}
|
||||||
|
|
||||||
if not os.path.isfile(sharesFilename):
|
if not os.path.isfile(sharesFilename):
|
||||||
|
print("test5")
|
||||||
return shares
|
return shares
|
||||||
currPage=1
|
currPage=1
|
||||||
pageCtr=0
|
pageCtr=0
|
||||||
|
|
|
@ -104,11 +104,12 @@ def htmlProfileShares(nickname: str,domain: str,sharesJson: {}) -> str:
|
||||||
profileStr=''
|
profileStr=''
|
||||||
for item in sharesJson['orderedItems']:
|
for item in sharesJson['orderedItems']:
|
||||||
profileStr+='<div class="container">'
|
profileStr+='<div class="container">'
|
||||||
profileStr+='<p class="post-title">'+item['displayName']+'</p>'
|
profileStr+='<p class="share-title">'+item['displayName']+'</p>'
|
||||||
|
profileStr+='<img src="'+item['imageUrl']+'" alt="Item image"></a>'
|
||||||
profileStr+='<p>'+item['summary']+'</p>'
|
profileStr+='<p>'+item['summary']+'</p>'
|
||||||
profileStr+='<p>Type: '+item['itemType']+' '
|
profileStr+='<p><b>Type:</b> '+item['itemType']+' '
|
||||||
profileStr+='Category: '+item['itemCategory']+' '
|
profileStr+='<b>Category:</b> '+item['category']+' '
|
||||||
profileStr+='Location: '+item['location']+'</p>'
|
profileStr+='<b>Location:</b> '+item['location']+'</p>'
|
||||||
profileStr+='</div>'
|
profileStr+='</div>'
|
||||||
if len(profileStr)==0:
|
if len(profileStr)==0:
|
||||||
profileStr+='<p>@'+nickname+'@'+domain+' is not sharing any items</p>'
|
profileStr+='<p>@'+nickname+'@'+domain+' is not sharing any items</p>'
|
||||||
|
|
Loading…
Reference in New Issue