OpenSlides/openslides/core/static/templates/config-form-field.html
2017-01-07 14:45:58 +01:00

100 lines
3.7 KiB
HTML

<div class="form-group">
<label>{{ label | translate }}</label>
<div class="input-group">
<!-- text/number input, checkbox -->
<input ng-if="type == 'text' || type == 'number' || type == 'checkbox'"
ng-model="$parent.value"
ng-model-options="{debounce: 1000}"
ng-change="save(configOption.key, $parent.value)"
ng-class="{ 'form-control': type != 'checkbox' }"
id="{{ key }}"
type="{{ type }}">
<!-- comments -->
<div class="input-comments" ng-if="type == 'comments'">
<div ng-repeat="entry in $parent.value" class="input-group">
<input ng-model="entry.name"
ng-model-options="{debounce: 1000}"
ng-change="save(configOption.key, $parent.value)"
class="form-control"
id="{{ key }}"
type="text">
<span class="input-group-btn">
<button type=button" class="btn btn-default"
ng-click="entry.public = !entry.public; save(configOption.key, $parent.value);">
<i class="fa" ng-class="entry.public ? 'fa-unlock' : 'fa-lock'"></i>
{{ (entry.public ? 'Public' : 'Private') | translate }}
</button>
<button type="button" class="btn btn-default"
ng-click="removeComment(configOption.key, $parent, $index)">
<i class="fa fa-minus"></i>
<translate>Remove</translate>
</button>
</span>
</div>
<div>
<button type="button" ng-click="addComment(configOption.key, $parent)"
class="btn btn-default btn-sm">
<i class="fa fa-plus"></i>
<translate>Add new comment field</translate>
</button>
</div>
</div>
<!-- colorpicker -->
<input ng-if="type == 'colorpicker'"
colorpicker
class="form-control"
ng-model="$parent.value"
ng-model-options="{debounce: 1000}"
ng-change="save(configOption.key, $parent.value)"
type="text">
<!-- datetimepicker -->
<input ng-if="type == 'datetimepicker'"
class="form-control"
datetime-picker="dd.MM.yyyy HH:mm"
ng-model="$parent.value"
ng-change="save(configOption.key, $parent.value)"
is-open="datetimeOpen[key]"
ng-focus="datetimeOpen[key]=true;"
save-as="'number'"
button-bar="dateTimePickerTranslatedButtons"
default-time="10:00:00">
<!-- textarea -->
<textarea ng-if="type == 'textarea'"
ng-model="$parent.value"
ng-model-options="{debounce: 1000}"
ng-change="save(configOption.key, $parent.value)"
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"
ng-model-options="{debounce: 500}"
ng-change="save(configOption.key, $parent.value)"
id="{{ key }}" class="form-control"
ng-options="option.value as option.display_name | translate for option in choices">
</select>
<span class="input-group-btn">
<button ng-click="reset()" class="btn btn-default" title="{{ default_value | translate }}">
<i class="fa fa-undo"></i>
<translate>Reset</translate>
</button>
</span>
</div>
<p ng-if="help_text" class="help-block">{{ help_text | translate }}</p>
</div>