mirror of https://gitlab.com/bashrc2/epicyon
Profile button on shared item
parent
c94b08cecb
commit
076f1ff87c
14
daemon.py
14
daemon.py
|
@ -12589,6 +12589,11 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
itemID = self.path.split('?showshare=')[1]
|
||||
if ';' in itemID:
|
||||
itemID = itemID.split(';')[0]
|
||||
category = ''
|
||||
if ';category=' in self.path:
|
||||
category = self.path.split(';category=')[1]
|
||||
if ';' in category:
|
||||
category = category.split(';')[0]
|
||||
usersPath = self.path.split('?showshare=')[0]
|
||||
nickname = usersPath.replace('/users/', '')
|
||||
itemID = urllib.parse.unquote_plus(itemID.strip())
|
||||
|
@ -12599,7 +12604,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
itemID, self.server.translate,
|
||||
self.server.sharedItemsFederatedDomains,
|
||||
self.server.defaultTimeline,
|
||||
self.server.themeName, 'shares')
|
||||
self.server.themeName, 'shares', category)
|
||||
if not msg:
|
||||
if callingDomain.endswith('.onion') and \
|
||||
self.server.onionDomain:
|
||||
|
@ -12623,6 +12628,11 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
# after selecting a wanted item from the left column then show it
|
||||
if htmlGET and '?showwanted=' in self.path and '/users/' in self.path:
|
||||
itemID = self.path.split('?showwanted=')[1]
|
||||
if ';' in itemID:
|
||||
itemID = itemID.split(';')[0]
|
||||
category = self.path.split('?category=')[1]
|
||||
if ';' in category:
|
||||
category = category.split(';')[0]
|
||||
usersPath = self.path.split('?showwanted=')[0]
|
||||
nickname = usersPath.replace('/users/', '')
|
||||
itemID = urllib.parse.unquote_plus(itemID.strip())
|
||||
|
@ -12633,7 +12643,7 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
itemID, self.server.translate,
|
||||
self.server.sharedItemsFederatedDomains,
|
||||
self.server.defaultTimeline,
|
||||
self.server.themeName, 'wanted')
|
||||
self.server.themeName, 'wanted', category)
|
||||
if not msg:
|
||||
if callingDomain.endswith('.onion') and \
|
||||
self.server.onionDomain:
|
||||
|
|
|
@ -480,5 +480,8 @@
|
|||
"You're not allowed": "كنت لا يسمح",
|
||||
"Hours after posting during which replies are allowed": "ساعات بعد النشر المسموح بها خلال الردود",
|
||||
"Twitter": "Twitter",
|
||||
"Twitter Replacement Domain": "مجال استبدال تويتر"
|
||||
"Twitter Replacement Domain": "مجال استبدال تويتر",
|
||||
"Buy": "يشتري",
|
||||
"Request to stay": "طلب البقاء",
|
||||
"Profile": "الملف الشخصي"
|
||||
}
|
||||
|
|
|
@ -480,5 +480,8 @@
|
|||
"You're not allowed": "No està permès",
|
||||
"Hours after posting during which replies are allowed": "Hores després de la publicació durant les respostes",
|
||||
"Twitter": "Twitter",
|
||||
"Twitter Replacement Domain": "Domini de substitució de Twitter"
|
||||
"Twitter Replacement Domain": "Domini de substitució de Twitter",
|
||||
"Buy": "Comprar",
|
||||
"Request to stay": "Sol·licitud de permanència",
|
||||
"Profile": "Perfil"
|
||||
}
|
||||
|
|
|
@ -480,5 +480,8 @@
|
|||
"You're not allowed": "Ni chaniateir i chi",
|
||||
"Hours after posting during which replies are allowed": "Oriau ar ôl postio pan ganiateir atebion",
|
||||
"Twitter": "Twitter",
|
||||
"Twitter Replacement Domain": "Parth Amnewid Twitter"
|
||||
"Twitter Replacement Domain": "Parth Amnewid Twitter",
|
||||
"Buy": "Prynu",
|
||||
"Request to stay": "Cais i aros",
|
||||
"Profile": "Proffil"
|
||||
}
|
||||
|
|
|
@ -480,5 +480,8 @@
|
|||
"You're not allowed": "Du darfst nicht",
|
||||
"Hours after posting during which replies are allowed": "Stunden nach dem Posten, während denen Antworten erlaubt sind",
|
||||
"Twitter": "Twitter",
|
||||
"Twitter Replacement Domain": "Twitter-Ersatzdomain"
|
||||
"Twitter Replacement Domain": "Twitter-Ersatzdomain",
|
||||
"Buy": "Besorgen",
|
||||
"Request to stay": "Bitte um bleiben",
|
||||
"Profile": "Profil"
|
||||
}
|
||||
|
|
|
@ -480,5 +480,8 @@
|
|||
"You're not allowed": "You're not allowed",
|
||||
"Hours after posting during which replies are allowed": "Hours after posting during which replies are allowed",
|
||||
"Twitter": "Twitter",
|
||||
"Twitter Replacement Domain": "Twitter Replacement Domain"
|
||||
"Twitter Replacement Domain": "Twitter Replacement Domain",
|
||||
"Buy": "Buy",
|
||||
"Request to stay": "Request to stay",
|
||||
"Profile": "Profile"
|
||||
}
|
||||
|
|
|
@ -480,5 +480,8 @@
|
|||
"You're not allowed": "No tienes permiso",
|
||||
"Hours after posting during which replies are allowed": "Horas después de la publicación durante las cuales se permiten las respuestas",
|
||||
"Twitter": "Twitter",
|
||||
"Twitter Replacement Domain": "Dominio de reemplazo de Twitter"
|
||||
"Twitter Replacement Domain": "Dominio de reemplazo de Twitter",
|
||||
"Buy": "Comprar",
|
||||
"Request to stay": "Solicitud para quedarse",
|
||||
"Profile": "Perfil"
|
||||
}
|
||||
|
|
|
@ -480,5 +480,8 @@
|
|||
"You're not allowed": "Tu n'as pas le droit",
|
||||
"Hours after posting during which replies are allowed": "Heures après la publication pendant laquelle les réponses sont autorisées",
|
||||
"Twitter": "Twitter",
|
||||
"Twitter Replacement Domain": "Domaine de remplacement Twitter"
|
||||
"Twitter Replacement Domain": "Domaine de remplacement Twitter",
|
||||
"Buy": "Acheter",
|
||||
"Request to stay": "Demande de séjour",
|
||||
"Profile": "Profil"
|
||||
}
|
||||
|
|
|
@ -480,5 +480,8 @@
|
|||
"You're not allowed": "Níl cead agat",
|
||||
"Hours after posting during which replies are allowed": "Uair an chloig tar éis an phostála ina gceadaítear freagraí",
|
||||
"Twitter": "Twitter",
|
||||
"Twitter Replacement Domain": "Fearann Athsholáthair Twitter"
|
||||
"Twitter Replacement Domain": "Fearann Athsholáthair Twitter",
|
||||
"Buy": "Ceannaigh",
|
||||
"Request to stay": "Iarraidh fanacht",
|
||||
"Profile": "Próifíl"
|
||||
}
|
||||
|
|
|
@ -480,5 +480,8 @@
|
|||
"You're not allowed": "आपको अनुमति नहीं है",
|
||||
"Hours after posting during which replies are allowed": "पोस्ट करने के कुछ घंटे जिसके बाद जवाब देने की अनुमति है",
|
||||
"Twitter": "Twitter",
|
||||
"Twitter Replacement Domain": "ट्विटर रिप्लेसमेंट डोमेन"
|
||||
"Twitter Replacement Domain": "ट्विटर रिप्लेसमेंट डोमेन",
|
||||
"Buy": "खरीदना",
|
||||
"Request to stay": "रहने का अनुरोध",
|
||||
"Profile": "प्रोफ़ाइल"
|
||||
}
|
||||
|
|
|
@ -480,5 +480,8 @@
|
|||
"You're not allowed": "Non ti è permesso",
|
||||
"Hours after posting during which replies are allowed": "Ore dopo la pubblicazione durante le quali le risposte sono consentite",
|
||||
"Twitter": "Twitter",
|
||||
"Twitter Replacement Domain": "Dominio sostitutivo di Twitter"
|
||||
"Twitter Replacement Domain": "Dominio sostitutivo di Twitter",
|
||||
"Buy": "Acquistare",
|
||||
"Request to stay": "Richiesta di soggiorno",
|
||||
"Profile": "Profilo"
|
||||
}
|
||||
|
|
|
@ -480,5 +480,8 @@
|
|||
"You're not allowed": "あなたは許可されていません",
|
||||
"Hours after posting during which replies are allowed": "転記後の時間返信が許可されています",
|
||||
"Twitter": "Twitter",
|
||||
"Twitter Replacement Domain": "Twitterの代替ドメイン"
|
||||
"Twitter Replacement Domain": "Twitterの代替ドメイン",
|
||||
"Buy": "買う",
|
||||
"Request to stay": "滞在リクエスト",
|
||||
"Profile": "プロフィール"
|
||||
}
|
||||
|
|
|
@ -480,5 +480,8 @@
|
|||
"You're not allowed": "Destûrê nadin te",
|
||||
"Hours after posting during which replies are allowed": "Demjimêran piştî şandina di dema bersivê de destûr tê dayîn",
|
||||
"Twitter": "Twitter",
|
||||
"Twitter Replacement Domain": "Domaina Veguheztina Twitter"
|
||||
"Twitter Replacement Domain": "Domaina Veguheztina Twitter",
|
||||
"Buy": "Kirrîn",
|
||||
"Request to stay": "Daxwaza mayînê bikin",
|
||||
"Profile": "Tengal"
|
||||
}
|
||||
|
|
|
@ -476,5 +476,8 @@
|
|||
"You're not allowed": "You're not allowed",
|
||||
"Hours after posting during which replies are allowed": "Hours after posting during which replies are allowed",
|
||||
"Twitter": "Twitter",
|
||||
"Twitter Replacement Domain": "Twitter Replacement Domain"
|
||||
"Twitter Replacement Domain": "Twitter Replacement Domain",
|
||||
"Buy": "Buy",
|
||||
"Request to stay": "Request to stay",
|
||||
"Profile": "Profile"
|
||||
}
|
||||
|
|
|
@ -480,5 +480,8 @@
|
|||
"You're not allowed": "Você não tem permissão",
|
||||
"Hours after posting during which replies are allowed": "Horas após a postagem durante as quais as respostas são permitidas",
|
||||
"Twitter": "Twitter",
|
||||
"Twitter Replacement Domain": "Domínio de substituição do Twitter"
|
||||
"Twitter Replacement Domain": "Domínio de substituição do Twitter",
|
||||
"Buy": "Comprar",
|
||||
"Request to stay": "Pedido para ficar",
|
||||
"Profile": "Perfil"
|
||||
}
|
||||
|
|
|
@ -480,5 +480,8 @@
|
|||
"You're not allowed": "Вам не разрешено",
|
||||
"Hours after posting during which replies are allowed": "Часы после размещения, в течение которых разрешены ответы",
|
||||
"Twitter": "Twitter",
|
||||
"Twitter Replacement Domain": "Замещающий домен Twitter"
|
||||
"Twitter Replacement Domain": "Замещающий домен Twitter",
|
||||
"Buy": "Купить",
|
||||
"Request to stay": "Просьба остаться",
|
||||
"Profile": "Профиль"
|
||||
}
|
||||
|
|
|
@ -480,5 +480,8 @@
|
|||
"You're not allowed": "Hauruhusiwi",
|
||||
"Hours after posting during which replies are allowed": "Masaa baada ya kuchapisha wakati majibu yanaruhusiwa.",
|
||||
"Twitter": "Twitter",
|
||||
"Twitter Replacement Domain": "Kikoa cha Uingizwaji wa Twitter"
|
||||
"Twitter Replacement Domain": "Kikoa cha Uingizwaji wa Twitter",
|
||||
"Buy": "Nunua",
|
||||
"Request to stay": "Omba kukaa",
|
||||
"Profile": "Profaili"
|
||||
}
|
||||
|
|
|
@ -480,5 +480,8 @@
|
|||
"You're not allowed": "你不被允许",
|
||||
"Hours after posting during which replies are allowed": "发布后的时间允许答复",
|
||||
"Twitter": "Twitter",
|
||||
"Twitter Replacement Domain": "Twitter 替换域"
|
||||
"Twitter Replacement Domain": "Twitter 替换域",
|
||||
"Buy": "买",
|
||||
"Request to stay": "要求留下",
|
||||
"Profile": "轮廓"
|
||||
}
|
||||
|
|
2
utils.py
2
utils.py
|
@ -859,7 +859,7 @@ def dangerousMarkup(content: str, allowLocalNetworkAccess: bool) -> bool:
|
|||
"""
|
||||
separators = [['<', '>'], ['<', '>']]
|
||||
invalidStrings = [
|
||||
'script', 'noscript', 'code',
|
||||
'script', 'noscript', 'code', 'pre',
|
||||
'canvas', 'style', 'abbr',
|
||||
'frame', 'iframe', 'html', 'body',
|
||||
'hr', 'allow-popups', 'allow-scripts'
|
||||
|
|
|
@ -178,7 +178,8 @@ def _htmlSharesResult(baseDir: str,
|
|||
htmlSearchResultShare(baseDir, sharedItem, translate,
|
||||
httpPrefix, domainFull,
|
||||
contactNickname,
|
||||
name, actor, sharesFileType)
|
||||
name, actor, sharesFileType,
|
||||
sharedItem['category'])
|
||||
if not resultsExist and currPage > 1:
|
||||
# show the previous page button
|
||||
sharedItemsForm += \
|
||||
|
|
|
@ -1292,7 +1292,8 @@ def editTextArea(label: str, name: str, value: str = "",
|
|||
def htmlSearchResultShare(baseDir: str, sharedItem: {}, translate: {},
|
||||
httpPrefix: str, domainFull: str,
|
||||
contactNickname: str, itemID: str,
|
||||
actor: str, sharesFileType: str) -> str:
|
||||
actor: str, sharesFileType: str,
|
||||
category: str) -> str:
|
||||
"""Returns the html for an individual shared item
|
||||
"""
|
||||
sharedItemsForm = '<div class="container">\n'
|
||||
|
@ -1319,6 +1320,7 @@ def htmlSearchResultShare(baseDir: str, sharedItem: {}, translate: {},
|
|||
sharedItemsForm += \
|
||||
'<b>' + translate['Location'] + ':</b> ' + \
|
||||
sharedItem['location'] + '<br>'
|
||||
contactTitleStr = translate['Contact']
|
||||
if sharedItem.get('itemPrice') and \
|
||||
sharedItem.get('itemCurrency'):
|
||||
if isfloat(sharedItem['itemPrice']):
|
||||
|
@ -1327,17 +1329,21 @@ def htmlSearchResultShare(baseDir: str, sharedItem: {}, translate: {},
|
|||
' <b>' + translate['Price'] + \
|
||||
':</b> ' + sharedItem['itemPrice'] + \
|
||||
' ' + sharedItem['itemCurrency']
|
||||
contactTitleStr = translate['Buy']
|
||||
sharedItemsForm += '</p>\n'
|
||||
contactActor = \
|
||||
localActorUrl(httpPrefix, contactNickname, domainFull)
|
||||
if category == 'accommodation':
|
||||
contactTitleStr = translate['Request to stay']
|
||||
|
||||
sharedItemsForm += \
|
||||
'<p>' + \
|
||||
'<a href="' + actor + '?replydm=sharedesc:' + \
|
||||
sharedItem['displayName'] + '?mention=' + contactActor + \
|
||||
'"><button class="button">' + translate['Contact'] + \
|
||||
'"><button class="button">' + contactTitleStr + \
|
||||
'</button></a>\n' + \
|
||||
'<a href="' + contactActor + '"><button class="button">' + \
|
||||
translate['View'] + '</button></a>\n'
|
||||
translate['Profile'] + '</button></a>\n'
|
||||
|
||||
# should the remove button be shown?
|
||||
showRemoveButton = False
|
||||
|
@ -1372,7 +1378,7 @@ def htmlShowShare(baseDir: str, domain: str, nickname: str,
|
|||
itemID: str, translate: {},
|
||||
sharedItemsFederatedDomains: [],
|
||||
defaultTimeline: str, theme: str,
|
||||
sharesFileType: str) -> str:
|
||||
sharesFileType: str, category: str) -> str:
|
||||
"""Shows an individual shared item after selecting it from the left column
|
||||
"""
|
||||
sharesJson = None
|
||||
|
@ -1437,7 +1443,7 @@ def htmlShowShare(baseDir: str, domain: str, nickname: str,
|
|||
shareStr += \
|
||||
htmlSearchResultShare(baseDir, sharedItem, translate, httpPrefix,
|
||||
domainFull, contactNickname, itemID,
|
||||
actor, sharesFileType)
|
||||
actor, sharesFileType, category)
|
||||
|
||||
cssFilename = baseDir + '/epicyon-profile.css'
|
||||
if os.path.isfile(baseDir + '/epicyon.css'):
|
||||
|
|
Loading…
Reference in New Issue