Skip to content

Commit

Permalink
fix(universities): display for empty sections
Browse files Browse the repository at this point in the history
  • Loading branch information
thejoeejoee committed Nov 15, 2023
1 parent 0d39dd4 commit 4c7ffa5
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions fiesta/apps/sections/templates/sections/universities.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,28 @@


{% block main %}
{% for university, table in object_list|zip:tables %}

<div class="mb-4 flex flex-row justify-between items-center">
<h2 class="text-2xl font-bold flex flex-row items-center gap-x-4">
{{ university.name }}
<a href="{% url "sections:update-section-university" university.pk %}"
{% if object_list %}
{% for university, table in object_list|zip:tables %}
<div class="mb-4 flex flex-row justify-between items-center">
<h2 class="text-lg md:text-2xl font-bold flex flex-row items-center gap-x-4">
{{ university.name }}
<a href="{% url "sections:update-section-university" university.pk %}"
x-data="modal($el.href)"
x-bind="bind"
class="btn btn-xs sm:btn-sm btn-outline btn-warning">change</a>
</h2>
<a class="btn btn-success btn-xs sm:btn-sm btn-outline"
href="{% url "sections:new-section-faculty" university.pk %}"
x-data="modal($el.href)"
x-bind="bind"
class="btn btn-xs sm:btn-sm btn-outline btn-warning">change</a>
</h2>
<a class="btn btn-success btn-xs sm:btn-sm btn-outline"
href="{% url "sections:new-section-faculty" university.pk %}"
x-data="modal($el.href)"
x-bind="bind">{% translate "Add faculty" %}</a>
</div>

<div>{% render_table table %}</div>
<hr class="my-4">
{# {% include "fiestatables/table.html" with table=table %}#}
{% endfor %}
x-bind="bind">{% translate "Add faculty" %}</a>
</div>

<div>{% render_table table %}</div>
<hr class="my-4">
{# {% include "fiestatables/table.html" with table=table %}#}
{% endfor %}
{% else %}
<div class="alert alert-info">{% translate "No universities yet." %}</div>
{% endif %}

{% endblock %}

0 comments on commit 4c7ffa5

Please sign in to comment.