Setting theme via profile screen

main
Bob Mottram 2019-11-23 14:13:25 +00:00
parent 46cd500641
commit f8b4e4961d
17 changed files with 122 additions and 17 deletions

View File

@ -150,6 +150,7 @@ from media import removeMetaData
from cache import storePersonInCache
from cache import getPersonFromCache
from httpsig import verifyPostHeaders
from theme import setTheme
import os
import sys
@ -3809,6 +3810,8 @@ class PubServer(BaseHTTPRequestHandler):
if fields['displayNickname']!=actorJson['name']:
actorJson['name']=fields['displayNickname']
actorChanged=True
if fields.get('themeDropdown'):
setTheme(self.server.baseDir,fields['themeDropdown'])
if fields.get('donateUrl'):
currentDonateUrl=getDonationUrl(actorJson)
if fields['donateUrl']!=currentDonateUrl:

View File

@ -180,5 +180,11 @@
"Instance Logo": "Instance Logo",
"Bookmark this post": "Bookmark this post",
"Undo the bookmark": "Undo the bookmark",
"Bookmarks": "Saves"
"Bookmarks": "Saves",
"Theme": "Theme",
"Default": "Default",
"Light": "Light",
"Purple": "Purple",
"Hacker": "Hacker",
"HighVis": "HighVis"
}

View File

@ -180,5 +180,11 @@
"Instance Logo": "Instance Logo",
"Bookmark this post": "Bookmark this post",
"Undo the bookmark": "Undo the bookmark",
"Bookmarks": "Saves"
"Bookmarks": "Saves",
"Theme": "Theme",
"Default": "Default",
"Light": "Light",
"Purple": "Purple",
"Hacker": "Hacker",
"HighVis": "HighVis"
}

View File

@ -180,5 +180,11 @@
"Instance Logo": "Instance Logo",
"Bookmark this post": "Bookmark this post",
"Undo the bookmark": "Undo the bookmark",
"Bookmarks": "Saves"
"Bookmarks": "Saves",
"Theme": "Theme",
"Default": "Default",
"Light": "Light",
"Purple": "Purple",
"Hacker": "Hacker",
"HighVis": "HighVis"
}

View File

@ -180,5 +180,11 @@
"Instance Logo": "Instance Logo",
"Bookmark this post": "Bookmark this post",
"Undo the bookmark": "Undo the bookmark",
"Bookmarks": "Saves"
"Bookmarks": "Saves",
"Theme": "Theme",
"Default": "Default",
"Light": "Light",
"Purple": "Purple",
"Hacker": "Hacker",
"HighVis": "HighVis"
}

View File

@ -180,5 +180,11 @@
"Instance Logo": "Instance Logo",
"Bookmark this post": "Bookmark this post",
"Undo the bookmark": "Undo the bookmark",
"Bookmarks": "Saves"
"Bookmarks": "Saves",
"Theme": "Theme",
"Default": "Default",
"Light": "Light",
"Purple": "Purple",
"Hacker": "Hacker",
"HighVis": "HighVis"
}

View File

@ -180,5 +180,11 @@
"Instance Logo": "Instance Logo",
"Bookmark this post": "Bookmark this post",
"Undo the bookmark": "Undo the bookmark",
"Bookmarks": "Saves"
"Bookmarks": "Saves",
"Theme": "Theme",
"Default": "Default",
"Light": "Light",
"Purple": "Purple",
"Hacker": "Hacker",
"HighVis": "HighVis"
}

View File

@ -180,5 +180,11 @@
"Instance Logo": "Instance Logo",
"Bookmark this post": "Bookmark this post",
"Undo the bookmark": "Undo the bookmark",
"Bookmarks": "Saves"
"Bookmarks": "Saves",
"Theme": "Theme",
"Default": "Default",
"Light": "Light",
"Purple": "Purple",
"Hacker": "Hacker",
"HighVis": "HighVis"
}

View File

@ -180,5 +180,11 @@
"Instance Logo": "Instance Logo",
"Bookmark this post": "Bookmark this post",
"Undo the bookmark": "Undo the bookmark",
"Bookmarks": "Saves"
"Bookmarks": "Saves",
"Theme": "Theme",
"Default": "Default",
"Light": "Light",
"Purple": "Purple",
"Hacker": "Hacker",
"HighVis": "HighVis"
}

View File

@ -180,5 +180,11 @@
"Instance Logo": "Instance Logo",
"Bookmark this post": "Bookmark this post",
"Undo the bookmark": "Undo the bookmark",
"Bookmarks": "Saves"
"Bookmarks": "Saves",
"Theme": "Theme",
"Default": "Default",
"Light": "Light",
"Purple": "Purple",
"Hacker": "Hacker",
"HighVis": "HighVis"
}

View File

