From 753a42d5080d93c05b84f2edfbaadab2c649fec6 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 9 Aug 2021 23:07:34 +0100 Subject: [PATCH] Fix remove button on wanted items --- webapp_search.py | 12 +++++++----- webapp_utils.py | 18 ++++++++++++------ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/webapp_search.py b/webapp_search.py index 274e00e93..128a39068 100644 --- a/webapp_search.py +++ b/webapp_search.py @@ -161,8 +161,8 @@ def _htmlSharesResult(baseDir: str, searchStrLowerList: [], currPage: int, ctr: int, callingDomain: str, httpPrefix: str, domainFull: str, contactNickname: str, actor: str, - resultsExist: bool, searchStrLower: str, - translate: {}) -> (bool, int, int, str): + resultsExist: bool, searchStrLower: str, translate: {}, + sharesFileType: str) -> (bool, int, int, str): """Result for shared items search """ sharedItemsForm = '' @@ -177,7 +177,7 @@ def _htmlSharesResult(baseDir: str, htmlSearchResultShare(baseDir, sharedItem, translate, httpPrefix, domainFull, contactNickname, - name, actor) + name, actor, sharesFileType) if not resultsExist and currPage > 1: # show the previous page button sharedItemsForm += \ @@ -259,7 +259,8 @@ def htmlSearchSharedItems(cssCache: {}, translate: {}, domainFull, contactNickname, actor, resultsExist, - searchStrLower, translate) + searchStrLower, translate, + sharesFileType) sharedItemsForm += resultStr if currPage > pageNumber: @@ -296,7 +297,8 @@ def htmlSearchSharedItems(cssCache: {}, translate: {}, domainFull, contactNickname, actor, resultsExist, - searchStrLower, translate) + searchStrLower, translate, + sharesFileType) sharedItemsForm += resultStr if currPage > pageNumber: diff --git a/webapp_utils.py b/webapp_utils.py index e35b4ed66..322e4876b 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -1273,7 +1273,7 @@ def editTextArea(label: str, name: str, value: str = "", def htmlSearchResultShare(baseDir: str, sharedItem: {}, translate: {}, httpPrefix: str, domainFull: str, contactNickname: str, itemID: str, - actor: str) -> str: + actor: str, sharesFileType: str) -> str: """Returns the html for an individual shared item """ sharedItemsForm = '
\n' @@ -1334,10 +1334,16 @@ def htmlSearchResultShare(baseDir: str, sharedItem: {}, translate: {}, showRemoveButton = True if showRemoveButton: - sharedItemsForm += \ - ' \n' + if sharesFileType == 'shares': + sharedItemsForm += \ + ' \n' + else: + sharedItemsForm += \ + ' \n' sharedItemsForm += '

\n' return sharedItemsForm @@ -1412,7 +1418,7 @@ def htmlShowShare(baseDir: str, domain: str, nickname: str, shareStr += \ htmlSearchResultShare(baseDir, sharedItem, translate, httpPrefix, domainFull, contactNickname, itemID, - actor) + actor, sharesFileType) cssFilename = baseDir + '/epicyon-profile.css' if os.path.isfile(baseDir + '/epicyon.css'):