added mvp.css and more default styling
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<li class="task-list__item{{ not task.isActive ? ' task-list__item--completed' : '' }}">
|
||||
<form>
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('completion' ~ task.id) }}">
|
||||
<input
|
||||
id="task-completion-{{ task.id }}"
|
||||
class="task-list__checkbox"
|
||||
type="checkbox"
|
||||
name="completed"
|
||||
value="1"
|
||||
{{ not task.isActive ? 'checked' : '' }}
|
||||
aria-label="Mark {{ task.title }} as {{ task.isActive ? 'completed' : 'active' }}"
|
||||
hx-post="{{ path('app_task_toggle_completion', {'id': task.id}) }}"
|
||||
hx-include="closest form"
|
||||
hx-target="closest .task-list__item"
|
||||
hx-swap="outerHTML"
|
||||
>
|
||||
<label class="task-list__toggle" for="task-completion-{{ task.id }}" title="Mark {{ task.title }} as {{ task.isActive ? 'completed' : 'active' }}">
|
||||
<span class="material-symbols-outlined task-list__toggle-icon task-list__toggle-icon--unchecked" aria-hidden="true">circle</span>
|
||||
<span class="material-symbols-outlined task-list__toggle-icon task-list__toggle-icon--checked" aria-hidden="true">check_circle</span>
|
||||
<span class="visually-hidden">Mark {{ task.title }} as {{ task.isActive ? 'completed' : 'active' }}</span>
|
||||
</label>
|
||||
<a class="task-list__title" href="{{ path('app_task_edit', {'id': task.id}) }}">{{ task.title }}</a>
|
||||
</form>
|
||||
</li>
|
||||
@@ -1,51 +1,23 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Task index{% endblock %}
|
||||
{% block title %}Tasks{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Task index</h1>
|
||||
<div class="container">
|
||||
<div class="task-list-header">
|
||||
<h1>Tasks</h1>
|
||||
<a class="task-list__new" href="{{ path('app_task_new') }}" aria-label="Create task" title="Create task"><span class="material-symbols-outlined">
|
||||
add
|
||||
</span></a>
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Title</th>
|
||||
<th>Description</th>
|
||||
<th>EstimatedDurationMinutes</th>
|
||||
<th>Priority</th>
|
||||
<th>Category</th>
|
||||
<th>IsRecurring</th>
|
||||
<th>IsActive</th>
|
||||
<th>CreatedAt</th>
|
||||
<th>UpdatedAt</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for task in tasks %}
|
||||
<tr>
|
||||
<td>{{ task.id }}</td>
|
||||
<td>{{ task.title }}</td>
|
||||
<td>{{ task.description }}</td>
|
||||
<td>{{ task.estimatedDurationMinutes }}</td>
|
||||
<td>{{ task.priority }}</td>
|
||||
<td>{{ task.category }}</td>
|
||||
<td>{{ task.isRecurring ? 'Yes' : 'No' }}</td>
|
||||
<td>{{ task.isActive ? 'Yes' : 'No' }}</td>
|
||||
<td>{{ task.createdAt ? task.createdAt|date('Y-m-d H:i:s') : '' }}</td>
|
||||
<td>{{ task.updatedAt ? task.updatedAt|date('Y-m-d H:i:s') : '' }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_task_show', {'id': task.id}) }}">show</a>
|
||||
<a href="{{ path('app_task_edit', {'id': task.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="11">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<ul class="task-list" aria-label="Tasks">
|
||||
{% for task in tasks %}
|
||||
{{ include('task/_task_item.html.twig', {task: task}) }}
|
||||
{% else %}
|
||||
<li class="task-list__empty">No tasks yet.</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<a href="{{ path('app_task_new') }}">Create new</a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user