Add support for background color app setting

This commit is contained in:
Lance Edgar 2019-02-03 14:40:21 -06:00
parent 2f048b45c9
commit 05bb8a2df0
3 changed files with 10 additions and 1 deletions

View file

@ -124,6 +124,9 @@ def before_render(event):
renderer_globals['messaging_enabled'] = request.rattail_config.getbool(
'tailbone', 'messaging.enabled', default=False)
renderer_globals['background_color'] = request.rattail_config.get(
'tailbone', 'background_color')
def add_inbox_count(event):
"""

View file

@ -11,6 +11,12 @@
${base_meta.favicon()}
${self.header_core()}
% if background_color:
<style type="text/css">
body { background-color: ${background_color}; }
</style>
% endif
% if not request.rattail_config.production():
<style type="text/css">
body { background-image: url(${request.static_url('tailbone:static/img/testing.png')}); }

View file

@ -163,7 +163,7 @@ class AppSettingsView(View):
for setting in self.iter_known_settings():
value = form.validated[setting.node_name]
if value is colander.null:
value = None
value = ''
self.save_setting_value(setting, value)
def iter_known_settings(self):