@ -180,5 +180,11 @@
"Instance Logo": "Instance Logo",
"Bookmark this post": "Bookmark this post",
"Undo the bookmark": "Undo the bookmark",
"Bookmarks": "Saves"
"Bookmarks": "Saves",
"Theme": "Theme",
"Default": "Default",
"Light": "Light",
"Purple": "Purple",
"Hacker": "Hacker",
"HighVis": "HighVis"
}

View File

@ -180,5 +180,11 @@
"Instance Logo": "Instance Logo",
"Bookmark this post": "Bookmark this post",
"Undo the bookmark": "Undo the bookmark",
"Bookmarks": "Saves"
"Bookmarks": "Saves",
"Theme": "Theme",
"Default": "Default",
"Light": "Light",
"Purple": "Purple",
"Hacker": "Hacker",
"HighVis": "HighVis"
}

View File

@ -176,5 +176,11 @@
"Instance Logo": "Instance Logo",
"Bookmark this post": "Bookmark this post",
"Undo the bookmark": "Undo the bookmark",
"Bookmarks": "Saves"
"Bookmarks": "Saves",
"Theme": "Theme",
"Default": "Default",
"Light": "Light",
"Purple": "Purple",
"Hacker": "Hacker",
"HighVis": "HighVis"
}

View File

@ -180,5 +180,11 @@
"Instance Logo": "Instance Logo",
"Bookmark this post": "Bookmark this post",
"Undo the bookmark": "Undo the bookmark",
"Bookmarks": "Saves"
"Bookmarks": "Saves",
"Theme": "Theme",
"Default": "Default",
"Light": "Light",
"Purple": "Purple",
"Hacker": "Hacker",
"HighVis": "HighVis"
}

View File

@ -180,5 +180,11 @@
"Instance Logo": "Instance Logo",
"Bookmark this post": "Bookmark this post",
"Undo the bookmark": "Undo the bookmark",
"Bookmarks": "Saves"
"Bookmarks": "Saves",
"Theme": "Theme",
"Default": "Default",
"Light": "Light",
"Purple": "Purple",
"Hacker": "Hacker",
"HighVis": "HighVis"
}

View File

@ -180,5 +180,11 @@
"Instance Logo": "Instance Logo",
"Bookmark this post": "Bookmark this post",
"Undo the bookmark": "Undo the bookmark",
"Bookmarks": "Saves"
"Bookmarks": "Saves",
"Theme": "Theme",
"Default": "Default",
"Light": "Light",
"Purple": "Purple",
"Hacker": "Hacker",
"HighVis": "HighVis"
}

View File

@ -593,6 +593,7 @@ def htmlEditProfile(translate: {},baseDir: str,path: str,domain: str,port: int)
instanceStr=''
moderatorsStr=''
themesDropdown=''
adminNickname=getConfigParam(baseDir,'admin')
if path.startswith('/users/'+adminNickname+'/'):
instanceDescription=getConfigParam(baseDir,'instanceDescription')
@ -620,7 +621,18 @@ def htmlEditProfile(translate: {},baseDir: str,path: str,domain: str,port: int)
moderatorsStr+=' '+translate['A list of moderator nicknames. One per line.']
moderatorsStr+=' <textarea id="message" name="moderators" placeholder="'+translate['List of moderator nicknames']+'..." style="height:200px">'+moderators+'</textarea>'
moderatorsStr+='</div>'
themesDropdown= '<div class="container">'
themesDropdown+=' <b>'+translate['Theme']+'</b><br>'
themesDropdown+=' <select id="themeDropdown" class="theme">'
themesDropdown+=' <option value="default">'+translate['Default']+'</option>'
themesDropdown+=' <option value="light">'+translate['Light']+'</option>'
themesDropdown+=' <option value="purple">'+translate['Purple']+'</option>'
themesDropdown+=' <option value="hacker">'+translate['Hacker']+'</option>'
themesDropdown+=' <option value="highvis">'+translate['HighVis']+'</option>'
themesDropdown+=' </select>'
themesDropdown+='</div>'
editProfileForm=htmlHeader(cssFilename,editProfileCSS)
editProfileForm+='<form enctype="multipart/form-data" method="POST" accept-charset="UTF-8" action="'+path+'/profiledata">'
editProfileForm+=' <div class="vertical-center">'
@ -671,7 +683,7 @@ def htmlEditProfile(translate: {},baseDir: str,path: str,domain: str,port: int)
editProfileForm+=' <div class="container">'
editProfileForm+=' <b>'+translate['Skills']+'</b><br>'
editProfileForm+=' '+translate['If you want to participate within organizations then you can indicate some skills that you have and approximate proficiency levels. This helps organizers to construct teams with an appropriate combination of skills.']
editProfileForm+=skillsStr+moderatorsStr
editProfileForm+=skillsStr+themesDropdown+moderatorsStr
editProfileForm+=' </div>'+instanceStr
editProfileForm+=' <div class="container">'
editProfileForm+=' <b>'+translate['Danger Zone']+'</b><br>'