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)
|
sharedItemsFederatedDomains)
|
||||||
domainFull = getFullDomain(domain, port)
|
domainFull = getFullDomain(domain, port)
|
||||||
actor = httpPrefix + '://' + domainFull + '/users/' + nickname
|
actor = httpPrefix + '://' + domainFull + '/users/' + nickname
|
||||||
|
adminNickname = getConfigParam(baseDir, 'admin')
|
||||||
|
adminActor = ''
|
||||||
|
if adminNickname:
|
||||||
|
adminActor = \
|
||||||
|
httpPrefix + '://' + domainFull + '/users/' + adminNickname
|
||||||
timelineStr = ''
|
timelineStr = ''
|
||||||
|
|
||||||
if pageNumber > 1:
|
if pageNumber > 1:
|
||||||
|
@ -927,12 +932,21 @@ def _htmlSharesTimeline(translate: {}, pageNumber: int, itemsPerPage: int,
|
||||||
|
|
||||||
separatorStr = htmlPostSeparator(baseDir, None)
|
separatorStr = htmlPostSeparator(baseDir, None)
|
||||||
ctr = 0
|
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():
|
for published, item in sharesJson.items():
|
||||||
showContactButton = False
|
showContactButton = False
|
||||||
if item['actor'] != actor:
|
if item['actor'] != actor:
|
||||||
showContactButton = True
|
showContactButton = True
|
||||||
showRemoveButton = False
|
showRemoveButton = False
|
||||||
if item['actor'] == actor:
|
if '___' + domain in item['shareId']:
|
||||||
|
if item['actor'] == actor or isAdminAccount or isModeratorAccount:
|
||||||
showRemoveButton = True
|
showRemoveButton = True
|
||||||
timelineStr += \
|
timelineStr += \
|
||||||
htmlIndividualShare(domain, item['shareId'],
|
htmlIndividualShare(domain, item['shareId'],
|
||||||
|
|
|
@ -1256,7 +1256,7 @@ def editTextArea(label: str, name: str, value: str = "",
|
||||||
|
|
||||||
def htmlSearchResultShare(baseDir: str, sharedItem: {}, translate: {},
|
def htmlSearchResultShare(baseDir: str, sharedItem: {}, translate: {},
|
||||||
httpPrefix: str, domainFull: str,
|
httpPrefix: str, domainFull: str,
|
||||||
contactNickname: str, name: str,
|
contactNickname: str, itemID: str,
|
||||||
actor: str) -> str:
|
actor: str) -> str:
|
||||||
"""Returns the html for an individual shared item
|
"""Returns the html for an individual shared item
|
||||||
"""
|
"""
|
||||||
|
@ -1316,7 +1316,7 @@ def htmlSearchResultShare(baseDir: str, sharedItem: {}, translate: {},
|
||||||
if showRemoveButton:
|
if showRemoveButton:
|
||||||
sharedItemsForm += \
|
sharedItemsForm += \
|
||||||
' <a href="' + actor + '?rmshare=' + \
|
' <a href="' + actor + '?rmshare=' + \
|
||||||
name + '"><button class="button">' + \
|
itemID + '"><button class="button">' + \
|
||||||
translate['Remove'] + '</button></a>\n'
|
translate['Remove'] + '</button></a>\n'
|
||||||
sharedItemsForm += '</p></div>\n'
|
sharedItemsForm += '</p></div>\n'
|
||||||
return sharedItemsForm
|
return sharedItemsForm
|
||||||
|
|
Loading…
Reference in New Issue