use Bootstrap because duck everyything

This commit is contained in:
dece 2024-02-25 20:18:24 +01:00
parent 6915e23208
commit d5609f63d3
12 changed files with 38 additions and 30 deletions

View file

@ -1,5 +1,6 @@
twig: twig:
default_path: '%kernel.project_dir%/templates' default_path: '%kernel.project_dir%/templates'
form_themes: ['bootstrap_5_layout.html.twig']
when@test: when@test:
twig: twig:

File diff suppressed because one or more lines are too long

View file

@ -4,21 +4,19 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}LSBC{% endblock %}</title> <title>{% block title %}LSBC{% endblock %}</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
{% block stylesheets %} {% block stylesheets %}
<style>
img { max-width: 100%; }
.help-text { font-size: 0.8em; }
</style>
<link rel="stylesheet" href="/simple-v1.min.css">
{% endblock %} {% endblock %}
</head> </head>
<body> <body>
{% if app.user %} {% if app.user %}
<nav> <nav class="my-3">
<a href="{{ path('app_podcast_index' )}}">Manage podcasts</a> <a href="{{ path('app_podcast_index' )}}" class="btn btn-outline-primary">Manage podcasts</a>
<a href="{{ path('app_episode_index' )}}">Manage episodes</a> <a href="{{ path('app_episode_index' )}}" class="btn btn-outline-primary">Manage episodes</a>
</nav> </nav>
{% endif %} {% endif %}
{% block body %}{% endblock %} <div class="container">
{% block body %}{% endblock %}
</div>
</body> </body>
</html> </html>

View file

@ -1,4 +1,4 @@
<form method="post" action="{{ path('app_episode_delete', {'id': episode.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');"> <form method="post" action="{{ path('app_episode_delete', {'id': episode.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ episode.id) }}"> <input type="hidden" name="_token" value="{{ csrf_token('delete' ~ episode.id) }}">
<button class="btn">Delete</button> <button class="btn btn-danger">Delete</button>
</form> </form>

View file

@ -27,10 +27,14 @@
<td>{{ episode.title }}</td> <td>{{ episode.title }}</td>
<td>{{ episode.publicationDate ? episode.publicationDate|date('Y-m-d H:i:s') : '' }}</td> <td>{{ episode.publicationDate ? episode.publicationDate|date('Y-m-d H:i:s') : '' }}</td>
<td> <td>
<a href="{{ path('app_episode_show', {'id': episode.id}) }}" <a
><button>Show</button></a> href="{{ path('app_episode_show', {'id': episode.id}) }}"
<a href="{{ path('app_episode_edit', {'id': episode.id}) }}" class="btn btn-primary"
><button>Edit</button></a> >Show</a>
<a
href="{{ path('app_episode_edit', {'id': episode.id}) }}"
class="btn btn-primary"
>Edit</a>
</td> </td>
</tr> </tr>
{% else %} {% else %}
@ -43,10 +47,10 @@
{% if podcast is defined %} {% if podcast is defined %}
<a href="{{ path('app_episode_new', {'podcast': podcast.id }) }}" <a href="{{ path('app_episode_new', {'podcast': podcast.id }) }}"
><button>Create new episode of this podcast</button></a> ><button class="btn btn-primary">Create new episode of this podcast</button></a>
<a href="{{ path('app_podcast_show', {'id': podcast.id}) }}">Back to podcast</a> <a href="{{ path('app_podcast_show', {'id': podcast.id}) }}">Back to podcast</a>
{% else %} {% else %}
<a href="{{ path('app_episode_new') }}"><button>Create new episode</button></a> <a href="{{ path('app_episode_new') }}" class="btn btn-primary">Create new episode</a>
<p> <p>
To manage episodes of a specific podcast, open the podcast page and use To manage episodes of a specific podcast, open the podcast page and use
the “Manage podcasts” link. the “Manage podcasts” link.

View file

