Showing shares on profile screen

master
Bob Mottram 2019-07-24 10:53:07 +01:00
parent 222c024545
commit 55ccd4cb97
4 changed files with 16 additions and 8 deletions

View File

@ -740,7 +740,8 @@ class PubServer(BaseHTTPRequestHandler):
return
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.httpPrefix, \
sharesPerPage)

View File

@ -195,7 +195,12 @@ body, html {
.post-title {
margin-top: 0px;
color: #999;
color: #444;
}
.share-title {
margin-top: 0px;
color: #222;
}
.skill-title {

View File

@ -167,7 +167,7 @@ def expireShares(baseDir: str,nickname: str,domain: str) -> None:
commentjson.dump(sharesJson, fp, indent=4, sort_keys=True)
def getSharesFeedForPerson(baseDir: str, \
nickname: str,domain: str,port: int, \
domain: str,port: int, \
path: str,httpPrefix: str, \
sharesPerPage=12) -> {}:
"""Returns the shares for an account from GET requests
@ -237,6 +237,7 @@ def getSharesFeedForPerson(baseDir: str, \
'type': 'OrderedCollectionPage'}
if not os.path.isfile(sharesFilename):
print("test5")
return shares
currPage=1
pageCtr=0

View File

@ -104,11 +104,12 @@ def htmlProfileShares(nickname: str,domain: str,sharesJson: {}) -> str:
profileStr=''
for item in sharesJson['orderedItems']:
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>Type: '+item['itemType']+' '
profileStr+='Category: '+item['itemCategory']+' '
profileStr+='Location: '+item['location']+'</p>'
profileStr+='<p><b>Type:</b> '+item['itemType']+' '
profileStr+='<b>Category:</b> '+item['category']+' '
profileStr+='<b>Location:</b> '+item['location']+'</p>'
profileStr+='</div>'
if len(profileStr)==0:
profileStr+='<p>@'+nickname+'@'+domain+' is not sharing any items</p>'