Skip to content
Snippets Groups Projects
Commit 6dc6ab1a authored by Deleted User's avatar Deleted User
Browse files

Add templates labels_title & result_title:

Depuis le fichier labelsTower.py il est maintenant possible de changer des variables du template browse.html comme le titre des labels et des résultats en fonction des langues. Le tableau associaif des noms s'appele text_component.
parent 8b0c6f3e
No related branches found
No related tags found
1 merge request!50[1] Site générique
......@@ -18,6 +18,11 @@ class CustomFlask(Flask):
app = CustomFlask(__name__)
app.config['DEBUG'] = True
text_component = {"labels_title_fr": "Étiquettes",
"labels_title_ang": "Labels",
"result_title_fr": "Tutoriels",
"result_title_ang": "Tutorials"}
@app.route('/')
def home():
return search_tuto()
......@@ -89,7 +94,7 @@ def manage_labels():
@app.route('/browse')
def search_tuto():
return render_template('browse.html')
return render_template('browse.html', txt=text_component)
@app.route('/add_new_tuto', methods=['GET', 'POST'])
def add_new_tuto():
......
......@@ -27,8 +27,8 @@
<div id='hierarchy' class="panel panel-primary" v-cloak>
<div class="panel-heading title">
<span v-if="this.labels_language == 'US'" style="margin-left: 9%; margin-right: 4%"><span class="glyphicon glyphicon-tags"></span>Labels</span>
<span v-else style="margin-left: -6%; margin-right: 4%;"><span class="glyphicon glyphicon-tags"></span>Étiquettes</span>
<span v-if="this.labels_language == 'US'" style="margin-left: 9%; margin-right: 4%"><span class="glyphicon glyphicon-tags"></span>[[ txt['labels_title_ang'] ]]</span>
<span v-else style="margin-left: -6%; margin-right: 4%;"><span class="glyphicon glyphicon-tags"></span>[[ txt['labels_title_fr'] ]]</span>
<span style="margin-right: -10%;">
<span v-if='this.labels_language == "FR"'>
<img style="height:25px; width:25px; margin-right: 3%;" src="static/boue_france.png">
......@@ -82,8 +82,8 @@
<div class="panel-heading title">
<span style="margin-left: 9%; margin-right: 3%;">
<span class="glyphicon glyphicon-book"></span>
<span v-if="this.labels_language == 'FR'">Tutoriels</span>
<span v-else="this.labels_language == 'US'">Tutorials</span>
<span v-if="this.labels_language == 'FR'">[[ txt['result_title_fr'] ]]</span>
<span v-else="this.labels_language == 'US'">[[ txt['result_title_ang'] ]]</span>
</span>
<span style="margin-left: 0%">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment