Update twig template locations and add assign-supervisor

This commit is contained in:
Ryan Prather 2024-11-30 20:00:20 -05:00
parent 777a95728b
commit ffa728b093
3 changed files with 57 additions and 3 deletions

View File

@ -0,0 +1,48 @@
{% extends 'base.html.twig' %}
{% block body %}
{{ block('nav', 'internal/libs/nav.html.twig') }}
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
{{ block('topnav', 'internal/libs/top-nav.html.twig') }}
<section>
<div class='page-header min-vh-100'>
<div class='container'>
<div class="row">
<div class="col-6 d-lg-flex d-none h-100 my-auto pe-0 position-absolute top-0 start-0 text-center justify-content-center flex-column">
<div class="position-relative bg-gradient-primary h-100 m-3 px-7 border-radius-lg d-flex flex-column justify-content-center" style="background-image: url('/assets/img/illustrations/illustration-signup.jpg'); background-size: cover;"></div>
</div>
<div class='col-xl-4 col-lg-5 col-md-7 d-flex flex-column ms-auto me-auto ms-lg-auto me-lg-5'>
<div class="card card-plain">
<div class="card-header">
<h4 class="font-weight-bolder">Assign Supervisor</h4>
</div>
<div class="card-body">
{{ form_errors(form) }}
{{ form_start(form) }}
<div class='input-group input-group-outline mb-3 is-filled'>
<label for='user_form_job' class='form-label'>Job</label>
<select name='{{ field_name(form.supervisor) }}' id='user_form_supervisor' class='form-control'>
<option value=''></option>
{% for s in supervisors %}
{% set selected = (s.id == data.id) %}
<option value='{{ s.id }}' {% if selected %} selected="true" {% endif %}>{{ s.name }}</option>
{% endfor %}
</select>
</div>
<div class="text-center">
<button type="submit" class="btn btn-lg bg-gradient-dark btn-lg w-100 mt-4 mb-0">Assign Staff Supervisor</button>
</div>
{{ form_end(form) }}
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
{% endblock %}

View File

@ -23,7 +23,7 @@
<th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Name</th>
<th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7 ps-2">Job</th>
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Active Cases</th>
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7"></th>
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Supervisor</th>
<th class="text-secondary opacity-7"></th>
</tr>
</thead>
@ -46,12 +46,18 @@
<td>
<p class='text-xs font-weight-bold mb-0'>{{ user.job.value|lower|capitalize }}</p>
</td>
<td class='align-middle text-center text-sm'>
<td class='align-middle text-center text-xs'>
{{ user.userCases|length }}
</td>
<td class='align-middle text-center'></td>
<td class='align-middle text-center text-xs'>
{% if user.supervisor %}
{{ user.supervisor.name }}
{% endif %}
</td>
<td class='align-middle'>
<a href='/index.php/edit-user/{{ user.id }}' class='text-secondary font-weight-bold text-xs' data-toggle='tooltip' data-original-title='Edit user'>Edit</a>
&nbsp;&nbsp;
<a href='/index.php/assign-supervisor/{{ user.id }}' class='text-secondary text-xs' data-toggle='tooltip' data-original-title='Assign supervisor'>Assign</a>
</td>
</tr>
{% endfor %}