Starting work on adding new dropdown selector.
This commit is contained in:
parent
38bae34247
commit
43b3df9938
2 changed files with 15 additions and 1 deletions
|
|
@ -20,6 +20,12 @@ const MarkDown = {
|
|||
for (const q of root.querySelectorAll('blockquote')) {
|
||||
q.classList.add('blockquote', 'border-start', 'border-5', 'border-success', 'mt-3', 'ps-3');
|
||||
}
|
||||
for (const l of root.querySelectorAll('ul')) {
|
||||
l.classList.add('list-group');
|
||||
}
|
||||
for (const l of root.querySelectorAll('li')) {
|
||||
l.classList.add('list-group-item');
|
||||
}
|
||||
},
|
||||
|
||||
renderInto(el, md) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{# show label unless hidden/custom #}
|
||||
<!-- FIELD: {{ field_name }} ({{ field_type }}) -->
|
||||
{% if field_type != 'hidden' and field_label %}
|
||||
<label for="{{ field_name }}"
|
||||
{% if label_attrs %}{% for k,v in label_attrs.items() %}
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
{% endif %}
|
||||
|
||||
{% if field_type == 'select' %}
|
||||
{#
|
||||
<select name="{{ field_name }}" id="{{ field_name }}"
|
||||
{% if attrs %}{% for k,v in attrs.items() %}
|
||||
{{k}}{% if v is not sameas true %}="{{ v }}"{% endif %}
|
||||
|
|
@ -31,6 +32,13 @@
|
|||
<option value="">-- No selection available --</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
#}
|
||||
{% if value %}
|
||||
{% set sel_label = (options | selectattr('value', 'equalto', value) | first)['label'] %}
|
||||
{% else %}
|
||||
{% set sel_label = "-- Select --" %}
|
||||
{% endif %}
|
||||
<button type="button" class="btn btn-outline-secondary d-block w-100" id="{{ field_name }}-button" data-value="{{ value }}">{{ sel_label }}</button>
|
||||
|
||||
{% elif field_type == 'textarea' %}
|
||||
<textarea name="{{ field_name }}" id="{{ field_name }}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue