From 0613304724f858151509d2814c7ac3910a0516b0 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Sun, 21 Feb 2016 22:03:25 +0100 Subject: [PATCH] Use colorpicker for projector header color config. --- bower.json | 1 + openslides/core/config.py | 3 ++- openslides/core/signals.py | 1 + openslides/core/static/js/core/site.js | 2 ++ .../core/static/templates/config-form-field.html | 15 +++++++++++++-- 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/bower.json b/bower.json index d4ba767ab..1e4c02839 100644 --- a/bower.json +++ b/bower.json @@ -11,6 +11,7 @@ "angular-animate": "~1.4.9", "angular-sanitize": "~1.4.9", "angular-bootstrap": "~0.14.3", + "angular-bootstrap-colorpicker": "~3.0.24", "angular-csv-import": "~0.0.27", "angular-formly-templates-bootstrap": "~6.2.0", "angular-formly": "~7.3.9", diff --git a/openslides/core/config.py b/openslides/core/config.py index d06a78092..d4d52113d 100644 --- a/openslides/core/config.py +++ b/openslides/core/config.py @@ -9,7 +9,8 @@ INPUT_TYPE_MAPPING = { 'text': str, 'integer': int, 'boolean': bool, - 'choice': str} + 'choice': str, + 'colorpicker': str} class ConfigHandler: diff --git a/openslides/core/signals.py b/openslides/core/signals.py index 4dd295746..e3193a5ce 100644 --- a/openslides/core/signals.py +++ b/openslides/core/signals.py @@ -154,6 +154,7 @@ def setup_general_config(sender, **kwargs): yield ConfigVariable( name='projector_backgroundcolor', default_value='#317796', + input_type='colorpicker', label=ugettext_lazy('Background color of projector header'), help_text=ugettext_lazy('Use web color names like "red" or hex numbers like "#ff0000".'), weight=160, diff --git a/openslides/core/static/js/core/site.js b/openslides/core/static/js/core/site.js index 0c2ac44c5..5313cff86 100644 --- a/openslides/core/static/js/core/site.js +++ b/openslides/core/static/js/core/site.js @@ -7,6 +7,7 @@ angular.module('OpenSlidesApp.core.site', [ 'OpenSlidesApp.core', 'ui.router', 'angular-loading-bar', + 'colorpicker.module', 'formly', 'formlyBootstrap', 'ngBootbox', @@ -402,6 +403,7 @@ angular.module('OpenSlidesApp.core.site', [ integer: 'number', boolean: 'checkbox', choice: 'choice', + colorpicker: 'colorpicker', }[type]; } diff --git a/openslides/core/static/templates/config-form-field.html b/openslides/core/static/templates/config-form-field.html index 1e9c10952..64cd7f555 100644 --- a/openslides/core/static/templates/config-form-field.html +++ b/openslides/core/static/templates/config-form-field.html @@ -2,19 +2,30 @@
- + + type="{{ type }}"> + + + + +