Switched from flask-bootstrap to standalone Bootstrap 5 and overhaul of UI

This commit is contained in:
Maximilian Wagner
2023-08-03 16:57:57 +02:00
parent d1489c134b
commit 0f2b607e88
55 changed files with 59032 additions and 134 deletions

View File

@@ -1,22 +1,48 @@
{%- extends "bootstrap/base.html" %}
{% import "bootstrap/utils.html" as utils %}
<!DOCTYPE html>
<head>
{% block title %}
ytm-ls
<title>ytm-ls</title>
{% endblock %}
{% block navbar %}
{{ nav.frontend_top.render() }}
{% block head %}
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="/static/bootstrap5/css/bootstrap.min.css" rel="stylesheet">
<script src="/static/bootstrap5/js/bootstrap.min.js"></script>
{% endblock %}
</head>
<body>
{% block body %}
<nav class="navbar navbar-expand-md navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="/">yt-mls</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto">
<li class="nav-item">
<a class="nav-link" href="/downloader">downloader</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/library">library</a>
</li>
</ul>
</div>
</div>
</nav>
{% endblock %}
{% block content %}
{%- with messages = get_flashed_messages(with_categories=True) %}
{%- if messages %}
<div class="row">
<div class="col-md-12">
{{utils.flashed_messages(messages)}}
{% if messages %}
{% for category, message in messages %}
<div class="container d-flex justify-content-center" style="width: fit-content; padding: 1%">
<div class="alert alert-{{ category }} d-flex align-self-center justify-content-center" style="width: 150%" role="alert">{{ message }}</div>
</div>
</div>
{%- endif %}
{% endfor %}
{% endif %}
{%- endwith %}
{% endblock %}
{% endblock %}
</body>

View File

@@ -2,25 +2,32 @@
{% block content %}
{{ super() }}
<div class="container-fluid" style="width: fit-content(105%)">
<table id="videos" class="table">
<thead>
<tr>
<th scope="col" class="text-center">Song</th>
<th scope="col" class="text-center">Download</th>
</tr>
</thead>
<tbody>
{% for video in videos %}
<tr>
<td class="text-center">{{ video['name'] }}</td>
<td class="text-center"><a class="btn" href="/download/{{ video['path'] + video['name'] + video['ext'] }}" download>Link</a></td>
</tr>
{% endfor %}
</tbody>
</table>
<form action="/download/{{ videos[0]['path'] }}">
<input type="submit" class="btn pull-right" value="Download all"/>
</form>
<div class="container" style="width: fit-content(100%); padding: 1.5%">
<div class="card">
<div class="card-body">
<table id="videos" class="table">
<thead>
<tr>
<th scope="col" class="text-center">Song</th>
<th scope="col" class="text-center"></th>
</tr>
</thead>
<tbody>
{% for video in videos %}
<tr>
<td class="text-center">{{ video['name'] }}</td>
<td class="text-center"><a class="btn btn-link" href="/download/{{ video['path'] + video['name'] + video['ext'] }}" download>Download</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="container" style="padding: 1.5%">
<form action="/download/{{ videos[0]['path'] }}">
<input type="submit" class="btn btn-primary float-end" value="Download all"/>
</form>
</div>
</div>
{%- endblock %}

View File

@@ -2,15 +2,29 @@
{% block content %}
{{ super() }}
<div class="container-fluid" style="width: fit-content; align-self: flex-start">
<div class="table-bordered" style="padding: .5cm">
<form method="POST" class="form-group">
{{ form.csrf_token }}
{{ form.url.label(class_="form-text") }} <br>
{{ form.url(class_="form-control") }} <br>
{{ form.ext(class_="form-control") }} <br>
{{ form.submit(class_="btn primary") }}
</form>
<div class="container-fluid d-flex justify-content-center" style="width: fit-content(100%); padding: 1.5%">
<div class="card">
<div class="card-body">
<form method="POST" class="form-group">
{{ form.csrf_token }}
<div class="container-fluid" style="width: fit-content">
<div class="row" style="width: fit-content">
{{ form.url.label(class_="form-label") }}
</div>
<div class="row" style="width: fit-content">
<div class="col">
{{ form.url(class_="form-control") }}
</div>
<div class="col">
{{ form.ext(class_="form-select") }}
</div>
<div class="col" style="width: fit-content">
{{ form.submit(class_="btn btn-primary") }}
</div>
</div>
</div>
</form>
</div>
</div>
{% if form.errors %}

View File

