From 32a86f6e3ae89e41dcb37e9342c67692627620e4 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 28 Jul 2019 21:14:45 +0100 Subject: [PATCH] Dropdowns on avatars --- epicyon-profile.css | 21 ++++++++++++++++++++- webinterface.py | 31 +++++++++++++++++++------------ 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/epicyon-profile.css b/epicyon-profile.css index 6abff7df..555717bb 100644 --- a/epicyon-profile.css +++ b/epicyon-profile.css @@ -377,6 +377,23 @@ input[type=submit]:hover { padding: 0px 0px; } +.dropdown-timeline-content { + display: none; + position: absolute; + background-color: #f1f1f1; + min-width: 100px; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + z-index: 1; +} + +/* Links inside the dropdown */ +.dropdown-timeline-content a { + color: black; + padding: 12px 16px; + text-decoration: none; + display: block; +} + /* Change color of dropdown links on hover */ .dropdown-content a:hover {background-color: #ddd;} @@ -386,8 +403,10 @@ input[type=submit]:hover { /* Change the background color of the dropdown button when the dropdown content is shown */ .dropdown:hover .dropbtn {background-color: #3e8e41;} +.dropdown-timeline-content a:hover {background-color: #ddd;} + /* Show the dropdown menu on hover */ -.dropdown-timeline:hover .dropdown-content {display: block;} +.dropdown-timeline:hover .dropdown-timeline-content {display: block;} /* Change the background color of the dropdown button when the dropdown content is shown */ .dropdown-timeline:hover .dropbtn {background-color: #3e8e41;} diff --git a/webinterface.py b/webinterface.py index ea4dc4cb..a7177d51 100644 --- a/webinterface.py +++ b/webinterface.py @@ -416,7 +416,7 @@ def individualPostAsHtml(session,wfRequest: {},personCache: {}, \ fullDomain=domain if port!=80 and port!=443: fullDomain=domain+':'+str(port) - + if fullDomain not in postJsonObject['actor']: inboxUrl,pubKeyId,pubKey,fromPersonId,sharedInbox,capabilityAcquisition,avatarUrl2,preferredName = \ getPersonBox(session,wfRequest,personCache,'outbox') @@ -424,18 +424,25 @@ def individualPostAsHtml(session,wfRequest: {},personCache: {}, \ avatarUrl=avatarUrl2 if preferredName: titleStr=preferredName+' '+titleStr - + + avatarDropdown= \ + ' ' \ + ' Avatar' + if fullDomain+'/users/'+nickname not in postJsonObject['actor']: + avatarDropdown= \ + ' ' + return \ - '
\n' \ - ' ' \ + '
\n'+ \ + avatarDropdown+ \ '

'+titleStr+'

'+ \ postJsonObject['object']['content']+'\n'+ \ attachmentStr+ \