forked from indymedia/epicyon
Moderation button is highlighted if a new report appears
parent
96fd59d295
commit
b4bcbf4a8c
17
posts.py
17
posts.py
|
@ -1000,7 +1000,7 @@ def createReportPost(baseDir: str,
|
||||||
postTo=moderatorsList
|
postTo=moderatorsList
|
||||||
postCc=None
|
postCc=None
|
||||||
postJsonObject=None
|
postJsonObject=None
|
||||||
for toUrl in postTo:
|
for toUrl in postTo:
|
||||||
postJsonObject= \
|
postJsonObject= \
|
||||||
createPostBase(baseDir,nickname, domain, port, \
|
createPostBase(baseDir,nickname, domain, port, \
|
||||||
toUrl,postCc, \
|
toUrl,postCc, \
|
||||||
|
@ -1010,6 +1010,21 @@ def createReportPost(baseDir: str,
|
||||||
imageDescription,useBlurhash, \
|
imageDescription,useBlurhash, \
|
||||||
True,None, None, subject, \
|
True,None, None, subject, \
|
||||||
None,None,None)
|
None,None,None)
|
||||||
|
if not postJsonObject:
|
||||||
|
continue
|
||||||
|
# save a notification file so that the moderator
|
||||||
|
# knows something new has appeared
|
||||||
|
toNickname=toUrl.split('/users/')[1]
|
||||||
|
handle=toNickname+'@'+domain
|
||||||
|
newReportFile=baseDir+'/accounts/'+handle+'/.newReport'
|
||||||
|
if os.path.isfile(newReportFile):
|
||||||
|
continue
|
||||||
|
try:
|
||||||
|
with open(newReportFile, 'w') as fp:
|
||||||
|
fp.write(toUrl+'/moderation')
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
return postJsonObject
|
return postJsonObject
|
||||||
|
|
||||||
def threadSendPost(session,postJsonStr: str,federationList: [],\
|
def threadSendPost(session,postJsonStr: str,federationList: [],\
|
||||||
|
|
|
@ -2366,6 +2366,14 @@ def htmlTimeline(translate: {},pageNumber: int, \
|
||||||
if boxName=='tlshares':
|
if boxName=='tlshares':
|
||||||
os.remove(newShareFile)
|
os.remove(newShareFile)
|
||||||
|
|
||||||
|
# should the Moderation button be highlighted?
|
||||||
|
newReport=False
|
||||||
|
newReportFile=accountDir+'/.newReport'
|
||||||
|
if os.path.isfile(newReportFile):
|
||||||
|
newReport=True
|
||||||
|
if boxName=='moderation':
|
||||||
|
os.remove(newReportFile)
|
||||||
|
|
||||||
iconsDir=getIconsDir(baseDir)
|
iconsDir=getIconsDir(baseDir)
|
||||||
cssFilename=baseDir+'/epicyon-profile.css'
|
cssFilename=baseDir+'/epicyon-profile.css'
|
||||||
if os.path.isfile(baseDir+'/epicyon.css'):
|
if os.path.isfile(baseDir+'/epicyon.css'):
|
||||||
|
@ -2416,6 +2424,8 @@ def htmlTimeline(translate: {},pageNumber: int, \
|
||||||
sentButton='buttonselected'
|
sentButton='buttonselected'
|
||||||
elif boxName=='moderation':
|
elif boxName=='moderation':
|
||||||
moderationButton='buttonselected'
|
moderationButton='buttonselected'
|
||||||
|
if newReport:
|
||||||
|
moderationButton='buttonselectedhighlighted'
|
||||||
elif boxName=='tlshares':
|
elif boxName=='tlshares':
|
||||||
sharesButton='buttonselected'
|
sharesButton='buttonselected'
|
||||||
if newShare:
|
if newShare:
|
||||||
|
|
Loading…
Reference in New Issue