Commit 7edbe4d1 authored by Pierre Arnaud's avatar Pierre Arnaud

Add dynamic pages title

parent 8b502bb8
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Passim 0.0\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-04-14 10:55+0200\n"
"POT-Creation-Date: 2015-04-15 10:57+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -29,8 +29,8 @@ msgstr ""
msgid "Administrator"
msgstr ""
#: passim/templates/about.mako:12 passim/templates/site.mako:82
#: passim/templates/site.mako:118
#: passim/templates/about.mako:12 passim/templates/site.mako:90
#: passim/templates/site.mako:126 passim/views/__init__.py:98
msgid "About"
msgstr ""
......@@ -67,7 +67,7 @@ msgid "Most recently updated Information Services"
msgstr ""
#: passim/templates/accueil.mako:33 passim/templates/map_dep.mako:25
#: passim/templates/organismes.mako:94 passim/templates/territoires.mako:44
#: passim/templates/organismes.mako:100 passim/templates/territoires.mako:44
#: passim/templates/territoires.mako:79 passim/templates/territoires.mako:116
#: passim/templates/territoires.mako:153 passim/templates/territoires.mako:190
msgid "Name"
......@@ -81,7 +81,8 @@ msgstr ""
msgid "Last modification time"
msgstr ""
#: passim/templates/contact.mako:19 passim/templates/site.mako:85
#: passim/templates/contact.mako:19 passim/templates/site.mako:93
#: passim/views/__init__.py:149
msgid "Contact"
msgstr ""
......@@ -127,8 +128,8 @@ msgstr ""
msgid "Contribute Form"
msgstr ""
#: passim/templates/contribute.mako:9 passim/templates/site.mako:88
#: passim/templates/site.mako:123
#: passim/templates/contribute.mako:9 passim/templates/site.mako:96
#: passim/templates/site.mako:131 passim/views/__init__.py:185
msgid "Contribute"
msgstr ""
......@@ -151,7 +152,8 @@ msgid ""
"management site.\n"
msgstr ""
#: passim/templates/data.mako:12 passim/templates/site.mako:91
#: passim/templates/data.mako:12 passim/templates/site.mako:99
#: passim/views/__init__.py:192
msgid "Reuse"
msgstr ""
......@@ -222,7 +224,8 @@ msgstr ""
msgid "Last update"
msgstr ""
#: passim/templates/help.mako:12 passim/templates/site.mako:94
#: passim/templates/help.mako:12 passim/templates/site.mako:102
#: passim/views/__init__.py:198
msgid "Help"
msgstr ""
......@@ -322,7 +325,7 @@ msgstr ""
msgid "number of Multimodal Information Systems"
msgstr ""
#: passim/templates/map_offers.mako:15
#: passim/templates/map_offers.mako:15 passim/views/__init__.py:243
msgid "A Map of transport services in France"
msgstr ""
......@@ -398,21 +401,21 @@ msgstr ""
msgid "None"
msgstr ""
#: passim/templates/organismes.mako:74
#: passim/templates/organismes.mako:76
msgid "Transport Offers : "
msgstr ""
#: passim/templates/organismes.mako:77
#: passim/templates/organismes.mako:81
msgid "List"
msgstr ""
#: passim/templates/organismes.mako:95 passim/templates/territoires.mako:45
#: passim/templates/organismes.mako:101 passim/templates/territoires.mako:45
#: passim/templates/territoires.mako:80 passim/templates/territoires.mako:117
#: passim/templates/territoires.mako:154 passim/templates/territoires.mako:191
msgid "Transport Type"
msgstr ""
#: passim/templates/organismes.mako:96
#: passim/templates/organismes.mako:102
msgid "Transport Mode"
msgstr ""
......@@ -436,31 +439,31 @@ msgstr ""
msgid "Type a French city/department/region name"
msgstr ""
#: passim/templates/site.mako:33
#: passim/templates/site.mako:37
msgid "Directory of Traveler Information Services in France"
msgstr ""
#: passim/templates/site.mako:98
#: passim/templates/site.mako:106
msgid "Maps"
msgstr ""
#: passim/templates/site.mako:101 passim/templates/territoires.mako:49
#: passim/templates/site.mako:109 passim/templates/territoires.mako:49
msgid "Multimodal Information Services"
msgstr ""
#: passim/templates/site.mako:102
#: passim/templates/site.mako:110
msgid "Indicators by Regions"
msgstr ""
#: passim/templates/site.mako:103
#: passim/templates/site.mako:111
msgid "Indicators by Departments"
msgstr ""
#: passim/templates/site.mako:105
#: passim/templates/site.mako:113
msgid "Transport Offers"
msgstr ""
#: passim/templates/site.mako:129
#: passim/templates/site.mako:137
msgid "Back-office access"
msgstr ""
......@@ -506,11 +509,19 @@ msgstr ""
msgid "404 Error Page"
msgstr ""
#: passim/views/__init__.py:140
#: passim/views/__init__.py:104
msgid "CSV data"
msgstr ""
#: passim/views/__init__.py:127
msgid "Home"
msgstr ""
#: passim/views/__init__.py:143
msgid "Contact PASSIM: [your message subject]"
msgstr ""
#: passim/views/__init__.py:141
#: passim/views/__init__.py:144
msgid ""
"I am [an end-user, a company...]\n"
"\n"
......@@ -519,13 +530,13 @@ msgid ""
"My message: ..."
msgstr ""
#: passim/views/__init__.py:161
#: passim/views/__init__.py:165
msgid ""
"Contribution to PASSIM : [new Info Service, correction to an existing Info "
"Service...]"
msgstr ""
#: passim/views/__init__.py:162
#: passim/views/__init__.py:166
msgid ""
"Proposed contribution : [new Info Service, correction to an existing Info "
"Service...]\n"
......@@ -551,11 +562,23 @@ msgid ""
"real time info...):"
msgstr ""
#: passim/views/__init__.py:311
#: passim/views/__init__.py:237
msgid "Indicators by département"
msgstr ""
#: passim/views/__init__.py:249
msgid "Indicators by region"
msgstr ""
#: passim/views/__init__.py:255
msgid "a map of multimodale info systems (MIS) in France"
msgstr ""
#: passim/views/__init__.py:322
msgid "Contribution to PASSIM : [{0}]"
msgstr ""
#: passim/views/__init__.py:312
#: passim/views/__init__.py:323
msgid ""
"Your are [an end-user, a company...]\n"
"\n"
......@@ -579,19 +602,19 @@ msgid ""
"Thank you advance for any remarks, questions or suggestions about PASSIM !\n"
msgstr ""
#: passim/views/__init__.py:365
#: passim/views/__init__.py:377
msgid "Not found"
msgstr ""
#: passim/views/__init__.py:413
#: passim/views/__init__.py:425
msgid "Error : "
msgstr ""
#: passim/views/__init__.py:416
#: passim/views/__init__.py:428
msgid "API error"
msgstr ""
#: passim/views/__init__.py:542
#: passim/views/__init__.py:555
msgid "Your email has been sent."
msgstr ""
......@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Passim 0.0\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2015-04-14 10:55+0200\n"
"PO-Revision-Date: 2015-04-14 10:56+0100\n"
"POT-Creation-Date: 2015-04-15 10:57+0200\n"
"PO-Revision-Date: 2015-04-15 10:58+0100\n"
"Last-Translator: Pierre ARNAUD <parnaud@easter-eggs.com>\n"
"Language-Team: fr <LL@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
......@@ -31,8 +31,8 @@ msgstr "Utilisateur"
msgid "Administrator"
msgstr "Administrateur"
#: passim/templates/about.mako:12 passim/templates/site.mako:82
#: passim/templates/site.mako:118
#: passim/templates/about.mako:12 passim/templates/site.mako:90
#: passim/templates/site.mako:126 passim/views/__init__.py:98
msgid "About"
msgstr "À propos"
......@@ -78,7 +78,7 @@ msgid "Most recently updated Information Services"
msgstr "Les dernières mises à jour"
#: passim/templates/accueil.mako:33 passim/templates/map_dep.mako:25
#: passim/templates/organismes.mako:94 passim/templates/territoires.mako:44
#: passim/templates/organismes.mako:100 passim/templates/territoires.mako:44
#: passim/templates/territoires.mako:79 passim/templates/territoires.mako:116
#: passim/templates/territoires.mako:153 passim/templates/territoires.mako:190
msgid "Name"
......@@ -92,7 +92,8 @@ msgstr "Territoire"
msgid "Last modification time"
msgstr "Date de dernière modification"
#: passim/templates/contact.mako:19 passim/templates/site.mako:85
#: passim/templates/contact.mako:19 passim/templates/site.mako:93
#: passim/views/__init__.py:149
msgid "Contact"
msgstr "Contact"
......@@ -140,8 +141,8 @@ msgstr "Envoyer"
msgid "Contribute Form"
msgstr "Formulaire de contribution"
#: passim/templates/contribute.mako:9 passim/templates/site.mako:88
#: passim/templates/site.mako:123
#: passim/templates/contribute.mako:9 passim/templates/site.mako:96
#: passim/templates/site.mako:131 passim/views/__init__.py:185
msgid "Contribute"
msgstr "Contribuer"
......@@ -173,7 +174,8 @@ msgstr ""
"Nous vous en remercions d'avance !<br>\n"
"Enfin, vous êtes les bienvenus si vous souhaitez contribuer de manière plus pérenne: il sera possible de vous ouvrir un compte pour participer directement à la mise à jour du contenu de l'annuaire.\n"
#: passim/templates/data.mako:12 passim/templates/site.mako:91
#: passim/templates/data.mako:12 passim/templates/site.mako:99
#: passim/views/__init__.py:192
msgid "Reuse"
msgstr "Réutilisation"
......@@ -239,7 +241,8 @@ msgstr "Nous n'avons pas trouvé la page demandée. Souhaitez-vous <a href=\"{}\
msgid "Last update"
msgstr "Dernière mises à jour"
#: passim/templates/help.mako:12 passim/templates/site.mako:94
#: passim/templates/help.mako:12 passim/templates/site.mako:102
#: passim/views/__init__.py:198
msgid "Help"
msgstr "Aide"
......@@ -338,7 +341,7 @@ msgstr "nombre de sites Open Data"
msgid "number of Multimodal Information Systems"
msgstr "nombre de Systèmes d'Information Multimodale"
#: passim/templates/map_offers.mako:15
#: passim/templates/map_offers.mako:15 passim/views/__init__.py:243
msgid "A Map of transport services in France"
msgstr "Carte des offres de transport en France métropolitaine"
......@@ -407,21 +410,21 @@ msgstr "Territoire couvert"
msgid "None"
msgstr "Aucun"
#: passim/templates/organismes.mako:74
#: passim/templates/organismes.mako:76
msgid "Transport Offers : "
msgstr "Offre de transport :"
#: passim/templates/organismes.mako:77
#: passim/templates/organismes.mako:81
msgid "List"
msgstr "Liste"
#: passim/templates/organismes.mako:95 passim/templates/territoires.mako:45
#: passim/templates/organismes.mako:101 passim/templates/territoires.mako:45
#: passim/templates/territoires.mako:80 passim/templates/territoires.mako:117
#: passim/templates/territoires.mako:154 passim/templates/territoires.mako:191
msgid "Transport Type"
msgstr "Type de transport"
#: passim/templates/organismes.mako:96
#: passim/templates/organismes.mako:102
msgid "Transport Mode"
msgstr "Mode de transport"
......@@ -445,31 +448,31 @@ msgstr "Trouvez les services d'info transport sur votre territoire:"
msgid "Type a French city/department/region name"
msgstr "Entrez le nom d'une commune, d'un département ou d'une région"
#: passim/templates/site.mako:33
#: passim/templates/site.mako:37
msgid "Directory of Traveler Information Services in France"
msgstr "Annuaire de services d'information transport en France"
#: passim/templates/site.mako:98
#: passim/templates/site.mako:106
msgid "Maps"
msgstr "Cartes"
#: passim/templates/site.mako:101 passim/templates/territoires.mako:49
#: passim/templates/site.mako:109 passim/templates/territoires.mako:49
msgid "Multimodal Information Services"
msgstr "Services d'information multimodale"
#: passim/templates/site.mako:102
#: passim/templates/site.mako:110
msgid "Indicators by Regions"
msgstr "Indicateurs par régions"
#: passim/templates/site.mako:103
#: passim/templates/site.mako:111
msgid "Indicators by Departments"
msgstr "Indicateurs par départements"
#: passim/templates/site.mako:105
#: passim/templates/site.mako:113
msgid "Transport Offers"
msgstr "Offres de transport"
#: passim/templates/site.mako:129
#: passim/templates/site.mako:137
msgid "Back-office access"
msgstr "Accès back-office"
......@@ -515,11 +518,19 @@ msgstr "Page non trouvée"
msgid "404 Error Page"
msgstr "404 Page d'erreur"
#: passim/views/__init__.py:140
#: passim/views/__init__.py:104
msgid "CSV data"
msgstr "Données"
#: passim/views/__init__.py:127
msgid "Home"
msgstr "Accueil"
#: passim/views/__init__.py:143
msgid "Contact PASSIM: [your message subject]"
msgstr "Contact PASSIM: [Le sujet de votre message]"
#: passim/views/__init__.py:141
#: passim/views/__init__.py:144
msgid ""
"I am [an end-user, a company...]\n"
"\n"
......@@ -533,11 +544,11 @@ msgstr ""
"\n"
"Mon message: ..."
#: passim/views/__init__.py:161
#: passim/views/__init__.py:165
msgid "Contribution to PASSIM : [new Info Service, correction to an existing Info Service...]"
msgstr "Contribution à PASSIM : [Nouveau service d'information, correction d'un service existant ...]"
#: passim/views/__init__.py:162
#: passim/views/__init__.py:166
msgid ""
"Proposed contribution : [new Info Service, correction to an existing Info Service...]\n"
"\n"
......@@ -577,11 +588,23 @@ msgstr ""
"\n"
"Merci d'avance de toutes vos remarques, propositions ou demandes d'informations sur le fonctionnement de l'annuaire PASSIM !"
#: passim/views/__init__.py:311
#: passim/views/__init__.py:237
msgid "Indicators by département"
msgstr "Indicateurs par départements"
#: passim/views/__init__.py:249
msgid "Indicators by region"
msgstr "Indicateurs par régions"
#: passim/views/__init__.py:255
msgid "a map of multimodale info systems (MIS) in France"
msgstr "Carte des services d'info multimodale (SIM) en France métropolitaine"
#: passim/views/__init__.py:322
msgid "Contribution to PASSIM : [{0}]"
msgstr "Contribuer à PASSIM: [{0}]"
#: passim/views/__init__.py:312
#: passim/views/__init__.py:323
msgid ""
"Your are [an end-user, a company...]\n"
"\n"
......@@ -625,19 +648,19 @@ msgstr ""
"Merci d'avance de toutes vos remarques, propositions ou demandes d'informations sur le fonctionnement de l'annuaire PASSIM !\n"
"\n"
#: passim/views/__init__.py:365
#: passim/views/__init__.py:377
msgid "Not found"
msgstr "Page non trouvée"
#: passim/views/__init__.py:413
#: passim/views/__init__.py:425
msgid "Error : "
msgstr "Erreur"
#: passim/views/__init__.py:416
#: passim/views/__init__.py:428
msgid "API error"
msgstr "Erreur de l'API"
#: passim/views/__init__.py:542
#: passim/views/__init__.py:555
msgid "Your email has been sent."
msgstr "Votre message a été envoyé."
......
......@@ -26,6 +26,10 @@ from passim.resources import UsersResource
<div>
</%def>\
\
<%def name="page_title(titre)">
<title>${titre} - Passim </title>
</%def>\
\
<%def name="page_header()">
<div class="page-header" id="about-header">
<img src="${request.static_path('passim:static/img/logo-ministere.png')}" class="pull-left">
......@@ -38,7 +42,11 @@ from passim.resources import UsersResource
<!DOCTYPE html>
<html>
<head>
<title>Passim</title>
%if title:
${page_title(title)}
%else:
${page_title("Accueil")}
%endif
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
......
......@@ -94,12 +94,14 @@ def error_404(request):
@view_config(route_name='about', renderer='/about.mako')
def about(request):
return dict()
_ = request.translate
return dict(title=_("About"))
@view_config(route_name='acces_donnees', renderer='/iframe.mako')
def acces_donnees(request):
return dict()
_ = request.translate
return dict(title=_("CSV data"))
@view_config(route_name='accueil', renderer='/accueil.mako')
......@@ -121,7 +123,8 @@ def accueil(request):
)
).json()["data"]
return dict(
result=parse_last_update(last_updates, request)
result=parse_last_update(last_updates, request),
title=_("Home")
)
......@@ -143,6 +146,7 @@ def contact(request):
My e-mail address: [xxx@yyy.org]
My message: ...'''),
title=_("Contact")
)
......@@ -178,17 +182,20 @@ Information Service
- Name, Territory (city, department, region), Transport type (public transport...):
- Comments or remarks (such as information about web services, open data, real time info...):'''),
title=_("Contribute")
)
@view_config(route_name='data', renderer='/data.mako')
def data(request):
return dict()
_ = request.translate
return dict(title=_("Reuse"))
@view_config(route_name='help', renderer='/help.mako')
def help(request):
return dict()
_ = request.translate
return dict(title=_("Help"))
@view_config(route_name='contact-email', renderer='json')
......@@ -208,7 +215,7 @@ def feed(request):
url = '{}/poi/last'.format(petitpois_api)
last_updates = requests.get(url, params=dict(k="service-d-information", limit=30)).json()["data"]
return dict(
result=parse_last_update(last_updates, request)
result=parse_last_update(last_updates, request),
)
......@@ -308,6 +315,7 @@ Information Service {1}
Thank you advance for any remarks, questions or suggestions about PASSIM !
''').format(parse_result["name"], request.url),
title=parse_result["name"],
)
......@@ -465,6 +473,7 @@ def territoires(request):
or departement_fullname in territories \
or region_fullname in territories \
or name == 'france' or name == 'france-metropolitaine':
if el.get("multimodal") == 1:
parse_result["multimodal"].append(el)
elif el.get("niveau") == "National":
......@@ -485,7 +494,8 @@ def territoires(request):
departement=departement_name,
full_name=full_name,
type_name=type_name,
error=None
error=None,
title=full_name
)
......
Markdown is supported
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