mirror of
https://github.com/stan220/chixana.git
synced 2026-09-08 16:28:41 +00:00
Added approve button to main page. Design fix.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,8 +66,6 @@ class ChixService
|
||||
$this->entityManager->persist($chix);
|
||||
$this->entityManager->flush();
|
||||
|
||||
dump($chix);
|
||||
|
||||
return $chix->getId();
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<td>{{ chix.getCreatedAt|date('Y-m-d H:i:s') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Аппрувы</td>
|
||||
<td>Санитары</td>
|
||||
<td>
|
||||
{% for approve in chix.approves %}
|
||||
<div style="align-items: center; display: flex;">
|
||||
@@ -40,7 +40,7 @@
|
||||
<tr>
|
||||
<td>Статус</td>
|
||||
<td><i class="fas fa-lg {{ chix.isVerified ? 'fa-check-circle color-green' : 'fa-times-circle color-red' }}">
|
||||
{{ chix.isVerified ? 'Утверждено' : 'В проработке' }}
|
||||
{{ chix.isVerified ? 'Подлечен' : 'На лечении' }}
|
||||
</i>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -55,7 +55,7 @@
|
||||
{% if isCanApprove %}
|
||||
<a class="pure-button my-button" href="{{ path('chix_app_chix_approve', {'chixId': chix.id}) }}" >
|
||||
<i class="fas fa-check-circle fa-lg"></i>
|
||||
Апрувнуть!
|
||||
Будь здоров!
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -1,16 +1,29 @@
|
||||
{% extends 'main.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="pure-u-1-3">
|
||||
<div class="pure-u-1-2">
|
||||
<h1>Сегодня {{ 'now'|date('d.m.Y') }}</h1>
|
||||
|
||||
{% if is_granted('ROLE_USER') %}
|
||||
<a class="pure-button my-button"
|
||||
href="{{ path('chix_app_chix_add') }}"
|
||||
onclick="return confirm('Прямой сейчас будет зафиксирован чих!!')"
|
||||
>
|
||||
<i class="fas fa-pills fa-lg"></i>
|
||||
Зафиксировать себя!
|
||||
</a>
|
||||
{% else %}
|
||||
<p>Залогиньтесь чтобы отравиться на экспертизу!</p>
|
||||
{% endif %}
|
||||
|
||||
<table class="pure-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Чел</th>
|
||||
<th>Когда</th>
|
||||
<th>Верифай</th>
|
||||
<th></th>
|
||||
<th>Санитары</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -27,9 +40,29 @@
|
||||
<img src="{{ chix.user.avatar }}" width="25px" height="25px" style="padding: 4px"/>
|
||||
<div>{{ chix.user.name }}</div>
|
||||
</div>
|
||||
{% if is_granted('ROLE_USER') %}
|
||||
{% if not (chix.user.isEqual(app.user) or chix.hasApproveFromUser(app.user)) %}
|
||||
<a class="pure-button my-btn-small" href="{{ path('chix_app_chix_approve', {'chixId': chix.id}) }}" >
|
||||
<i class="fas fa-check-circle fa-lg"></i>
|
||||
Будь здоров!
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ chix.createdAt|date('H:i:s') }}</td>
|
||||
<td><i class="fas fa-lg {{ chix.isVerified ? 'fa-check-circle color-green' : 'fa-times-circle color-red' }}"></i></td>
|
||||
<td>
|
||||
<i class="fas fa-lg {{ chix.isVerified ? 'fa-check-circle color-green' : 'fa-times-circle color-red' }}"></i>
|
||||
</td>
|
||||
<td>
|
||||
{% for approve in chix.approves %}
|
||||
{#<div style="align-items: center; display: flex;">#}
|
||||
<img src="{{ approve.user.avatar }}" width="25px" height="25px" style="padding: 4px"/>
|
||||
{#<div>{{ approve.user.name }}</div>#}
|
||||
{#</div>#}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
{% endfor %}
|
||||
@@ -37,7 +70,7 @@
|
||||
</table>
|
||||
|
||||
{% if is_granted('ROLE_USER') %}
|
||||
<h1>Апрувы</h1>
|
||||
<h1>Последние лекари.</h1>
|
||||
|
||||
<table class="pure-table">
|
||||
<thead>
|
||||
@@ -70,7 +103,7 @@
|
||||
</table>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="pure-u-1-3">
|
||||
<div class="pure-u-1-2">
|
||||
<div style="padding: 0 20px 0 20px;">
|
||||
<h1>Борда чихов</h1>
|
||||
|
||||
@@ -78,30 +111,8 @@
|
||||
{{ include('index/board.html.twig') }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="pure-u-1-3">
|
||||
<p>Помните! Нам важен каждый чих!</p>
|
||||
<h1> ✅ Прожать кнопку </h1>
|
||||
|
||||
{% if is_granted('ROLE_USER') %}
|
||||
<p>Если вы чихнули, то, пожалуйста, зафиксируте время и факт произошедшенго.</p>
|
||||
<p>Если вы чихнули, то, пожалуйста, зафиксируте время и факт произошедшего.</p>
|
||||
<p>Будьте внимательны! Если чихнул Ваш коллега, то не забудьте напомнить ему о акте фиксации.</p>
|
||||
<a class="pure-button my-button"
|
||||
href="{{ path('chix_app_chix_add') }}"
|
||||
onclick="return confirm('Прямой сейчас будет зафиксирован чих!!')"
|
||||
>
|
||||
<i class="fas fa-pills fa-lg"></i>
|
||||
Зафиксировать себя!
|
||||
</a>
|
||||
|
||||
<p>Если заметили подозрительную активность, то проявите социальную ответственность.</p>
|
||||
<a class="pure-button my-button" href="#" >
|
||||
<i class="far fa-grimace fa-lg"></i>
|
||||
Зарепортить о нарушении!
|
||||
</a>
|
||||
{% else %}
|
||||
<p>Залогиньтесь чтоб делать годноту.</p>
|
||||
{% endif %}
|
||||
|
||||
<p>Помните! Нам важен каждый чих!</p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user