1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 01:48:21 +02:00

Member templates inherit from member/base.html

This commit is contained in:
Alexandre Iooss
2020-08-25 15:39:57 +02:00
parent 63dc184ce4
commit 2e659c63cd
20 changed files with 192 additions and 203 deletions

View File

@ -21,7 +21,7 @@ class AmountInput(NumberInput):
class Autocomplete(TextInput):
template_name = "member/autocomplete_model.html"
template_name = "autocomplete_model.html"
def __init__(self, model, resetable=False, attrs=None):
super().__init__(attrs)

View File

@ -0,0 +1,14 @@
{% load i18n %}
<input type="hidden" name="{{ widget.name }}" {% if widget.attrs.model_pk %}value="{{ widget.attrs.model_pk }}"{% endif %} id="{{ widget.attrs.id }}_pk">
<input type="text"
{% if widget.value != None and widget.value != "" %}value="{{ widget.value }}"{% endif %}
name="{{ widget.name }}_name" autocomplete="off"
{% for name, value in widget.attrs.items %}
{% ifnotequal value False %}{{ name }}{% ifnotequal value True %}="{{ value|stringformat:'s' }}"{% endifnotequal %}{% endifnotequal %}
{% endfor %}>
{% if widget.resetable %}
<a id="{{ widget.attrs.id }}_reset" class="btn btn-light autocomplete-reset{% if not widget.value %} d-none{% endif %}">{% trans "Reset" %}</a>
{% endif %}
<ul class="list-group list-group-flush" id="{{ widget.attrs.id }}_list">
</ul>