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:
@ -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)
|
||||
|
14
note_kfet/templates/autocomplete_model.html
Normal file
14
note_kfet/templates/autocomplete_model.html
Normal 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>
|
Reference in New Issue
Block a user