mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-22 13:34:04 +03:00
Fixed read only "generic model editing" properties.
Also forgot in previous commits, i changed the template engine to Handlebars. Its much "versatile", and we need a bit of flexibility (such as conditionals, loops, etc...)
This commit is contained in:
parent
de4a9ff291
commit
ceecb0823d
@ -18,7 +18,7 @@
|
||||
label: f.gui.label,
|
||||
length: f.gui.length,
|
||||
multiline: f.gui.multiline,
|
||||
rdonly: editing ? f.gui.rdonly : false, // rdonly applies just to editing
|
||||
readonly: editing ? f.gui.rdonly : false, // rdonly applies just to editing
|
||||
required: f.gui.required,
|
||||
tooltip: f.gui.tooltip,
|
||||
type: f.gui.type,
|
||||
|
@ -3,7 +3,7 @@
|
||||
{% block field %}
|
||||
<div class="make-switch" data-on-label="{% trans 'Yes' %}" data-off-label="{% trans 'No' %}">
|
||||
{% verbatim %}
|
||||
<input type="checkbox" class="{{ css }}" name="{{ name }}" id="{{ name }}_field" {{# ifequals value true }}checked{{/ ifequals }}>
|
||||
<input type="checkbox" class="{{ css }}" name="{{ name }}" id="{{ name }}_field"{{# ifequals value true }} checked{{/ ifequals }}{{# if readonly }} disabled{{/ if }}>
|
||||
</div>
|
||||
{% endverbatim %}
|
||||
{% endblock %}
|
@ -2,7 +2,7 @@
|
||||
{% load i18n %}
|
||||
{% block field %}
|
||||
{% verbatim %}
|
||||
<select class="selectpicker show-menu-arrow {{ css }}" name="{{ name }}" id="{{ name }}_field">
|
||||
<select class="selectpicker show-menu-arrow {{ css }}" name="{{ name }}" id="{{ name }}_field" {{# if readonly }} disabled{{/ if }}>
|
||||
{{#each values }}
|
||||
<option value="{{ id }}"{{# ifequals id ../value }}selected{{/ ifequals }}>{{ text }}</option>
|
||||
{{/each}}
|
||||
|
@ -2,6 +2,6 @@
|
||||
{% load i18n %}
|
||||
{% block field %}
|
||||
{% verbatim %}
|
||||
<input type="numeric" name="{{ name }}" class="form-control {{ css }}" id="{{ name }}_field" placeholder="{{ tooltip }}" value="{{ value }}">
|
||||
<input type="numeric" name="{{ name }}" class="form-control {{ css }}" id="{{ name }}_field" placeholder="{{ tooltip }}" value="{{ value }}"{{# if readonly }} readonly{{/ if }}>
|
||||
{% endverbatim %}
|
||||
{% endblock %}
|
@ -2,6 +2,6 @@
|
||||
{% load i18n %}
|
||||
{% block field %}
|
||||
{% verbatim %}
|
||||
<input type="text" class="form-control {{ css }}" name="{{ name }}" id="{{ name }}_field" placeholder="{{ tooltip }}" value="{{ value }}">
|
||||
<input type="text" class="form-control {{ css }}" name="{{ name }}" id="{{ name }}_field" placeholder="{{ tooltip }}" value="{{ value }}"{{# if readonly }} readonly{{/ if }}>
|
||||
{% endverbatim %}
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user