@ -41,9 +41,9 @@
</tbody> </tbody>
</table> </table>
<a href="{{ path('app_episode_index') }}">back to list</a> <a href="{{ path('app_episode_index') }}">Back to list</a>
<a href="{{ path('app_episode_edit', {'id': episode.id}) }}">edit</a> <a href="{{ path('app_episode_edit', {'id': episode.id}) }}" class="btn btn-primary">Edit</a>
{{ include('episode/_delete_form.html.twig') }} {{ include('episode/_delete_form.html.twig') }}
{% endblock %} {% endblock %}

View file

@ -8,5 +8,5 @@
{% endfor %} {% endfor %}
</ul> </ul>
<p>The <a href="https://git.dece.space/dece/lsbc">LSBC</a> project is licensed as GPLv3.</p> <p>The <a href="https://git.dece.space/dece/lsbc">LSBC</a> project is licensed as GPLv3.</p>
<a href="/login"><button>Login</button></a> <a href="/login" class="btn btn-primary">Login</a>
{% endblock %} {% endblock %}

View file

@ -26,6 +26,6 @@ form { display: flex; flex-direction: column; gap: 0.5em; }
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}"> <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
<button type="submit">Login</button> <button type="submit" class="btn btn-primary">Login</button>
</form> </form>
{% endblock %} {% endblock %}

View file

@ -4,5 +4,5 @@
onsubmit="return confirm('Are you sure you want to delete this podcast?');" onsubmit="return confirm('Are you sure you want to delete this podcast?');"
> >
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ podcast.id) }}"> <input type="hidden" name="_token" value="{{ csrf_token('delete' ~ podcast.id) }}">
<button class="btn">Delete</button> <button class="btn btn-danger">Delete</button>
</form> </form>

View file

@ -1,4 +1,4 @@
{{ form_start(form) }} {{ form_start(form) }}
{{ form_widget(form) }} {{ form_widget(form) }}
<button class="btn">{{ button_label|default('Save') }}</button> <button class="btn btn-primary">{{ button_label|default('Save') }}</button>
{{ form_end(form) }} {{ form_end(form) }}

View file

@ -30,10 +30,14 @@
<td>{{ podcast.author }}</td> <td>{{ podcast.author }}</td>
<td><img src="{{ podcast.logoPath }}" alt="{{ podcast.name }} logo"></td> <td><img src="{{ podcast.logoPath }}" alt="{{ podcast.name }} logo"></td>
<td> <td>
<a href="{{ path('app_podcast_show', {'id': podcast.id}) }}" <a
><button>Show</button></a> href="{{ path('app_podcast_show', {'id': podcast.id}) }}"
<a href="{{ path('app_podcast_edit', {'id': podcast.id}) }}" class="btn btn-primary"
><button>Edit</button></a> >Show</a>
<a
href="{{ path('app_podcast_edit', {'id': podcast.id}) }}"
class="btn btn-primary"
>Edit</a>
</td> </td>
</tr> </tr>
{% else %} {% else %}
@ -44,5 +48,5 @@
</tbody> </tbody>
</table> </table>
<a href="{{ path('app_podcast_new') }}"><button>Create new podcast</button></a> <a href="{{ path('app_podcast_new') }}" class="btn btn-primary">Create new podcast</a>
{% endblock %} {% endblock %}

View file

@ -71,8 +71,10 @@
<a href="{{ path('app_podcast_index') }}">Go back to list</a> <a href="{{ path('app_podcast_index') }}">Go back to list</a>
<a href="{{ path('app_podcast_edit', {'id': podcast.id}) }}" <a
><button>Edit</button></a> href="{{ path('app_podcast_edit', {'id': podcast.id}) }}"
class="btn btn-primary"
>Edit</a>
{{ include('podcast/_delete_form.html.twig') }} {{ include('podcast/_delete_form.html.twig') }}
{% endblock %} {% endblock %}