diff --git a/src/Entity/Chix.php b/src/Entity/Chix.php index c9e19a0..72d4d23 100644 --- a/src/Entity/Chix.php +++ b/src/Entity/Chix.php @@ -105,4 +105,15 @@ class Chix return $this; } + + public function hasApproveFromUser(UserInterface $user): bool + { + foreach ($this->approves as $approve) { + if ($approve->getUser()->isEqual($user)) { + return true; + } + } + + return false; + } } diff --git a/src/Service/ChixService.php b/src/Service/ChixService.php index f98c075..1da95a2 100644 --- a/src/Service/ChixService.php +++ b/src/Service/ChixService.php @@ -66,8 +66,6 @@ class ChixService $this->entityManager->persist($chix); $this->entityManager->flush(); - dump($chix); - return $chix->getId(); } diff --git a/templates/chix/view.html.twig b/templates/chix/view.html.twig index a71d7a3..1172f44 100644 --- a/templates/chix/view.html.twig +++ b/templates/chix/view.html.twig @@ -27,7 +27,7 @@ {{ chix.getCreatedAt|date('Y-m-d H:i:s') }} - Аппрувы + Санитары {% for approve in chix.approves %}
@@ -40,7 +40,7 @@ Статус - {{ chix.isVerified ? 'Утверждено' : 'В проработке' }} + {{ chix.isVerified ? 'Подлечен' : 'На лечении' }} @@ -55,7 +55,7 @@ {% if isCanApprove %} - Апрувнуть! + Будь здоров! {% endif %}
diff --git a/templates/index/index.html.twig b/templates/index/index.html.twig index fc51273..e2a054c 100644 --- a/templates/index/index.html.twig +++ b/templates/index/index.html.twig @@ -1,16 +1,29 @@ {% extends 'main.html.twig' %} {% block content %} -
+

Сегодня {{ 'now'|date('d.m.Y') }}

+ {% if is_granted('ROLE_USER') %} + + + Зафиксировать себя! + + {% else %} +

Залогиньтесь чтобы отравиться на экспертизу!

+ {% endif %} + - + + @@ -27,9 +40,29 @@
{{ chix.user.name }}
+ {% if is_granted('ROLE_USER') %} + {% if not (chix.user.isEqual(app.user) or chix.hasApproveFromUser(app.user)) %} + + + Будь здоров! + + {% endif %} + {% endif %} - + + {% endfor %} @@ -37,7 +70,7 @@
# Чел КогдаВерифайСанитары
{{ chix.createdAt|date('H:i:s') }} + + + {% for approve in chix.approves %} + {#
#} + + {#
{{ approve.user.name }}
#} + {#
#} + {% endfor %} + + +
{% if is_granted('ROLE_USER') %} -

Апрувы

+

Последние лекари.

@@ -70,7 +103,7 @@
{% endif %}
-
+

Борда чихов

@@ -78,30 +111,8 @@ {{ include('index/board.html.twig') }} {% endfor %}
-
-
-

Помните! Нам важен каждый чих!

-

✅ Прожать кнопку

- - {% if is_granted('ROLE_USER') %} -

Если вы чихнули, то, пожалуйста, зафиксируте время и факт произошедшенго.

+

Если вы чихнули, то, пожалуйста, зафиксируте время и факт произошедшего.

Будьте внимательны! Если чихнул Ваш коллега, то не забудьте напомнить ему о акте фиксации.

- - - Зафиксировать себя! - - -

Если заметили подозрительную активность, то проявите социальную ответственность.

- - - Зарепортить о нарушении! - - {% else %} -

Залогиньтесь чтоб делать годноту.

- {% endif %} - +

Помните! Нам важен каждый чих!

{% endblock %} \ No newline at end of file diff --git a/templates/main.html.twig b/templates/main.html.twig index 2968527..5abcef6 100644 --- a/templates/main.html.twig +++ b/templates/main.html.twig @@ -29,7 +29,11 @@ .my-button { background: rgb(66, 184, 221); font-size: 150%; - margin-bottom: 80px; + margin-bottom: 10px; + } + .my-btn-small { + background: rgb(66, 184, 221); + font-size: 70%; } .color-green { color:green;