Skip to content

Commit

Permalink
Fix empty array error in akademie/index.html.twig
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayvented committed Feb 8, 2024
1 parent ff1cd19 commit 1933bc6
Showing 1 changed file with 43 additions and 37 deletions.
80 changes: 43 additions & 37 deletions templates/akademie/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -33,47 +33,53 @@
</td>
<td>{{ b.zugewiesen|date('d.m.Y') }}</td>
<td>{{ b.start|date('d.m.Y') }}</td>
<td>
{% if b.participations[0].state == 'finished' %}
{% trans from 'general' %}finished{% endtrans %}
{% else %}
{{ b.participations[0].state|trans }}
{% endif %}
</td>
<td>
{% if b.participations[0].state == 'finished' and b.participations[0].passed %}
<svg viewBox="0 0 24 24" class="text-green-600 w-5 h-5">
<path fill="currentColor"
d="M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z">
</path>
</svg>
{% endif %}
</td>
<td>
{% if b.participations[0].state == 'finished' %}
{% if b.participations[0].passed %}
<a href="{{ path('akademie_kurs_zertifikat', {'id':b.id}) }}">
{{ 'result.success.button_cert'|trans }}
</a>
{% if b.participations|length %}
<td>
{% if b.participations[0].state == 'finished' %}
{% trans from 'general' %}finished{% endtrans %}
{% else %}
<a href="{{ path('participation_reset', {'id': b.participations[0].id }) }}">
{% trans from 'questionnaire' %}retry{% endtrans %}
</a>
{{ b.participations[0].state|trans }}
{% endif %}
</td>
<td>
{% if b.participations[0].state == 'finished' and b.participations[0].passed %}
<svg viewBox="0 0 24 24" class="text-green-600 w-5 h-5">
<path fill="currentColor"
d="M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z">
</path>
</svg>
{% endif %}
</td>
<td>
{% if b.participations[0].state == 'finished' %}
{% if b.participations[0].passed %}
<a href="{{ path('akademie_kurs_zertifikat', {'id':b.id}) }}">
{{ 'result.success.button_cert'|trans }}
</a>
{% else %}
<a href="{{ path('participation_reset', {'id': b.participations[0].id }) }}">
{% trans from 'questionnaire' %}retry{% endtrans %}
</a>
{% endif %}
{% endif %}
{% endif %}

{% if b.participations[0].state == 'ongoing' %}
<a href="{{ path('participation_continue', {'id': b.participations[0].id}) }}">
{% trans from 'general' %}continue{% endtrans %}
</a>
{% else %}
{% if b.zugewiesen < today and b.user.akademieUser in b.kurs.team and b.participations[0].state == 'assigned' %}
<a href="{{ path('akademie_kurs',{'kurs':b.id}) }}">
{% trans from 'general' %}start{% endtrans %}
</a>
{% if b.participations[0].state == 'ongoing' %}
<a href="{{ path('participation_continue', {'id': b.participations[0].id}) }}">
{% trans from 'general' %}continue{% endtrans %}
</a>
{% else %}
{% if b.zugewiesen < today and b.user.akademieUser in b.kurs.team and b.participations[0].state == 'assigned' %}
<a href="{{ path('akademie_kurs',{'kurs':b.id}) }}">
{% trans from 'general' %}start{% endtrans %}
</a>
{% endif %}
{% endif %}
{% endif %}
</td>
</td>
{% else %}
<td>-</td>
<td>-</td>
<td>-</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
Expand Down

0 comments on commit 1933bc6

Please sign in to comment.