minor change views; add opcache
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% import 'navigation/switch_months.html.twig' as navigation %}
|
||||
{% import 'reports/listInclude.html.twig' as sets %}
|
||||
{% block body %}
|
||||
{{ navigation.month_menu('app_base',months,currentMonth) }}
|
||||
<div class="
|
||||
@@ -11,15 +12,28 @@
|
||||
reports-all"
|
||||
>
|
||||
{% for id,reports in reportsGroup %}
|
||||
<div class="status-row" style="{% if isOverdue and id == 3 %}display:none{% endif %}">
|
||||
<div class="card border-{{ reports.status.backgroundColor }} ">
|
||||
<div class="status-row" style="{% if isOverdue and enum(reports.status, 'COMPLETE') %}display:none{% endif %}">
|
||||
<div class="card border-{{ reports.status.backgroundColor }}">
|
||||
<h3 class="card-header">{{ reports.status.takeLang }}</h3>
|
||||
<div class="card-body">
|
||||
{% for report in reports.reports %}
|
||||
<div class="card text-{{ reports.status.textColor }} border-dark report-one">
|
||||
<div class="card text-{{ reports.status.textColor }} border-dark report-one {{ reports.status.name | lower }}">
|
||||
<div class="report-number">
|
||||
<div class="badge bg-{{ reports.status.takeBadgeBg }} text-dark" data-toggle="tooltip" data-placement="bottom" title="Numer sprawozdania">{{ report.number }}</div>
|
||||
</div>
|
||||
{% if enum(reports.status, 'COMPLETE') %}
|
||||
<div class="report-mark-uncompleted">
|
||||
{# <div class="badge bg-danger text-dark" data-toggle="tooltip" data-placement="bottom" title="Oznacz jako nie zakończone">#}
|
||||
|
||||
<form action="{{ path('app_set_status_todo',{id:report.id}) }}" method="post">
|
||||
<input type="hidden" name="token" value="{{ csrf_token('report-status') }}">
|
||||
<input type="hidden" name="unDone" value="1">
|
||||
<button type="submit" class="badge bg-danger text-dark" data-toggle="tooltip" data-placement="bottom" title="Oznacz jako nie zakończone"><i class="fa fa-solid fa-remove"></i></button>
|
||||
</form>
|
||||
|
||||
{# </div>#}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="card-header">
|
||||
<h5 class="card-title">
|
||||
{% if is_granted('clientView') %}
|
||||
@@ -29,50 +43,16 @@
|
||||
{% endif %}
|
||||
</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="card-text">
|
||||
<form action="{{ path('app_set_status_todo') }}" method="post">
|
||||
<input type="hidden" name="reportId" value="{{ report.id }}">
|
||||
<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-{{ reports.status.checkboxColor }} 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>
|
||||
</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</form>
|
||||
</p>
|
||||
</div>
|
||||
<div class="card-footer bg-transparent">
|
||||
<div class="progress">
|
||||
{% set percentageProgress = report.isDone ? 100 : report.countTodoReports / reportToDoList|length * 100 %}
|
||||
<div class="progress-bar progress-bar-striped bg-info"
|
||||
role="progressbar"
|
||||
aria-valuenow="{{ report.countTodoReports }}"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="{{ reportToDoList|length }}"
|
||||
style="width: {{ percentageProgress }}%"
|
||||
>
|
||||
<strong>{{ percentageProgress }}%</strong>
|
||||
</div>
|
||||
{% if not enum(reports.status, 'COMPLETE') %}
|
||||
<div class="card-body">
|
||||
<p class="card-text">{{ sets.statusForm(report, reportToDoList, reports.status) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if enum(reports.status, 'WORKING') %}
|
||||
<div class="card-footer bg-transparent">
|
||||
{{ sets.progress(report, reportToDoList|length) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
{% macro statusForm(report,reportToDoList,reportEnum) %}
|
||||
<form action="{{ path('app_set_status_todo',{id:report.id}) }}" method="post">
|
||||
<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"
|
||||
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>
|
||||
</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</form>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro progress(report, countAllTodos) %}
|
||||
<div class="progress">
|
||||
{% set percentageProgress = report.isDone ? 100 : report.countTodoReports / countAllTodos * 100 %}
|
||||
<div class="progress-bar progress-bar-striped bg-info"
|
||||
role="progressbar"
|
||||
aria-valuenow="{{ report.countTodoReports }}"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="{{ countAllTodos }}"
|
||||
style="width: {{ percentageProgress }}%"
|
||||
>
|
||||
<strong>{{ percentageProgress }}%</strong>
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
Reference in New Issue
Block a user