add composer and scaffold out the braindump function

This commit is contained in:
Joren de Graaf
2026-08-13 14:19:26 +02:00
parent 39b3d91e5d
commit 5da8c9f57e
16 changed files with 433 additions and 21 deletions
@@ -0,0 +1,5 @@
<div>
<h2>Ollama says:</h2>
<p>{{ response|nl2br }}</p>
</div>
+47
View File
@@ -0,0 +1,47 @@
{% extends 'base.html.twig' %}
{% block title %}Brain Dump{% endblock %}
{% block body %}
<h1>Brain Dump</h1>
<form
method="post"
action="{{ path('app_braindump_dump') }}"
hx-post="{{ path('app_braindump_dump') }}"
hx-target="#tasks-result"
hx-swap="innerHTML"
>
<input
type="hidden"
name="_token"
value="{{ csrf_token('braindump_dump') }}"
>
<div>
<label for="brain_dump">
What's on your mind?
</label>
<textarea
id="brain_dump"
name="brain_dump"
rows="8"
placeholder="Dump everything that's on your mind..."
required
></textarea>
</div>
<button type="submit">
✨ Suggest tasks
</button>
</form>
<div id="tasks-result">
{# HTMX will put the proposed tasks here #}
</div>
{% endblock %}
@@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_exercise_session_delete', {'id': exercise_session.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ exercise_session.id) }}">
<button class="btn">Delete</button>
</form>
@@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Save') }}</button>
{{ form_end(form) }}
+13
View File
@@ -0,0 +1,13 @@
{% extends 'base.html.twig' %}
{% block title %}Edit ExerciseSession{% endblock %}
{% block body %}
<h1>Edit ExerciseSession</h1>
{{ include('exercise_session/_form.html.twig', {'button_label': 'Update'}) }}
<a href="{{ path('app_exercise_session_index') }}">back to list</a>
{{ include('exercise_session/_delete_form.html.twig') }}
{% endblock %}
@@ -0,0 +1,51 @@
{% extends 'base.html.twig' %}
{% block title %}ExerciseSession index{% endblock %}
{% block body %}
<h1>ExerciseSession index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Type</th>
<th>StartedAt</th>
<th>EndedAt</th>
<th>Duration</th>
<th>Distance</th>
<th>Calories</th>
<th>Notes</th>
<th>Source</th>
<th>CreatedAt</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for exercise_session in exercise_sessions %}
<tr>
<td>{{ exercise_session.id }}</td>
<td>{{ exercise_session.type }}</td>
<td>{{ exercise_session.startedAt ? exercise_session.startedAt|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ exercise_session.endedAt ? exercise_session.endedAt|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ exercise_session.duration }}</td>
<td>{{ exercise_session.distance }}</td>
<td>{{ exercise_session.calories }}</td>
<td>{{ exercise_session.notes }}</td>
<td>{{ exercise_session.source }}</td>
<td>{{ exercise_session.createdAt ? exercise_session.createdAt|date('Y-m-d H:i:s') : '' }}</td>
<td>
<a href="{{ path('app_exercise_session_show', {'id': exercise_session.id}) }}">show</a>
<a href="{{ path('app_exercise_session_edit', {'id': exercise_session.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="11">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_exercise_session_new') }}">Create new</a>
{% endblock %}
+11
View File
@@ -0,0 +1,11 @@
{% extends 'base.html.twig' %}
{% block title %}New ExerciseSession{% endblock %}
{% block body %}
<h1>Create new ExerciseSession</h1>
{{ include('exercise_session/_form.html.twig') }}
<a href="{{ path('app_exercise_session_index') }}">back to list</a>
{% endblock %}
+58
View File
@@ -0,0 +1,58 @@
{% extends 'base.html.twig' %}
{% block title %}ExerciseSession{% endblock %}
{% block body %}
<h1>ExerciseSession</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ exercise_session.id }}</td>
</tr>
<tr>
<th>Type</th>
<td>{{ exercise_session.type }}</td>
</tr>
<tr>
<th>StartedAt</th>
<td>{{ exercise_session.startedAt ? exercise_session.startedAt|date('Y-m-d H:i:s') : '' }}</td>
</tr>
<tr>
<th>EndedAt</th>
<td>{{ exercise_session.endedAt ? exercise_session.endedAt|date('Y-m-d H:i:s') : '' }}</td>
</tr>
<tr>
<th>Duration</th>
<td>{{ exercise_session.duration }}</td>
</tr>
<tr>
<th>Distance</th>
<td>{{ exercise_session.distance }}</td>
</tr>
<tr>
<th>Calories</th>
<td>{{ exercise_session.calories }}</td>
</tr>
<tr>
<th>Notes</th>
<td>{{ exercise_session.notes }}</td>
</tr>
<tr>
<th>Source</th>
<td>{{ exercise_session.source }}</td>
</tr>
<tr>
<th>CreatedAt</th>
<td>{{ exercise_session.createdAt ? exercise_session.createdAt|date('Y-m-d H:i:s') : '' }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_exercise_session_index') }}">back to list</a>
<a href="{{ path('app_exercise_session_edit', {'id': exercise_session.id}) }}">edit</a>
{{ include('exercise_session/_delete_form.html.twig') }}
{% endblock %}