mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-25 10:08:36 +02:00
@@ -115,7 +115,7 @@ class TransactionForm(forms.ModelForm):
|
|||||||
"type",
|
"type",
|
||||||
template="transactions/widgets/income_expense_toggle_buttons.html",
|
template="transactions/widgets/income_expense_toggle_buttons.html",
|
||||||
),
|
),
|
||||||
Switch("is_paid"),
|
Field("is_paid", template="transactions/widgets/paid_toggle_button.html"),
|
||||||
Row(
|
Row(
|
||||||
Column("account", css_class="form-group col-md-6 mb-0"),
|
Column("account", css_class="form-group col-md-6 mb-0"),
|
||||||
Column("entities", css_class="form-group col-md-6 mb-0"),
|
Column("entities", css_class="form-group col-md-6 mb-0"),
|
||||||
|
|||||||
18
app/templates/transactions/widgets/paid_toggle_button.html
Normal file
18
app/templates/transactions/widgets/paid_toggle_button.html
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{% load i18n %}
|
||||||
|
{% load crispy_forms_field %}
|
||||||
|
|
||||||
|
<div class="form-group mb-3">
|
||||||
|
<div class="btn-group w-100" role="group" aria-label="{{ field.label }}">
|
||||||
|
<input type="radio" class="btn-check" name="{{ field.name }}" id="{{ field.id_for_label }}_false"
|
||||||
|
value="false" {% if not field.value %}checked{% endif %}>
|
||||||
|
<label class="btn btn-outline-primary w-50" for="{{ field.id_for_label }}_false">{% trans 'Projected' %}</label>
|
||||||
|
|
||||||
|
<input type="radio" class="btn-check" name="{{ field.name }}" id="{{ field.id_for_label }}_true"
|
||||||
|
value="true" {% if field.value %}checked{% endif %}>
|
||||||
|
<label class="btn btn-outline-success w-50" for="{{ field.id_for_label }}_true">{% trans 'Paid' %}</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if field.help_text %}
|
||||||
|
<div class="help-text">{{ field.help_text|safe }}</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
Reference in New Issue
Block a user