Moved the account selection to the end of the record form in the accounting application.

This commit is contained in:
依瑪貓 2020-08-12 23:22:13 +08:00
parent 2c6ed1b8b1
commit e736e51fd3
2 changed files with 34 additions and 34 deletions

View File

@ -24,22 +24,10 @@ First written: 2020/8/5
<div id="{{ record_type }}-{{ no }}-error">{% if record.non_field_errors %}{{ record.non_field_errors.0 }}{% endif %}</div>
<div class="d-flex justify-content-between">
<div class="row">
<div class="col-lg-6">
{% if record.id.value %}
<input type="hidden" name="{{ record_type }}-{{ no }}-id" value="{{ record.id.value }}" />
{% endif %}
<input id="{{ record_type }}-{{ no }}-ord" class="{{ record_type }}-ord" type="hidden" name="{{ record_type }}-{{ no }}-ord" value="{{ order }}" />
<label for="{{ record_type }}-{{ no }}-account" class="record-label">{{ _("Account:")|force_escape }}</label>
<select id="{{ record_type }}-{{ no }}-account" class="form-control record-account {{ record_type }}-account {% if record.account.errors %} is-invalid {% endif %}" name="{{ record_type }}-{{ no }}-account" data-type="{{ record_type }}">
{% if record.account is not None %}
<option value="{{ record.account.value|default:"" }}" selected="selected">{{ record.account.value|default:"" }} {{ record.account_title|default:"" }}</option>
{% else %}
<option value=""></option>
{% endif %}
<option value="">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</option>
</select>
<div id="{{ record_type }}-{{ no }}-account-error" class="invalid-feedback">{{ record.account.errors.0|default:"" }}</div>
</div>
<div class="col-lg-6">
<div class="row">
<div class="col-sm-8">
@ -54,6 +42,18 @@ First written: 2020/8/5
</div>
</div>
</div>
<div class="col-lg-6">
<label for="{{ record_type }}-{{ no }}-account" class="record-label">{{ _("Account:")|force_escape }}</label>
<select id="{{ record_type }}-{{ no }}-account" class="form-control record-account {{ record_type }}-account {% if record.account.errors %} is-invalid {% endif %}" name="{{ record_type }}-{{ no }}-account" data-type="{{ record_type }}">
{% if record.account is not None %}
<option value="{{ record.account.value|default:"" }}" selected="selected">{{ record.account.value|default:"" }} {{ record.account_title|default:"" }}</option>
{% else %}
<option value=""></option>
{% endif %}
<option value="">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</option>
</select>
<div id="{{ record_type }}-{{ no }}-account-error" class="invalid-feedback">{{ record.account.errors.0|default:"" }}</div>
</div>
</div>
<div>
<div class="btn-group d-none d-lg-flex btn-actions-{{ record_type }}">

View File

@ -24,24 +24,10 @@ First written: 2020/8/5
<div id="{{ record_type }}-{{ no }}-error">{% if record.non_field_errors %}{{ record.non_field_errors.0 }}{% endif %}</div>
<div class="d-flex">
<div>
<div class="row">
<div class="col-sm-12">
{% if record.id.value %}
<input type="hidden" name="{{ record_type }}-{{ no }}-id" value="{{ record.id.value }}" />
{% endif %}
<input id="{{ record_type }}-{{ no }}-ord" class="{{ record_type }}-ord" type="hidden" name="{{ record_type }}-{{ no }}-ord" value="{{ order }}" />
<label for="{{ record_type }}-{{ no }}-account" class="record-label">{{ _("Account:")|force_escape }}</label>
<select id="{{ record_type }}-{{ no }}-account" class="form-control record-account {{ record_type }}-account {% if record.account.errors %} is-invalid {% endif %}" name="{{ record_type }}-{{ no }}-account" data-type="{{ record_type }}">
{% if record.account is not None %}
<option value="{{ record.account.value|default:"" }}" selected="selected">{{ record.account.value|default:"" }} {{ record.account_title|default:"" }}</option>
{% else %}
<option value=""></option>
{% endif %}
<option value="">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</option>
</select>
<div id="{{ record_type }}-{{ no }}-account-error" class="invalid-feedback">{{ record.account.errors.0|default:"" }}</div>
</div>
</div>
<div class="row">
<div class="col-lg-8">
<label for="{{ record_type }}-{{ no }}-summary" class="record-label">{{ _("Summary:")|force_escape }}</label>
@ -54,6 +40,20 @@ First written: 2020/8/5
<div id="{{ record_type }}-{{ no }}-amount-error" class="invalid-feedback">{{ record.amount.errors.0|default:"" }}</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<label for="{{ record_type }}-{{ no }}-account" class="record-label">{{ _("Account:")|force_escape }}</label>
<select id="{{ record_type }}-{{ no }}-account" class="form-control record-account {{ record_type }}-account {% if record.account.errors %} is-invalid {% endif %}" name="{{ record_type }}-{{ no }}-account" data-type="{{ record_type }}">
{% if record.account is not None %}
<option value="{{ record.account.value|default:"" }}" selected="selected">{{ record.account.value|default:"" }} {{ record.account_title|default:"" }}</option>
{% else %}
<option value=""></option>
{% endif %}
<option value="">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</option>
</select>
<div id="{{ record_type }}-{{ no }}-account-error" class="invalid-feedback">{{ record.account.errors.0|default:"" }}</div>
</div>
</div>
</div>
<div>
<div class="btn-group-vertical btn-actions-{{ record_type }}">