Commit d351bfc9 authored by ConstiDami's avatar ConstiDami
Browse files

fix

parent 8bb7ebdf
This diff is collapsed.
{% extends "layout.html" %}
{% block content %}
<h1>Langue : {{title}}</h1>
{% set page_title = sentence_case(title)%}
{% if langue.english != '' %}
{% set page_title = page_title + ' - ' + sentence_case(langue.english)|safe %}
{% endif %}
{% if langue.self != '' %}
{% set page_title = page_title + ' - ' + sentence_case(langue.self)%}
{% endif %}
<!-- Printing the name of the language with the first letter capitalized -->
<p>{{langue.english|capitalize|safe}}<br>
{{langue.self|capitalize}}</p>
<h2>{{page_title}}</h2>
<!-- If an image of the text is available, displays it -->
{% if langue.imgtext != '' %}
......@@ -17,10 +25,9 @@
<div class="column_langue">
<!-- If there is at least one recording in this language, displays the list of recordings -->
{% if sounds.first() is not none %}
<p><b>Liste des enregistrements</b></p>
{% for sound in sounds %}
<audio controls src="{{ url_for('static', filename='audio/') }}{{sound.filename}}">
Your browser does not support the <code>audio</code> element.</audio> {{sound.date}}<br>
<audio controls src="{{ url_for('static', filename='audio/') }}{{sound.filename}}" controlsList="nodownload">
Your browser does not support the <code>audio</code> element.</audio> <!--{{sound.date}}--><br>
{% endfor %}
<br>
{% endif %}
......
......@@ -40,6 +40,10 @@
</nav>
</header>
<main role="main" class="container">
{% macro sentence_case(text) %}
{{ text[0]|upper}}{{text[1:] }}
{% endmacro %}
{% block content %}{% endblock %}
</main>
<!-- Footer -->
......
{% extends "layout.html" %}
{% block content %}
<h1>Liste des langues</h1>
<!-- Sorting by alphabetical order in french -->
......@@ -23,19 +24,19 @@
<div class="col-sm-3 col1">
<!-- liste_lang[i] refers to the current language -->
<!-- Displays also the number of recordings for this current language -->
<a href="/projet_19-20/petit_prince/langue/{{liste_lang[i].french}}">{{liste_lang[i].french|capitalize}} ({{sounds|selectattr("language", "equalto", liste_lang[i].iso)|list|length}})</a>
<a href="/projet_19-20/petit_prince/langue/{{liste_lang[i].french}}">{{sentence_case(liste_lang[i].french)}} ({{sounds|selectattr("language", "equalto", liste_lang[i].iso)|list|length}})</a>
</div>
<div class="col-sm-3 col2">
<a href="/projet_19-20/petit_prince/langue/{{liste_lang[i+nb_par_col].french}}">{{liste_lang[i+nb_par_col].french|capitalize}} ({{sounds|selectattr("language", "equalto", liste_lang[i+nb_par_col].iso)|list|length}})</a>
<a href="/projet_19-20/petit_prince/langue/{{liste_lang[i+nb_par_col].french}}">{{sentence_case(liste_lang[i+nb_par_col].french)}} ({{sounds|selectattr("language", "equalto", liste_lang[i+nb_par_col].iso)|list|length}})</a>
</div>
<div class="col-sm-3 col3">
<a href="/projet_19-20/petit_prince/langue/{{liste_lang[i+2*nb_par_col].french}}">{{liste_lang[i+2*nb_par_col].french|capitalize}} ({{sounds|selectattr("language", "equalto", liste_lang[i+2*nb_par_col].iso)|list|length}})</a>
<a href="/projet_19-20/petit_prince/langue/{{liste_lang[i+2*nb_par_col].french}}">{{sentence_case(liste_lang[i+2*nb_par_col].french)}} ({{sounds|selectattr("language", "equalto", liste_lang[i+2*nb_par_col].iso)|list|length}})</a>
</div>
<!-- Makes sure that the index isn't out of range (deals with the last rows,
when there isn't a fourth column to display) -->
{% if i+3*nb_par_col < liste_lang|length %}
<div class="col-sm-3 col4">
<a href="/projet_19-20/petit_prince/langue/{{liste_lang[i+3*nb_par_col].french}}">{{liste_lang[i+3*nb_par_col].french|capitalize}} ({{sounds|selectattr("language", "equalto", liste_lang[i+3*nb_par_col].iso)|list|length}})</a>
<a href="/projet_19-20/petit_prince/langue/{{liste_lang[i+3*nb_par_col].french}}">{{sentence_case(liste_lang[i+3*nb_par_col].french)}} ({{sounds|selectattr("language", "equalto", liste_lang[i+3*nb_par_col].iso)|list|length}})</a>
</div>
{% endif %}
<!-- Closing the row and opening a new one -->
......@@ -51,7 +52,7 @@
{%for langue in liste_lang%}
<div class="col-sm phone_lang">
<!-- Displays also the number of recordings for this current language -->
<a href="/projet_19-20/petit_prince/langue/{{langue.french}}">{{langue.french|capitalize}} ({{sounds|selectattr("language", "equalto", langue.iso)|list|length}})</a>
<a href="/projet_19-20/petit_prince/langue/{{langue.french}}">{{sentence_case(langue.french)}} ({{sounds|selectattr("language", "equalto", langue.iso)|list|length}})</a>
</div>
{% endfor %}
<br>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment