feat: improve mission asset operations
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
{% macro datetime_picker_field(label, name, value='', field_id=None, required=False, wrapper_class='', wrapper_id=None, label_id=None, button_label='选择') %}
|
||||
{% macro datetime_picker_field(label, name, value='', field_id=None, required=False, wrapper_class='', wrapper_id=None, label_id=None, button_label='选择', error=False) %}
|
||||
{% set display_value = value|replace('-', '/')|replace('T', ' ') if value else '' %}
|
||||
{% set picker_id = (field_id or name) ~ '-picker' %}
|
||||
<label class="mission-datetime-control {{ wrapper_class }}"{% if wrapper_id %} id="{{ wrapper_id }}"{% endif %}>
|
||||
<label class="mission-datetime-control {{ wrapper_class }}{% if error %} field-error-shell{% endif %}"{% if wrapper_id %} id="{{ wrapper_id }}"{% endif %}{% if error %} data-field-error="true"{% endif %}>
|
||||
<span class="field-label"{% if label_id %} id="{{ label_id }}"{% endif %}>{{ label }}</span>
|
||||
<div class="mission-datetime-control-row" data-datetime-control>
|
||||
<input class="mission-datetime-display-input" type="text" name="{{ name }}" value="{{ display_value }}" placeholder="YYYY/MM/DD HH:MM" autocomplete="off"{% if field_id %} id="{{ field_id }}"{% endif %}{% if required %} required{% endif %}>
|
||||
<input class="mission-datetime-display-input{% if error %} field-error-input{% endif %}" type="text" name="{{ name }}" value="{{ display_value }}" placeholder="YYYY/MM/DD HH:MM" autocomplete="off"{% if field_id %} id="{{ field_id }}"{% endif %}{% if required %} required{% endif %}>
|
||||
<input class="mission-datetime-picker-proxy" type="datetime-local" value="{{ value }}" id="{{ picker_id }}" tabindex="-1" aria-hidden="true">
|
||||
<button class="secondary-button mission-datetime-picker-button" type="button" data-datetime-picker-target="{{ picker_id }}">{{ button_label }}</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user