@@ -1,34 +1,34 @@
{%- extends "base.html" %}
{% import "bootstrap/utils.html" as utils %}
{% block content %}
{{ super() }}
<div class="container" style="width: fit-content(105%)">
<div class="container" style="width: fit-content(100%); padding: 1.5%">
{% if running_downloads %}
<div class="card">
<ul class="list-group list-group-flush">
<li class="list-group-item">
<div class="row">
<table id="videos" class="table">
<thead>
<tr>
<th scope="col" class="text-center">Queue</th>
<th scope="col" class="text-center">Started at</th>
</tr>
</thead>
<tbody>
{% for entry in running_downloads %}
<div class="card-body">
<ul class="list-group list-group-flush">
<li class="list-group-item">
<div class="row">
<table id="videos" class="table">
<thead>
<tr>
<td class="text-center"><a href="{{ entry[0] }}" target="_blank">{{ entry[0] }}</a></td>
<td class="text-center">{{ entry[1] }}</td>
<th scope="col" class="text-center">Queue</th>
<th scope="col" class="text-center">Started at</th>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</li>
</ul>
</thead>
<tbody>
{% for entry in running_downloads %}
<tr>
<td class="text-center"><a href="{{ entry[0] }}" target="_blank">{{ entry[0] }}</a></td>
<td class="text-center">{{ entry[1] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</li>
</ul>
</div>
</div>
<br><br>

View File

@@ -2,61 +2,61 @@
{% block content %}
{{ super() }}
<div class="container-fluid" style="width: fit-content(105%)">
<div class="container" style="width: fit-content(100%); padding: 1.5%">
{% if playlists %}
<div class="card">
<ul class="list-group list-group-flush">
<li class="list-group-item">
<div class="row">
<table id="playlists" class="table">
<thead>
<tr>
<th scope="col" class="text-center">Playlists</th>
<th scope="col" class="text-center">Update</th>
</tr>
</thead>
<tbody>
{% for playlist in playlists %}
<tr>
<td class="text-center"><a class="btn" href="/library-playlist?playlist={{ playlist['ROWID'] }}">{{ playlist['name'] }}</a></td>
<td class="text-center"><a class="btn" href="/update/{{ playlist[1] }}">Start</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</li>
</ul>
<div class="card-body">
<table id="playlists" class="table">
<thead>
<tr>
<th scope="col" class="text-center align-middle">Playlists</th>
<th scope="col" class="text-center align-middle">Update</th>
</tr>
</thead>
<tbody>
{% for playlist in playlists %}
<tr>
<td class="text-center align-middle"><a class="btn btn-link" href="/library-playlist?playlist={{ playlist['ROWID'] }}">{{ playlist['name'] }}</a></td>
<td class="text-center align-middle"><a class="btn btn-link" href="/update/{{ playlist[1] }}">Start</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
<br><br>
<br>
{% if videos %}
<div class="card">
<ul class="list-group list-group-flush">
<li class="list-group-item">
<div class="row">
<table id="videos" class="table">
<thead>
<div class="card-body">
<table id="videos" class="table">
<thead>
<tr>
<th scope="col" class="text-center align-middle">Titles not in any playlist</th>
<th scope="col" class="text-center align-middle">Download</th>
</tr>
</thead>
<tbody>
{% for video in videos %}
{% if 'mp3' in video['ext'] %}
<tr>
<td class="text-center align-middle">{{ video['name'] }}</td>
<td class="text-center align-middle"><a class="btn btn-link" href="/download/{{ video['path'] + video['name'] + video['ext'] }}" download>Download</a></td>
</tr>
{% endif %}
{% if 'mp4' in video['ext'] %}
<tr>
<th scope="col" class="text-center">Title</th>
<th scope="col" class="text-center">Download</th>
<td class="text-center align-middle">{{ video['name'] }}</td>
<td class="text-center align-middle"><a class="btn btn-link" href="/player?file={{ video['path'] + video['name'] + video['ext'] }}">Watch</a></td>
</tr>
</thead>
<tbody>
{% for video in videos %}
<tr>
<td class="text-center">{{ video['name'] }}</td>
<td class="text-center"><a class="btn" href="/download/{{ video['path'] + video['name'] + video['ext'] }}" download>Link</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</li>
</ul>
</div>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
{%- endblock %}

View File

@@ -0,0 +1,12 @@
{%- extends "base.html" %}
{% block content %}
{{ super() }}
<div class="container-fluid">
<div id="trailer" class="section d-flex justify-content-center embed-responsive embed-responsive-16by9">
<video class="embed-responsive-item" style="width: 100%; padding: 1.5%; height: auto" controls>
<source src="serve?file=video" type="video/webm">
</video>
</div>
</div>
{%- endblock %}