new view
This commit is contained in:
@@ -119,6 +119,11 @@ class Reports
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function isDone(): bool
|
||||
{
|
||||
return $this->isReportsTodo(ReportTodoEnum::COMPLETE);
|
||||
}
|
||||
|
||||
public function countTodoReports(): int
|
||||
{
|
||||
$count = 0;
|
||||
@@ -171,11 +176,6 @@ class Reports
|
||||
$this->numberOfReport = $numberOfReport;
|
||||
}
|
||||
|
||||
public function isDone(): bool
|
||||
{
|
||||
return $this->isDone;
|
||||
}
|
||||
|
||||
public function setDone(bool $isDone): static
|
||||
{
|
||||
$this->isDone = $isDone;
|
||||
|
||||
@@ -8,6 +8,7 @@ enum ReportStatus: int {
|
||||
|
||||
public function checkboxColor() : string
|
||||
{
|
||||
return 'primary';
|
||||
return match ($this)
|
||||
{
|
||||
ReportStatus::INSERT => 'primary',
|
||||
@@ -19,8 +20,8 @@ enum ReportStatus: int {
|
||||
{
|
||||
return match ($this)
|
||||
{
|
||||
ReportStatus::INSERT => 'light',
|
||||
ReportStatus::WORKING => 'warning',
|
||||
ReportStatus::INSERT => 'info',
|
||||
ReportStatus::WORKING => 'primary',
|
||||
ReportStatus::COMPLETE => 'success',
|
||||
};
|
||||
}
|
||||
@@ -29,8 +30,7 @@ enum ReportStatus: int {
|
||||
{
|
||||
return match ($this)
|
||||
{
|
||||
ReportStatus::WORKING, ReportStatus::INSERT => 'dark',
|
||||
ReportStatus::COMPLETE => 'white',
|
||||
ReportStatus::WORKING, ReportStatus::INSERT, ReportStatus::COMPLETE => 'dark',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -38,8 +38,7 @@ enum ReportStatus: int {
|
||||
{
|
||||
return match ($this)
|
||||
{
|
||||
ReportStatus::WORKING, ReportStatus::INSERT => 'dark',
|
||||
ReportStatus::COMPLETE => 'light',
|
||||
ReportStatus::WORKING, ReportStatus::INSERT, ReportStatus::COMPLETE => 'dark',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -52,6 +51,16 @@ enum ReportStatus: int {
|
||||
};
|
||||
}
|
||||
|
||||
public function takeBadgeBg(): string
|
||||
{
|
||||
return 'info';
|
||||
return match ($this) {
|
||||
ReportStatus::INSERT => 'info',
|
||||
ReportStatus::WORKING => 'primary',
|
||||
ReportStatus::COMPLETE => 'info'
|
||||
};
|
||||
}
|
||||
|
||||
public function next() : ?ReportStatus
|
||||
{
|
||||
return ReportStatus::tryFrom($this->value+1);
|
||||
|
||||
@@ -12,19 +12,15 @@
|
||||
>
|
||||
{% for id,reports in reportsGroup %}
|
||||
<div class="status-row" style="{% if isOverdue and id == 3 %}display:none{% endif %}">
|
||||
<div class="col">
|
||||
<div class="card text-center text-white bg-dark">
|
||||
<div class="card-title"><h2>{{ reports.status.takeLang }}</h2></div>
|
||||
</div>
|
||||
</div>
|
||||
{% for report in reports.reports %}
|
||||
<div class="col">
|
||||
<div class="card text-{{ reports.status.textColor }} bg-{{ reports.status.backgroundColor }} report-one">
|
||||
<div class="report-number">
|
||||
<div class="badge bg-info text-dark" data-toggle="tooltip" data-placement="bottom" title="Numer sprawozdania">{{ report.number }}</div>
|
||||
</div>
|
||||
{# <img src="..." class="card-img-top" alt="...">#}
|
||||
<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="report-number">
|
||||
<div class="badge bg-{{ reports.status.takeBadgeBg }} text-dark" data-toggle="tooltip" data-placement="bottom" title="Numer sprawozdania">{{ report.number }}</div>
|
||||
</div>
|
||||
<div class="card-header">
|
||||
<h5 class="card-title">
|
||||
{% if is_granted('clientView') %}
|
||||
<a href="{{ path('app_client',{id: report.client.id}) }}" class="link-{{ reports.status.linkColor }}">{{ report.client.strName }}</a>
|
||||
@@ -32,8 +28,9 @@
|
||||
{{ report.client.strName }}
|
||||
{% endif %}
|
||||
</h5>
|
||||
{# <h6 class="card-subtitle text-muted">Numer sprawozdania: </h6>#}
|
||||
<div class="card-text">
|
||||
</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') }}">
|
||||
@@ -60,12 +57,27 @@
|
||||
{% 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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user