Files
MyMovieDB/templates/index.html
jonnybravo 4f2df7fa86
Some checks failed
Deploy to ras-dan-01 / deploy (push) Failing after -1m24s
try
2025-08-26 15:21:43 +02:00

66 lines
2.4 KiB
HTML

{% extends "base.html" %}
{% block body %}
<a href="/add_movie" class="btn btn-primary mb-3">Film hinzufügen</a>
<form method="post" action="{{ url_for('index') }}">
<div class="row mb-3">
<div class="col">
<label for="search" class="form-label">Suche</label>
<input type="text" name="search" id="search" class="form-control" value="{{ search_query }}">
</div>
</div>
<button type="submit" class="btn btn-primary">Suchen</button>
</form>
<table class="table table-striped table-bordered mt-3">
<thead class="table-dark">
<tr>
<th>Id</th>
<th>Name</th>
<th>Genre</th>
<th>Regie</th>
<th>Medium</th>
<th>Erscheinungsjahr</th>
<th>Aktionen</th>
</tr>
</thead>
<tbody>
{% for list_all in data_all %}
<tr>
<td>{{list_all.get("id")}}</td>
<td>{{list_all.get("titel")}}</td>
<td>{{list_all.get("genre")}}</td>
<td>{{list_all.get("regie")}}</td>
<td>{{list_all.get("medium")}}</td>
<td>{{list_all.get("release_year")}}</td>
<td>
<form action="{{ url_for('delete_movie', movie_id=list_all.get('id')) }}" method="post">
<button type="submit" class="btn btn-danger btn-sm">X</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<nav aria-label="Page navigation">
<ul class="pagination">
<li class="page-item {% if current_page == 1 %}disabled{% endif %}">
<a class="page-link" href="{{ url_for('index', page=1, search=search_query) }}">Erste</a>
</li>
<li class="page-item {% if current_page == 1 %}disabled{% endif %}">
<a class="page-link" href="{{ url_for('index', page=current_page - 1, search=search_query) }}">Zurück</a>
</li>
<li class="page-item disabled">
<a class="page-link" href="#">Seite {{ current_page }} von {{ total_pages }}</a>
</li>
<li class="page-item {% if current_page == total_pages %}disabled{% endif %}">
<a class="page-link" href="{{ url_for('index', page=current_page + 1, search=search_query) }}">Weiter</a>
</li>
<li class="page-item {% if current_page == total_pages %}disabled{% endif %}">
<a class="page-link" href="{{ url_for('index', page=total_pages, search=search_query) }}">Letzte</a>
</li>
</ul>
</nav>
{% endblock %}