diff --git a/project/src/Entity/Reports.php b/project/src/Entity/Reports.php index 45148c8..e6e44d7 100644 --- a/project/src/Entity/Reports.php +++ b/project/src/Entity/Reports.php @@ -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; diff --git a/project/src/Enum/ReportStatus.php b/project/src/Enum/ReportStatus.php index 0acf626..758871f 100644 --- a/project/src/Enum/ReportStatus.php +++ b/project/src/Enum/ReportStatus.php @@ -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); diff --git a/project/templates/reports/list.html.twig b/project/templates/reports/list.html.twig index b60e0c7..dca61a2 100644 --- a/project/templates/reports/list.html.twig +++ b/project/templates/reports/list.html.twig @@ -12,59 +12,71 @@ > {% for id,reports in reportsGroup %}
-
-
-

{{ reports.status.takeLang }}

-
-
- {% for report in reports.reports %} -
-
-
-
{{ report.number }}
-
- {# ...#} -
-
- {% if is_granted('clientView') %} - {{ report.client.strName }} - {% else %} - {{ report.client.strName }} - {% endif %} -
-{#
Numer sprawozdania:
#} -
-
- - -
- {% for todo in reportToDoList %} - - - {% endfor %} +
+

{{ reports.status.takeLang }}

+
+ {% for report in reports.reports %} +
+
+
{{ report.number }}
+
+
+
+ {% if is_granted('clientView') %} + {{ report.client.strName }} + {% else %} + {{ report.client.strName }} + {% endif %} +
+
+
+

+ + + +

+ {% for todo in reportToDoList %} + + + {% endfor %} +
+ +

+
+
-
+ {% endfor %}
- {% endfor %} +
{% endfor %}