fix change template mode; fix schedule view; minor fixes
This commit is contained in:
@@ -1,31 +1,20 @@
|
||||
{% macro month_menu(routeName, months, currentMonth) %}
|
||||
{% macro month_menu(routeName, months, currentMonth, countOverdueLeft) %}
|
||||
<div class="row reports-months-all">
|
||||
{# <div class="col">#}
|
||||
{# <div class="card">#}
|
||||
{# <a href="{{ path(routeName, {monthId:-1}) }}" class="btn {% if currentMonth is null %}btn-success{% else %}btn-secondary{% endif %}">Zaległe</a>#}
|
||||
{# </div>#}
|
||||
{# </div>#}
|
||||
{# {% for id,month in months %}#}
|
||||
{# {% set isCurrent = currentMonth is not null and month | date("Y-m") == currentMonth | date("Y-m") %}#}
|
||||
{# <div class="col col-xxl-1 col-xl-2 col-lg-2 col-md-3 col-sm-3 col-4">#}
|
||||
{# <div class="card">#}
|
||||
{# <a href="{{ path(routeName,{monthId: id}) }}" class="btn {% if isCurrent %}btn-success{% else %}btn-secondary{% endif %}">#}
|
||||
{# {% if routeName=='app_schedule' %}#}
|
||||
{# {{ id }}#}
|
||||
{# {% else %}#}
|
||||
{# {{ month | date("Y-m") }}#}
|
||||
{# {% endif %}#}
|
||||
{# </a>#}
|
||||
{# </div>#}
|
||||
{# </div>#}
|
||||
{# {% endfor %}#}
|
||||
<ul class="nav nav-underline nav-fill">
|
||||
<li class="nav-item">
|
||||
<li class="nav-item position-relative">
|
||||
<a href="{{ path(routeName, {monthId:-1}) }}" class="nav-link {% if currentMonth is null %}active{% endif %}">Zaległe</a>
|
||||
{% if countOverdueLeft > 0 %}
|
||||
<div class="spinner-grow spinner-grow-sm text-danger overdue"></div>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% for id,month in months %}
|
||||
{% for id,obj in months %}
|
||||
{% set month = obj.date %}
|
||||
{% set isCurrent = currentMonth is not null and month | date("Y-m") == currentMonth | date("Y-m") %}
|
||||
<li class="nav-item">
|
||||
<li class="nav-item position-relative"
|
||||
{% if obj.overdueCount > 0 %}
|
||||
data-toggle="tooltip" data-bs-placement="bottom" title="Zaległe sprawozdania do zrobienia"
|
||||
{% endif %}
|
||||
>
|
||||
<a class="nav-link {% if isCurrent %} active{% endif %}" href="{{ path(routeName,{monthId: id}) }}">
|
||||
{% if routeName=='app_schedule' %}
|
||||
{{ id }}
|
||||
@@ -33,6 +22,9 @@
|
||||
{{ month | date("Y-m") }}
|
||||
{% endif %}
|
||||
</a>
|
||||
{% if obj.overdueCount > 0 %}
|
||||
<div class="spinner-grow spinner-grow-sm text-danger overdue"></div>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{% import 'navigation/switch_months.html.twig' as navigation %}
|
||||
{% import 'reports/listInclude.html.twig' as sets %}
|
||||
{% block body %}
|
||||
{{ navigation.month_menu('app_base',months,currentMonth) }}
|
||||
{{ navigation.month_menu('app_base',months,currentMonth,countOverdueLeft) }}
|
||||
<div class="
|
||||
row
|
||||
d-flex
|
||||
|
||||
@@ -3,20 +3,27 @@
|
||||
<input type="hidden" name="token" value="{{ csrf_token('report-status') }}">
|
||||
<div class="btn-group" role="group" aria-label="Todos">
|
||||
{% for todo in reportToDoList %}
|
||||
<input onchange="this.form.submit()"
|
||||
name="{{ todo.value }}"
|
||||
type="checkbox"
|
||||
class="btn-check"
|
||||
id="checkboxToDo{{ todo.value }}Id{{ report.id }}"
|
||||
{% if report.isReportsTodo(todo) %}
|
||||
checked="checked"
|
||||
{% endif %}
|
||||
{% if not is_granted('reportEdit') %}
|
||||
disabled
|
||||
{% endif %}
|
||||
autocomplete="off"
|
||||
>
|
||||
<label class="btn btn-outline-{{ reportEnum.checkboxColor }} d-flex align-items-center"
|
||||
<button type="submit" class="btn-check" name="{{ todo.value }}" value='1' id="checkboxToDo{{ todo.value }}Id{{ report.id }}"></button>
|
||||
{# <input onchange="this.form.submit()"#}
|
||||
{# name="{{ todo.value }}"#}
|
||||
{# type="checkbox"#}
|
||||
{# class="btn-check"#}
|
||||
{# id="checkboxToDo{{ todo.value }}Id{{ report.id }}"#}
|
||||
{# {% if report.isReportsTodo(todo) %}#}
|
||||
{# checked="checked"#}
|
||||
{# {% endif %}#}
|
||||
{# {% if not is_granted('reportEdit') %}#}
|
||||
{# disabled#}
|
||||
{# {% endif %}#}
|
||||
{# autocomplete="off"#}
|
||||
{# >#}
|
||||
<label class="btn
|
||||
{% if report.isReportsTodo(todo) %}
|
||||
btn-{{ reportEnum.checkboxColor }}
|
||||
{% else %}
|
||||
btn-outline-{{ reportEnum.checkboxColor }}
|
||||
{% endif %}
|
||||
d-flex align-items-center"
|
||||
for="checkboxToDo{{ todo.value }}Id{{ report.id }}"
|
||||
data-toggle="tooltip" data-placement="bottom" title="{{ todo.takeLang }}">
|
||||
<i class="fa fa-solid fa-{{ todo.takeIcon }}"> </i>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user