diff --git a/daemon.py b/daemon.py index 06bc0471..72e7bce2 100644 --- a/daemon.py +++ b/daemon.py @@ -76,6 +76,7 @@ from roles import setRole from roles import clearModeratorStatus from skills import outboxSkills from availability import outboxAvailability +from webinterface import htmlPersonOptions from webinterface import htmlIndividualPost from webinterface import htmlProfile from webinterface import htmlInbox @@ -808,6 +809,23 @@ class PubServer(BaseHTTPRequestHandler): self.server.GETbusy=False return + # show the person options screen with view/follow/block/report + if '/users/' in self.path: + if '?options=' in self.path: + optionsStr=self.path.split('?options=')[1] + originPathStr=self.path.split('?options=')[0] + if ';' in optionsStr: + optionsActor=optionsStr.split(';')[0] + optionsProfileUrl=optionsStr.split(';')[1] + msg=htmlPersonOptions(self.server.baseDir,originPathStr,optionsActor,optionsProfileUrl).encode() + self._set_headers('text/html',len(msg),cookie) + self.wfile.write(msg) + self.server.GETbusy=False + return + self._redirect_headers(originPathStr,cookie) + self.server.GETbusy=False + return + # hashtag search if self.path.startswith('/tags/'): pageNumber=1 diff --git a/epicyon-profile.css b/epicyon-profile.css index b239a6e6..1667ec58 100644 --- a/epicyon-profile.css +++ b/epicyon-profile.css @@ -634,8 +634,8 @@ input[type=submit]:hover { /* Links inside the dropdown */ .dropdown-timeline-content a { - color: var(--main-fg-color); - padding: 12px 16px; + color: var(--main-bg-color); + padding: 25px 16px; text-decoration: none; display: block; } @@ -649,10 +649,7 @@ input[type=submit]:hover { /* Change the background color of the dropdown button when the dropdown content is shown */ .dropdown:hover .dropbtn {background-color: var(--main-fg-color);} -.dropdown-timeline-content a:hover {background-color: #ddd;} - -/* Show the dropdown menu on hover */ -.dropdown-timeline:hover .dropdown-timeline-content {display: block;} +.dropdown-timeline-content a:hover {color: white;} /* Change the background color of the dropdown button when the dropdown content is shown */ .dropdown-timeline:hover .dropbtn {background-color: var(--main-fg-color);} diff --git a/webinterface.py b/webinterface.py index 260782cf..4270cc13 100644 --- a/webinterface.py +++ b/webinterface.py @@ -1253,11 +1253,12 @@ def individualPostAsHtml(baseDir: str, \ avatarDropdown= \ ' ' publishedStr=postJsonObject['object']['published'] @@ -1608,6 +1609,38 @@ def htmlUnfollowConfirm(baseDir: str,originPathStr: str,followActor: str,followP followStr+=htmlFooter() return followStr +def htmlPersonOptions(baseDir: str,originPathStr: str,optionsActor: str,optionsProfileUrl: str) -> str: + """Show options for a person: view/follow/block/report + """ + optionsDomain,port=getDomainFromActor(optionsActor) + + if os.path.isfile(baseDir+'/img/options-background.png'): + if not os.path.isfile(baseDir+'/accounts/options-background.png'): + copyfile(baseDir+'/img/options-background.png',baseDir+'/accounts/options-background.png') + + with open(baseDir+'/epicyon-follow.css', 'r') as cssFile: + profileStyle = cssFile.read() + optionsStr=htmlHeader(profileStyle) + optionsStr+='
' + optionsStr+='
' + optionsStr+='
' + optionsStr+=' ' + optionsStr+=' ' + optionsStr+='

Options '+getNicknameFromActor(optionsActor)+'@'+optionsDomain+' ?

' + optionsStr+= \ + '
' \ + ' ' \ + ' ' \ + ' ' \ + ' ' \ + ' ' \ + '
' + optionsStr+='
' + optionsStr+='
' + optionsStr+='
' + optionsStr+=htmlFooter() + return optionsStr + def htmlBlockConfirm(baseDir: str,originPathStr: str,blockActor: str,blockProfileUrl: str) -> str: """Asks to confirm a block """