forked from indymedia/epicyon
Back button on search screen
parent
e87f66f62d
commit
fc089022f5
|
@ -1674,8 +1674,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.path=self.path.split('?')[0]
|
self.path=self.path.split('?')[0]
|
||||||
# show the search screen
|
# show the search screen
|
||||||
msg=htmlSearch(self.server.translate, \
|
msg=htmlSearch(self.server.translate, \
|
||||||
self.server.baseDir,self.path, \
|
self.server.baseDir,self.path).encode()
|
||||||
self.server.defaultTimeline).encode()
|
|
||||||
self._set_headers('text/html',len(msg),cookie)
|
self._set_headers('text/html',len(msg),cookie)
|
||||||
self._write(msg)
|
self._write(msg)
|
||||||
self.server.GETbusy=False
|
self.server.GETbusy=False
|
||||||
|
@ -4646,6 +4645,11 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.path.replace('/searchhandle','')
|
self.path.replace('/searchhandle','')
|
||||||
length = int(self.headers['Content-length'])
|
length = int(self.headers['Content-length'])
|
||||||
searchParams=self.rfile.read(length).decode('utf-8')
|
searchParams=self.rfile.read(length).decode('utf-8')
|
||||||
|
if 'submitBack=' in searchParams:
|
||||||
|
# go back on search screen
|
||||||
|
self._redirect_headers(actorStr+'/'+self.server.defaultTimeline,cookie)
|
||||||
|
self.server.POSTbusy=False
|
||||||
|
return
|
||||||
if 'searchtext=' in searchParams:
|
if 'searchtext=' in searchParams:
|
||||||
searchStr=searchParams.split('searchtext=')[1]
|
searchStr=searchParams.split('searchtext=')[1]
|
||||||
if '&' in searchStr:
|
if '&' in searchStr:
|
||||||
|
|
|
@ -3808,23 +3808,20 @@ def htmlHashTagSwarm(baseDir: str,actor: str) -> str:
|
||||||
return tagSwarmHtml
|
return tagSwarmHtml
|
||||||
|
|
||||||
def htmlSearch(translate: {}, \
|
def htmlSearch(translate: {}, \
|
||||||
baseDir: str,path: str, \
|
baseDir: str,path: str) -> str:
|
||||||
defaultTimeline:str) -> str:
|
|
||||||
"""Search called from the timeline icon
|
"""Search called from the timeline icon
|
||||||
"""
|
"""
|
||||||
actor=path.replace('/search','')
|
actor=path.replace('/search','')
|
||||||
nickname=getNicknameFromActor(actor)
|
nickname=getNicknameFromActor(actor)
|
||||||
domain,port=getDomainFromActor(actor)
|
domain,port=getDomainFromActor(actor)
|
||||||
|
|
||||||
backUrl=actor+'/'+defaultTimeline
|
|
||||||
|
|
||||||
if os.path.isfile(baseDir+'/img/search-background.png'):
|
if os.path.isfile(baseDir+'/img/search-background.png'):
|
||||||
if not os.path.isfile(baseDir+'/accounts/search-background.png'):
|
if not os.path.isfile(baseDir+'/accounts/search-background.png'):
|
||||||
copyfile(baseDir+'/img/search-background.png',baseDir+'/accounts/search-background.png')
|
copyfile(baseDir+'/img/search-background.png',baseDir+'/accounts/search-background.png')
|
||||||
|
|
||||||
cssFilename=baseDir+'/epicyon-follow.css'
|
cssFilename=baseDir+'/epicyon-follow.css'
|
||||||
if os.path.isfile(baseDir+'/follow.css'):
|
if os.path.isfile(baseDir+'/follow.css'):
|
||||||
cssFilename=baseDir+'/follow.css'
|
cssFilename=baseDir+'/follow.css'
|
||||||
with open(cssFilename, 'r') as cssFile:
|
with open(cssFilename, 'r') as cssFile:
|
||||||
profileStyle = cssFile.read()
|
profileStyle = cssFile.read()
|
||||||
followStr=htmlHeader(cssFilename,profileStyle)
|
followStr=htmlHeader(cssFilename,profileStyle)
|
||||||
|
@ -3835,7 +3832,7 @@ def htmlSearch(translate: {}, \
|
||||||
followStr+=' <form method="POST" accept-charset="UTF-8" action="'+actor+'/searchhandle">'
|
followStr+=' <form method="POST" accept-charset="UTF-8" action="'+actor+'/searchhandle">'
|
||||||
followStr+=' <input type="hidden" name="actor" value="'+actor+'">'
|
followStr+=' <input type="hidden" name="actor" value="'+actor+'">'
|
||||||
followStr+=' <input type="text" name="searchtext" autofocus><br>'
|
followStr+=' <input type="text" name="searchtext" autofocus><br>'
|
||||||
followStr+=' <a href="'+backUrl+'"><button class="button">'+translate['Go Back']+'</button></a>'
|
followStr+=' <button type="submit" class="button" name="submitBack">'+translate['Go Back']+'</button>'
|
||||||
followStr+=' <button type="submit" class="button" name="submitSearch">'+translate['Submit']+'</button>'
|
followStr+=' <button type="submit" class="button" name="submitSearch">'+translate['Submit']+'</button>'
|
||||||
followStr+=' </form>'
|
followStr+=' </form>'
|
||||||
followStr+=' <p class="hashtagswarm">'+htmlHashTagSwarm(baseDir,actor)+'</p>'
|
followStr+=' <p class="hashtagswarm">'+htmlHashTagSwarm(baseDir,actor)+'</p>'
|
||||||
|
|
Loading…
Reference in New Issue