improve dropdown

This commit is contained in:
Ivan Hörler 2018-02-28 01:23:20 +01:00
parent ab30417a80
commit 1e577f4520
2 changed files with 11 additions and 3 deletions

View File

@ -5,4 +5,13 @@ from currencies.models import ExchangeRate_name
class CurrenciesForm(forms.Form):
currencies = forms.ModelChoiceField(
queryset=ExchangeRate_name.objects.all(),
required=False, empty_label='CHF')
required=False,
empty_label='CHF',
label='CURENCIES',
widget=forms.Select(
attrs={
'onchange': 'currency.submit();',
'class': 'btn-primary dropdown-toggle'
}
)
)

View File

@ -13,11 +13,10 @@
{% else %}
<li><a href="{% url 'login' %}">LOGIN</a></li>
{% endif %}
<li class="dropdown">
<li>
{% if article_view %}
<form id="currency" action="" method="POST" novalidate>
{{ currencies_form.as_ul }}
<li><input type="submit" value="Select"></li>
{% csrf_token %}
</form>
{% endif %}