fix change template mode; fix schedule view; minor fixes

This commit is contained in:
2024-08-09 14:16:51 +02:00
parent 354aa9c3be
commit 7af9eeab61
16 changed files with 240 additions and 132 deletions
+22 -24
View File
@@ -2,44 +2,42 @@
{% import 'navigation/switch_months.html.twig' as navigation %}
{% block title %}Harmonogramy{% endblock %}
{% block body %}
{# {{ navigation.month_menu('app_schedule',months,currentMonth) }}#}
<div class="row row-cols-2 reports-months-all">
<div class="col">
<a href="{{ path('app_schedule', {typeId:2}) }}" class="card text-center text-white {% if typeId == 2 %}bg-primary{% else %}bg-secondary{% endif %}">
<div class="card-title"><h2>Zaległe</h2></div>
</a>
{# <a href="{{ path('app_schedule', {monthId:-1}) }}" class="btn {% if currentMonth is null %}btn-success{% else %}btn-secondary{% endif %}">Zaległe</a>#}
</div>
<div class="col">
<a href="{{ path('app_schedule', {typeId:1}) }}" class="card text-center text-white {% if typeId == 1 %}bg-primary{% else %}bg-secondary{% endif %}">
<div class="card-title"><h2>Aktualne</h2></div>
</a>
{# <a href="{{ path('app_schedule', {monthId:-1}) }}" class="btn {% if currentMonth is null %}btn-success{% else %}btn-secondary{% endif %}">Zaległe</a>#}
</div>
{# <div class="col">#}
{# <a href="{{ path('app_schedule', {monthId:1}) }}" class="btn {% if currentMonth is null %}btn-success{% else %}btn-secondary{% endif %}">Aktualne</a>#}
{# </div>#}
<div class="row reports-months-all">
<ul class="nav nav-underline nav-fill">
<li class="nav-item position-relative">
<a href="{{ path('app_schedule', {typeId:2}) }}" class="nav-link {% if typeId == 2 %}active{% endif %}">Zaległe</a>
{% if isOverdue %}
<div class="spinner-grow spinner-grow-sm text-danger overdue"></div>
{% endif %}
</li>
<li class="nav-item">
<a href="{{ path('app_schedule', {typeId:1}) }}" class="nav-link {% if typeId == 1 %}active{% endif %}">Aktualne</a>
</li>
</ul>
</div>
<div class="row row-cols-auto reports-all">
<div class="row row-cols-auto schedule-all">
{% for schedule in schedules %}
<div class="col">
<div class="card text-white bg-{{ schedule.getStatus.backgroundColor }}">
<div class="card border-{{ schedule.getStatus.borderColor }}">
<div class="card-body">
<h5 class="card-title">
{% if is_granted('clientView') %}
<a href="{{ path('app_client',{id: schedule.client.id}) }}" class="link-dark">{{ schedule.client.strName }}</a>
<a href="{{ path('app_client',{id: schedule.client.id}) }}">{{ schedule.client.strName }}</a>
{% else %}
<div class="link-dark">{{ schedule.client.strName }}</div>
{% endif %}
</h5>
{% if enum(schedule.getStatus, 'OVERDUE') %}
<h6 class="card-subtitle text-muted text-danger-emphasis">Czas minął: {{ schedule.getTimeLeft }} dni</h6>
<div class="spinner-grow spinner-grow-sm text-danger overdue"></div>
{% else %}
<h6 class="card-subtitle text-muted">Pozostały czas: {{ schedule.getTimeLeft }} dni</h6>
{% endif %}
</div>
<div class="card-footer">
<form action="{{ path('app_schedule_status') }}" method="post">
<form action="{{ path('app_schedule_status',{id:schedule.id}) }}" method="post">
<input type="hidden" name="token" value="{{ csrf_token('schedule-status') }}">
<input type="hidden" name="scheduleId" value="{{ schedule.id }}">
<button type="submit" class="btn btn-success">Wysłano</button>
<button type="submit" class="btn btn-outline-success w-100">Wysłano</button>
</form>
</div>
</div>