add options in news form
This commit is contained in:
@@ -54,6 +54,7 @@ def index(request):
|
|||||||
|
|
||||||
if year == "":
|
if year == "":
|
||||||
year = None
|
year = None
|
||||||
|
month = None
|
||||||
|
|
||||||
if not year and month:
|
if not year and month:
|
||||||
messages.info(
|
messages.info(
|
||||||
|
|||||||
@@ -27,18 +27,18 @@
|
|||||||
x-transition:leave-start="scale-100 opacity-100"
|
x-transition:leave-start="scale-100 opacity-100"
|
||||||
x-transition:leave-end="scale-110 opacity-0"
|
x-transition:leave-end="scale-110 opacity-0"
|
||||||
>
|
>
|
||||||
<div class="flex justify-between items-center mb-2">
|
<div class="flex justify-between items-center mb-2">
|
||||||
<h2 class="text-gray-800 sm:section-title sm_section-title-margins sm:w-full">
|
<h2 class="text-gray-800 sm:section-title sm_section-title-margins sm:w-full">
|
||||||
<span class="mr-1 text-gray-400 sm:hidden">
|
<span class="mr-1 text-gray-400 sm:hidden">
|
||||||
<i class="fas fa-filter"></i>
|
<i class="fas fa-filter"></i>
|
||||||
</span>
|
</span>
|
||||||
Auswahl einschränken
|
Auswahl einschränken
|
||||||
</h2>
|
</h2>
|
||||||
<div class="ml-4 -mr-2 px-2 rounded text-xl text-gray-600 sm:hidden cursor-pointer" @click="showModal = false">
|
<div class="ml-4 -mr-2 px-2 rounded text-xl text-gray-600 sm:hidden cursor-pointer" @click="showModal = false">
|
||||||
<i class="far fa-times"></i>
|
<i class="far fa-times"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<form action="" method="POST" class="grid grid-cols-1 gap-2 sm:gap-4" x-data="{ selectedYear: '' }">
|
<form action="" method="POST" class="grid grid-cols-1 gap-2 sm:gap-4" x-data="{ selectedYear: '' }">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
||||||
{% for message in messages %}
|
{% for message in messages %}
|
||||||
@@ -49,54 +49,56 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
<label class="block">
|
||||||
|
<span class="text-gray-700">Jahr</span>
|
||||||
<label class="block">
|
<select class="block w-full mt-1 rounded-md border-gray-300 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50"
|
||||||
<span class="text-gray-700">Jahr</span>
|
x-model="selectedYear"
|
||||||
<select class="block w-full mt-1 rounded-md border-gray-300 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50"
|
|
||||||
x-model="selectedYear"
|
|
||||||
id="id_year"
|
id="id_year"
|
||||||
name="year"
|
name="year"
|
||||||
>
|
>
|
||||||
|
{% for elem in formset.year %}
|
||||||
|
{% if forloop.first %}
|
||||||
|
<option value="">Alle</option>
|
||||||
|
{% else %}
|
||||||
|
{{ elem }}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
<label
|
||||||
|
x-show="selectedYear != ''"
|
||||||
|
x-transition:enter="transition ease-out duration-300"
|
||||||
|
x-transition:enter-start="opacity-0"
|
||||||
|
x-transition:enter-end="opacity-100"
|
||||||
|
x-transition:leave="transition ease-in duration-150"
|
||||||
|
x-transition:leave-start="opacity-100"
|
||||||
|
x-transition:leave-end="opacity-0"
|
||||||
|
>
|
||||||
|
<span class="text-gray-700">Monat</span>
|
||||||
|
<select class="block w-full mt-1 rounded-md border-gray-300 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50"
|
||||||
|
id="id_month"
|
||||||
|
name="month"
|
||||||
|
>
|
||||||
|
{% for elem in formset.month %}
|
||||||
|
{% if forloop.first %}
|
||||||
|
<option value=""></option>
|
||||||
|
{% else %}
|
||||||
|
{{ elem }}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
<label class="inline-flex items-center">
|
||||||
|
<input type="checkbox" id="compact_view" name="checkbox" value="compact_view" {% if compact_view %} checked {% endif %} class="rounded border-gray-300 text-proprietary shadow-sm focus:border-blue-300 focus:ring focus:ring-offset-0 focus:ring-blue-200 focus:ring-opacity-50">
|
||||||
|
<span class="ml-2 text-gray-700">Kompakte Ansicht</span>
|
||||||
|
</label>
|
||||||
|
<label class="inline-flex items-center">
|
||||||
|
<input type="checkbox" id="fet_meeting_only" name="checkbox" value="fet_meeting_only" {% if fet_meeting_only %} checked {% endif %} class="rounded border-gray-300 text-proprietary shadow-sm focus:border-blue-300 focus:ring focus:ring-offset-0 focus:ring-blue-200 focus:ring-opacity-50">
|
||||||
|
<span class="ml-2 text-gray-700">nur FET-Sitzungen</span>
|
||||||
|
</label>
|
||||||
|
<input type="submit" class="block btn btn-primary" value="Anzeigen" name="btn_input">
|
||||||
|
</form>
|
||||||
|
|
||||||
</select>
|
|
||||||
</label>
|
|
||||||
<label
|
|
||||||
x-show="selectedYear != ''"
|
|
||||||
x-transition:enter="transition ease-out duration-300"
|
|
||||||
x-transition:enter-start="opacity-0"
|
|
||||||
x-transition:enter-end="opacity-100"
|
|
||||||
x-transition:leave="transition ease-in duration-150"
|
|
||||||
x-transition:leave-start="opacity-100"
|
|
||||||
x-transition:leave-end="opacity-0"
|
|
||||||
>
|
|
||||||
<span class="text-gray-700">Monat</span>
|
|
||||||
<select class="block w-full mt-1 rounded-md border-gray-300 shadow-sm focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50">
|
|
||||||
<option value="" selected></option>
|
|
||||||
<option value="1">Jänner</option>
|
|
||||||
<option value="2">Februar</option>
|
|
||||||
<option value="3">März</option>
|
|
||||||
<option value="4">April</option>
|
|
||||||
<option value="5">Mai</option>
|
|
||||||
<option value="6">Juni</option>
|
|
||||||
<option value="7">Juli</option>
|
|
||||||
<option value="8">August</option>
|
|
||||||
<option value="9">September</option>
|
|
||||||
<option value="10">Oktober</option>
|
|
||||||
<option value="11">November</option>
|
|
||||||
<option value="12">Dezember</option>
|
|
||||||
</select>
|
|
||||||
</label>
|
|
||||||
<label class="inline-flex items-center">
|
|
||||||
<input type="checkbox" class="rounded border-gray-300 text-proprietary shadow-sm focus:border-blue-300 focus:ring focus:ring-offset-0 focus:ring-blue-200 focus:ring-opacity-50">
|
|
||||||
<span class="ml-2 text-gray-700">Kompakte Ansicht</span>
|
|
||||||
</label>
|
|
||||||
<label class="inline-flex items-center">
|
|
||||||
<input type="checkbox" class="rounded border-gray-300 text-proprietary shadow-sm focus:border-blue-300 focus:ring focus:ring-offset-0 focus:ring-blue-200 focus:ring-opacity-50">
|
|
||||||
<span class="ml-2 text-gray-700">nur FET-Sitzungen</span>
|
|
||||||
</label>
|
|
||||||
<input type="submit" class="block btn btn-primary" value="Anzeigen">
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button id="modal-trigger-1" class="z-10 trigger fixed bottom-4 right-4 bg-proprietary-darker text-blue-50 shadow-lg text-2xl rounded sm:hidden"
|
<button id="modal-trigger-1" class="z-10 trigger fixed bottom-4 right-4 bg-proprietary-darker text-blue-50 shadow-lg text-2xl rounded sm:hidden"
|
||||||
@@ -126,41 +128,4 @@
|
|||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<div class="grid-container">
|
|
||||||
<div class="grid-x grid-margin-x">
|
|
||||||
<div class="cell medium-8">
|
|
||||||
{% for message in messages %}
|
|
||||||
<p id="messages" style="background-color: red">{{message}}</p>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form action="" method="post">
|
|
||||||
{% csrf_token %}
|
|
||||||
<div class="grid-x grid-margin-x padding-top-1">
|
|
||||||
|
|
||||||
{{ formset.management_form }}
|
|
||||||
|
|
||||||
{% for form in formset %}
|
|
||||||
<div class="cell medium-3 large-2 small-10">
|
|
||||||
{{ form.label }}
|
|
||||||
{{ form }}
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
<div class="cell medium-3 large-2 small-10 align-self-middle">
|
|
||||||
<input type="checkbox" id="compact_view" name="checkbox" value="compact_view" {% if compact_view %} checked {% endif %}>
|
|
||||||
<label for="compact_view">kompakte Ansicht</label>
|
|
||||||
|
|
||||||
<input type="checkbox" id="fet_meeting_only" name="checkbox" value="fet_meeting_only" {% if fet_meeting_only %} checked {% endif %}>
|
|
||||||
<label for="fet_meeting_only">nur FET Sitzung</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="cell medium-3 large-2 small-10 align-self-bottom">
|
|
||||||
<input type="submit" class="button" name="btn_input" value="Suchen">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user