mirror of https://gitlab.com/bashrc2/epicyon
No remove button on federated shared items
parent
7b0c9bc03d
commit
d4704e08eb
|
@ -913,6 +913,11 @@ def _htmlSharesTimeline(translate: {}, pageNumber: int, itemsPerPage: int,
|
|||
sharedItemsFederatedDomains)
|
||||
domainFull = getFullDomain(domain, port)
|
||||
actor = httpPrefix + '://' + domainFull + '/users/' + nickname
|
||||
adminNickname = getConfigParam(baseDir, 'admin')
|
||||
adminActor = ''
|
||||
if adminNickname:
|
||||
adminActor = \
|
||||
httpPrefix + '://' + domainFull + '/users/' + adminNickname
|
||||
timelineStr = ''
|
||||
|
||||
if pageNumber > 1:
|
||||
|
@ -927,13 +932,22 @@ def _htmlSharesTimeline(translate: {}, pageNumber: int, itemsPerPage: int,
|
|||
|
||||
separatorStr = htmlPostSeparator(baseDir, None)
|
||||
ctr = 0
|
||||
|
||||
isAdminAccount = False
|
||||
if adminActor and actor == adminActor:
|
||||
isAdminAccount = True
|
||||
isModeratorAccount = False
|
||||
if isModerator(baseDir, nickname):
|
||||
isModeratorAccount = True
|
||||
|
||||
for published, item in sharesJson.items():
|
||||
showContactButton = False
|
||||
if item['actor'] != actor:
|
||||
showContactButton = True
|
||||
showRemoveButton = False
|
||||
if item['actor'] == actor:
|
||||
showRemoveButton = True
|
||||
if '___' + domain in item['shareId']:
|
||||
if item['actor'] == actor or isAdminAccount or isModeratorAccount:
|
||||
showRemoveButton = True
|
||||
timelineStr += \
|
||||
htmlIndividualShare(domain, item['shareId'],
|
||||
actor, item, translate,
|
||||
|
|
|
@ -1256,7 +1256,7 @@ def editTextArea(label: str, name: str, value: str = "",
|
|||
|
||||
def htmlSearchResultShare(baseDir: str, sharedItem: {}, translate: {},
|
||||
httpPrefix: str, domainFull: str,
|
||||
contactNickname: str, name: str,
|
||||
contactNickname: str, itemID: str,
|
||||
actor: str) -> str:
|
||||
"""Returns the html for an individual shared item
|
||||
"""
|
||||
|
@ -1316,7 +1316,7 @@ def htmlSearchResultShare(baseDir: str, sharedItem: {}, translate: {},
|
|||
if showRemoveButton:
|
||||
sharedItemsForm += \
|
||||
' <a href="' + actor + '?rmshare=' + \
|
||||
name + '"><button class="button">' + \
|
||||
itemID + '"><button class="button">' + \
|
||||
translate['Remove'] + '</button></a>\n'
|
||||
sharedItemsForm += '</p></div>\n'
|
||||
return sharedItemsForm
|
||||
|
|
Loading…
Reference in New Issue