Use a checkbox widget to select tournament organizers
This commit is contained in:
parent
4821b090ae
commit
e4fa6c0321
|
@ -109,6 +109,7 @@ class TournamentForm(forms.ModelForm):
|
||||||
format=formats.get_format_lazy(format_type="DATETIME_INPUT_FORMATS", use_l10n=True)[0])
|
format=formats.get_format_lazy(format_type="DATETIME_INPUT_FORMATS", use_l10n=True)[0])
|
||||||
self.fields["syntheses_second_phase_limit"].widget = DateTimePickerInput(
|
self.fields["syntheses_second_phase_limit"].widget = DateTimePickerInput(
|
||||||
format=formats.get_format_lazy(format_type="DATETIME_INPUT_FORMATS", use_l10n=True)[0])
|
format=formats.get_format_lazy(format_type="DATETIME_INPUT_FORMATS", use_l10n=True)[0])
|
||||||
|
self.fields["organizers"].widget = forms.CheckboxSelectMultiple()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Tournament
|
model = Tournament
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if user.registration.isadmin or user.registration in tournament.organizers.all %}
|
{% if user.registration.is_admin or user.registration in tournament.organizers.all %}
|
||||||
<div class="card-footer text-center">
|
<div class="card-footer text-center">
|
||||||
<a href="{% url "participation:tournament_update" pk=tournament.pk %}"><button class="btn btn-secondary">{% trans "Edit tournament" %}</button></a>
|
<a href="{% url "participation:tournament_update" pk=tournament.pk %}"><button class="btn btn-secondary">{% trans "Edit tournament" %}</button></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue