mirror of
https://gitlab.com/parroquia-san-leandro/cancionero-web.git
synced 2025-04-26 15:16:19 +02:00
Convert Python templates to django template engine
This commit is contained in:
parent
7f52ff6b6c
commit
fc90400f8f
18 changed files with 225 additions and 196 deletions
6
res/html/footer.html
Normal file
6
res/html/footer.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
<footer>
|
||||
<p>
|
||||
© 2020 Carlos Galindo, Parroquia San Leandro
|
||||
<a href="https://gitlab.com/parroquia-san-leandro/cancionero-web"><span>Código fuente</span></a>
|
||||
</p>
|
||||
</footer>
|
7
res/html/head.html
Normal file
7
res/html/head.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<title>Cancionero - Parroquia San Leandro</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="{{ path|urlencode }}/main.css"/>
|
||||
{% if specific_css %}
|
||||
<link rel="stylesheet" type="text/css" href="{{ path|urlencode }}/{{ specific_css|urlencode }}"/>
|
||||
{% endif %}
|
10
res/html/header.html
Normal file
10
res/html/header.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
<header>
|
||||
<h1><a href="{{ path }}">Cancionero San Leandro</a></h1>
|
||||
<nav class="nav">
|
||||
<ul>
|
||||
<li><a href="https://sanleandro-obispo.net/"><span>Parroquia San Leandro</span></a></li>
|
||||
<li><a href="https://nube.sanleandro-obispo.net/s/X23Jzz5A6dpCfr2"><span>Grabaciones</span></a></li>
|
||||
<li><a href="https://sanleandro-obispo.net/cancionero/"><span>Cancionero en PDF</span></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
25
res/html/index.html
Normal file
25
res/html/index.html
Normal file
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
{% include "head.html" with path="." only %}
|
||||
<link rel="stylesheet" type="text/css" href="index.css"/>
|
||||
</head>
|
||||
<body>
|
||||
{% include "header.html" with path="." %}
|
||||
<h2>Índice</h2>
|
||||
Las canciones sin acordes están marcadas en <span class="noChords">rojo</span>.
|
||||
<ol class="songs">
|
||||
{% for song in songs %}
|
||||
<a href="{{ song.url }}">
|
||||
<li {% if not song.chorded %}class="noChords"{% endif %}>
|
||||
<span class="number">{{ song.number }}.</span>
|
||||
{{ song.name }}
|
||||
{% if song.author %} por {{ song.author }} {% endif %}
|
||||
{% if song.origin %} basado en {{ song.origin }} {% endif %}
|
||||
</li>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
{% include "footer.html" %}
|
||||
</body>
|
||||
</html>
|
110
res/html/song.html
Normal file
110
res/html/song.html
Normal file
|
@ -0,0 +1,110 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
{% include "head.html" with path=".." only %}
|
||||
<link rel="stylesheet" type="text/css" href="../song.css"/>
|
||||
<script async src="../transpose.js"></script>
|
||||
<script async src="../sizes.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
{% include "header.html" with path=".." %}
|
||||
<div class="song">
|
||||
<h2>{{ song.name}}</h2>
|
||||
{% if song.author %}
|
||||
<div>Autor: {{ song.author }}</div>
|
||||
{% endif %}
|
||||
{% if song.origin %}
|
||||
<div>Basada en: {{ song.origin }}</div>
|
||||
{% endif %}
|
||||
<h3>Ajustes</h3>
|
||||
<div>
|
||||
<label>Cambiar tamaño de letra </label>
|
||||
<button class="small" onclick="size(-1)">-</button>
|
||||
<button class="small" onclick="size(0)">Reset</button>
|
||||
<button class="small" onclick="size(+1)">+</button>
|
||||
</div>
|
||||
{% if song.chorded %}
|
||||
<div>
|
||||
<label>Transponer acordes </label>
|
||||
<button class="small" onclick="transposeAdd(-2)">-2</button>
|
||||
<button class="small" onclick="transposeAdd(-1)">-1</button>
|
||||
<select id="transposeSelect" disabled>
|
||||
<option onclick="transpose(-6)">-6</option>
|
||||
<option onclick="transpose(-5)">-5</option>
|
||||
<option onclick="transpose(-4)">-4</option>
|
||||
<option onclick="transpose(-3)">-3</option>
|
||||
<option onclick="transpose(-2)">-2</option>
|
||||
<option onclick="transpose(-1)">-1</option>
|
||||
<option onclick="transpose(0)" selected="selected">0</option>
|
||||
<option onclick="transpose(1)">1</option>
|
||||
<option onclick="transpose(2)">2</option>
|
||||
<option onclick="transpose(3)">3</option>
|
||||
<option onclick="transpose(4)">4</option>
|
||||
<option onclick="transpose(5)">5</option>
|
||||
<option onclick="transpose(6)">6</option>
|
||||
</select>
|
||||
<button class="small" onclick="transposeAdd(1)">+1</button>
|
||||
<button class="small" onclick="transposeAdd(2)">+2</button>
|
||||
<button onclick="transpose(0)">Reset</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if song.capo != 0 %}
|
||||
<div>
|
||||
<span class="capo">Tono original: Cejilla {{ song.capo }}</span>
|
||||
<button style="margin-left: 0.5em;" onclick="transpose({{ song.capo}})">Transponer para quitarla</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<h3>Canción</h3>
|
||||
<div id="wholeSongDiv">
|
||||
{% for verse in song.verses %}
|
||||
<div class="{{ verse.kind }}">
|
||||
{% for line in verse.lines %}
|
||||
{% spaceless %}
|
||||
{% for chord, lyric in line.zipped_arr %}
|
||||
<table class="chordedline">
|
||||
<tr class="chord">
|
||||
<td rowspan="{{ chord.rowspan|default:'1' }}">
|
||||
{% if chord.class %}
|
||||
<span class="{{ chord.class }}"></span>
|
||||
{% endif %}
|
||||
{% for c in chord.chord.items %}
|
||||
{% if c.chord %}
|
||||
<span class="c">{{ c.text|safe }}</span>
|
||||
{% else %}
|
||||
<span>{{ c.text|safe }}</span>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="lyric">
|
||||
<td>
|
||||
{% if 'rowspan' not in chord %}
|
||||
<span>{{ lyric|safe }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% endfor %}
|
||||
{% if not forloop.last %} <br/> {% endif %}
|
||||
{% endspaceless %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% for audio in audios %}
|
||||
{% if forloop.first %}
|
||||
<h3>Audios</h3>
|
||||
{% endif %}
|
||||
<div>
|
||||
Audio del {{ audio.date_text }} <a href="{{ audio.audio_file|urlencode }}"><span>Descargar</span></a>
|
||||
<audio controls style='width: 100%%;'>
|
||||
<source src='{{ audio.audio_file|urlencode }}' type='audio/mpeg'/>
|
||||
</audio>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<a href="https://gitlab.com/parroquia-san-leandro/cancionero-25/blob/master/{{ song.latex_file|urlencode }}"><span>Ver archivo original (LaTeX)</span></a>
|
||||
<a href="../"><span>Índice</span></a>
|
||||
</div>
|
||||
{% include "footer.html" %}
|
||||
</body>
|
||||
</html>
|
12
res/html/song_redir.html
Normal file
12
res/html/song_redir.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
{% include "head.html" with path=".." only %}
|
||||
<meta http-equiv="refresh" content="0; url = ../{{ song.url|urlencode }}">
|
||||
</head>
|
||||
<body>
|
||||
{% include "header.html" with path=".." %}
|
||||
<a href="../{{ song.url|urlencode }}">Redirigiendo a la canción, haz click aquí si no sucede de forma automática.</a>
|
||||
{% include "footer.html" %}
|
||||
</body>
|
||||
</html>
|
|
@ -1,5 +0,0 @@
|
|||
<h2>Índice</h2>
|
||||
<ol class="songs">
|
||||
Las canciones sin acordes están marcadas en <span class="hasChords">rojo</span>.
|
||||
{list_content}
|
||||
</ol>
|
|
@ -20,7 +20,7 @@
|
|||
background-color: @secondary-hover;
|
||||
transition-duration: @transition;
|
||||
}
|
||||
&.hasChords {
|
||||
&.noChords {
|
||||
background-color: @nochordscolor;
|
||||
&:hover {
|
||||
color: @text-hover;
|
||||
|
@ -30,7 +30,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
span.hasChords {
|
||||
span.noChords {
|
||||
background-color: @nochordscolor;
|
||||
padding: 0.3em 0.4em;
|
||||
border-radius: @border-radius;
|
||||
|
|
|
@ -6,6 +6,9 @@ h1 {
|
|||
width: max-content;
|
||||
max-width: 100%;
|
||||
text-align: center;
|
||||
> a, > a:hover, > a:active, > a:visited {
|
||||
color: @title;
|
||||
}
|
||||
}
|
||||
|
||||
h2, h3 {
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Cancionero - Parroquia San Leandro</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
{css}
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>Cancionero San Leandro</h1>
|
||||
<nav class="nav">
|
||||
<ul>
|
||||
<li><a href="https://sanleandro-obispo.net/"><span>Parroquia San Leandro</span></a></li>
|
||||
<li><a href="https://nube.sanleandro-obispo.net/s/X23Jzz5A6dpCfr2"><span>Grabaciones</span></a></li>
|
||||
<li><a href="https://sanleandro-obispo.net/cancionero/"><span>Cancionero en PDF</span></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
{main}
|
||||
</main>
|
||||
<footer>
|
||||
<p>
|
||||
© 2020 Carlos Galindo, Parroquia San Leandro
|
||||
<a href="https://gitlab.com/parroquia-san-leandro/cancionero-web"><span>Código fuente</span></a>
|
||||
</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -1,48 +0,0 @@
|
|||
<div class="song">
|
||||
<script async src="../transpose.js"></script>
|
||||
<script async src="../sizes.js"></script>
|
||||
<h2>{name}</h2>
|
||||
{author}
|
||||
{origin}
|
||||
<h3>Ajustes</h3>
|
||||
<div>
|
||||
<label>Cambiar tamaño de letra </label>
|
||||
<button class="small" onclick="size(-1)">-</button>
|
||||
<button class="small" onclick="size(0)">Reset</button>
|
||||
<button class="small" onclick="size(+1)">+</button>
|
||||
</div>
|
||||
<div>
|
||||
<label>Transponer acordes </label>
|
||||
<button class="small" onclick="transposeAdd(-2)">-2</button>
|
||||
<button class="small" onclick="transposeAdd(-1)">-1</button>
|
||||
<select id="transposeSelect" disabled>
|
||||
<option onclick="transpose(-6)">-6</option>
|
||||
<option onclick="transpose(-5)">-5</option>
|
||||
<option onclick="transpose(-4)">-4</option>
|
||||
<option onclick="transpose(-3)">-3</option>
|
||||
<option onclick="transpose(-2)">-2</option>
|
||||
<option onclick="transpose(-1)">-1</option>
|
||||
<option onclick="transpose(0)" selected="selected">0</option>
|
||||
<option onclick="transpose(1)">1</option>
|
||||
<option onclick="transpose(2)">2</option>
|
||||
<option onclick="transpose(3)">3</option>
|
||||
<option onclick="transpose(4)">4</option>
|
||||
<option onclick="transpose(5)">5</option>
|
||||
<option onclick="transpose(6)">6</option>
|
||||
</select>
|
||||
<button class="small" onclick="transposeAdd(1)">+1</button>
|
||||
<button class="small" onclick="transposeAdd(2)">+2</button>
|
||||
<button onclick="transpose(0)">Reset</button>
|
||||
</div>
|
||||
{capo_settings}
|
||||
<h3>Canción</h3>
|
||||
<div id="wholeSongDiv">
|
||||
{song_html}
|
||||
</div>
|
||||
<div>
|
||||
{audios_header}
|
||||
{audios_html}
|
||||
</div>
|
||||
<a href="https://gitlab.com/parroquia-san-leandro/cancionero-25/blob/master/{latex_file}"><span>Ver archivo original (LaTeX)</span></a>
|
||||
<a href="../"><span>Atrás</span></a>
|
||||
</div>
|
|
@ -1,6 +0,0 @@
|
|||
<a href="{url}">
|
||||
<li {li_class}>
|
||||
<span class="number">{number}.</span>
|
||||
{name}{author}{origin}
|
||||
</li>
|
||||
</a>
|
|
@ -1,9 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0; url = {url}">
|
||||
</head>
|
||||
<body>
|
||||
<a href="{url}">Redirigiendo a la canción, haz click aquí si no sucede de forma automática.</a>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue