Починил кнопку "Назад"

This commit is contained in:
2025-06-02 15:55:41 +04:00
parent 99bf27d3b0
commit 3da56aad0d
2 changed files with 14 additions and 6 deletions

View File

@@ -63,14 +63,15 @@ class StatementController extends Controller
$typesResponse = $this->api->get("{$prefix}/types");
$teachersResponse = $this->api->get("{$prefix}/teachers");
$estimationsResponse = $this->api->get("{$prefix}/estimations");
$user = $this->api->get("{$prefix}/me");
if (
$statementResponse->successful() &&
$groupsResponse->successful() &&
$disciplinesResponse->successful() &&
$typesResponse->successful() &&
$teachersResponse->successful() &&
$estimationsResponse->successful()
$estimationsResponse->successful() &&
$user->successful()
) {
return view('statements.form', [
'statement' => $statementResponse->json(),
@@ -79,7 +80,8 @@ class StatementController extends Controller
'types' => $typesResponse->json(),
'teachers' => $teachersResponse->json(),
'isEdit' => true,
'estimations' => $estimationsResponse->json()
'estimations' => $estimationsResponse->json(),
'user' => $user->json()
]);
}
}

View File

@@ -115,9 +115,15 @@
</a>
@endif
<a href="/statements" class="px-4 py-2 bg-gray-300 text-gray-700 rounded hover:bg-gray-400">
Назад
</a>
@if($user['roles_id'] == 2)
<a href="/my/statements" class="px-4 py-2 bg-gray-300 text-gray-700 rounded hover:bg-gray-400">
Назад
</a>
@elseif($user['roles_id'] == 3)
<a href="/statements" class="px-4 py-2 bg-gray-300 text-gray-700 rounded hover:bg-gray-400">
Назад
</a>
@endif
</div>
<!-- Блок для ввода кода подтверждения (изначально скрыт) -->