Merge pull request #2814 from FinnStutzenstein/ConfigEditor
Use ckeditor in config
This commit is contained in:
commit
58d8f68cc5
@ -31,7 +31,8 @@ Core:
|
||||
- Added template hook system for plugins.
|
||||
- Made a lot of code clean up, improvements and bug fixes in client and
|
||||
backend.
|
||||
- Use CKEditor for editing projector messages.
|
||||
- Use a separate dialog with CKEditor for editing projector messages.
|
||||
- Use CKEditor in settings for text markup.
|
||||
|
||||
Motions:
|
||||
- Added adjustable line numbering mode (outside, inside, none) for each
|
||||
|
@ -7,6 +7,7 @@ from .models import ConfigStore
|
||||
INPUT_TYPE_MAPPING = {
|
||||
'string': str,
|
||||
'text': str,
|
||||
'markupText': str,
|
||||
'integer': int,
|
||||
'boolean': bool,
|
||||
'choice': str,
|
||||
|
@ -60,7 +60,7 @@ def get_config_variables():
|
||||
'free web based presentation and assembly system for '
|
||||
'visualizing and controlling agenda, motions and '
|
||||
'elections of an assembly.',
|
||||
input_type='text',
|
||||
input_type='markupText',
|
||||
label='Legal notice',
|
||||
weight=132,
|
||||
group='General',
|
||||
@ -79,7 +79,7 @@ def get_config_variables():
|
||||
yield ConfigVariable(
|
||||
name='general_event_welcome_text',
|
||||
default_value='[Space for your welcome text.]',
|
||||
input_type='text',
|
||||
input_type='markupText',
|
||||
label='Front page text',
|
||||
weight=136,
|
||||
group='General',
|
||||
|
@ -635,6 +635,7 @@ angular.module('OpenSlidesApp.core.site', [
|
||||
return {
|
||||
string: 'text',
|
||||
text: 'textarea',
|
||||
markupText: 'editor',
|
||||
integer: 'number',
|
||||
boolean: 'checkbox',
|
||||
choice: 'choice',
|
||||
@ -878,11 +879,17 @@ angular.module('OpenSlidesApp.core.site', [
|
||||
'configOptions',
|
||||
'gettextCatalog',
|
||||
'DateTimePickerTranslation',
|
||||
function($scope, MajorityMethodChoices, Config, configOptions, gettextCatalog, DateTimePickerTranslation) {
|
||||
'Editor',
|
||||
function($scope, MajorityMethodChoices, Config, configOptions, gettextCatalog, DateTimePickerTranslation, Editor) {
|
||||
Config.bindAll({}, $scope, 'configs');
|
||||
$scope.configGroups = configOptions.data.config_groups;
|
||||
$scope.dateTimePickerTranslatedButtons = DateTimePickerTranslation.getButtons();
|
||||
|
||||
$scope.ckeditorOptions = Editor.getOptions();
|
||||
$scope.ckeditorOptions.on.change = function (event) {
|
||||
$scope.save(event.editor.element.$.id, this.getData());
|
||||
};
|
||||
|
||||
// save changed config value
|
||||
$scope.save = function(key, value) {
|
||||
Config.get(key).value = value;
|
||||
|
@ -71,6 +71,14 @@
|
||||
id="{{ key }}" class="form-control">
|
||||
</textarea>
|
||||
|
||||
<!-- editor -->
|
||||
<textarea ng-if="type == 'editor'"
|
||||
id="{{ configOption.key }}"
|
||||
ckeditor="ckeditorOptions"
|
||||
ng-model="$parent.value" class="form-control"
|
||||
ng-model-options="{debounce: 1000}">
|
||||
</textarea>
|
||||
|
||||
<!-- select -->
|
||||
<select ng-if="type == 'choice'"
|
||||
ng-model="$parent.value"
|
||||
|
Loading…
Reference in New Issue
Block a user