Commit a8344941 authored by Pierre Arnaud's avatar Pierre Arnaud
Browse files

Improve error messages

parent ae13572f
......@@ -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-30 17:45+0200\n"
"POT-Creation-Date: 2015-04-30 18:43+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"
......@@ -30,7 +30,7 @@ msgid "Administrator"
msgstr ""
#: passim/templates/about.mako:12 passim/templates/site.mako:95
#: passim/templates/site.mako:139 passim/views/__init__.py:100
#: passim/templates/site.mako:139 passim/views/__init__.py:99
msgid "About"
msgstr ""
......@@ -66,10 +66,10 @@ msgstr ""
msgid "{0} most recently updated Information Services"
msgstr ""
#: passim/templates/accueil.mako:33 passim/templates/organisms.mako:100
#: passim/templates/territories.mako:45 passim/templates/territories.mako:80
#: passim/templates/territories.mako:117 passim/templates/territories.mako:154
#: passim/templates/territories.mako:193 passim/templates/maps/dep.mako:20
#: passim/templates/accueil.mako:33 passim/templates/organisms.mako:102
#: passim/templates/territories.mako:45 passim/templates/territories.mako:82
#: passim/templates/territories.mako:121 passim/templates/territories.mako:160
#: passim/templates/territories.mako:201 passim/templates/maps/dep.mako:20
msgid "Name"
msgstr ""
......@@ -82,7 +82,7 @@ msgid "Last modification time"
msgstr ""
#: passim/templates/contact.mako:19 passim/templates/site.mako:98
#: passim/views/__init__.py:144
#: passim/views/__init__.py:143
msgid "Contact"
msgstr ""
......@@ -129,7 +129,7 @@ msgid "Contribute Form"
msgstr ""
#: passim/templates/contribute.mako:9 passim/templates/site.mako:101
#: passim/views/__init__.py:180
#: passim/views/__init__.py:179
msgid "Contribute"
msgstr ""
......@@ -172,12 +172,12 @@ msgid ""
"href=\"{}\">return to Home</a>"
msgstr ""
#: passim/templates/feed.mako:5 passim/templates/organisms.mako:24
#: passim/templates/feed.mako:5 passim/templates/organisms.mako:26
msgid "Last update"
msgstr ""
#: passim/templates/help.mako:12 passim/templates/site.mako:107
#: passim/views/__init__.py:214
#: passim/views/__init__.py:213
msgid "Help"
msgstr ""
......@@ -236,51 +236,54 @@ msgid ""
"Thank you for using PASSIM and thanks in advance for your comments!\n"
msgstr ""
#: passim/templates/organisms.mako:15
#: passim/templates/organisms.mako:17
msgid "Information Service"
msgstr ""
#: passim/templates/organisms.mako:34
#: passim/templates/organisms.mako:36
msgid "Website"
msgstr ""
#: passim/templates/organisms.mako:37
#: passim/templates/organisms.mako:39
msgid "Transport offer website."
msgstr ""
#: passim/templates/organisms.mako:45 passim/templates/organisms.mako:49
#: passim/templates/organisms.mako:52 passim/templates/organisms.mako:55
#: passim/templates/organisms.mako:47 passim/templates/organisms.mako:51
#: passim/templates/organisms.mako:54 passim/templates/organisms.mako:57
msgid "Mobile applications"
msgstr ""
#: passim/templates/organisms.mako:63
#: passim/templates/organisms.mako:65
msgid "Covered Territory"
msgstr ""
#: passim/templates/organisms.mako:68
#: passim/templates/organisms.mako:70 passim/templates/organisms.mako:123
#: passim/templates/territories.mako:60 passim/templates/territories.mako:98
#: passim/templates/territories.mako:137 passim/templates/territories.mako:176
#: passim/templates/territories.mako:218 passim/views/__init__.py:486
msgid "None"
msgstr ""
#: passim/templates/organisms.mako:76
#: passim/templates/organisms.mako:78
msgid "Transport Offers : "
msgstr ""
#: passim/templates/organisms.mako:81
#: passim/templates/organisms.mako:83
msgid "List"
msgstr ""
#: passim/templates/organisms.mako:101 passim/templates/territories.mako:46
#: passim/templates/territories.mako:81 passim/templates/territories.mako:118
#: passim/templates/territories.mako:155 passim/templates/territories.mako:194
#: passim/templates/organisms.mako:103 passim/templates/territories.mako:46
#: passim/templates/territories.mako:83 passim/templates/territories.mako:122
#: passim/templates/territories.mako:161 passim/templates/territories.mako:202
msgid "Transport Type"
msgstr ""
#: passim/templates/organisms.mako:102
#: passim/templates/organisms.mako:104
msgid "Transport Mode"
msgstr ""
#: passim/templates/reuse.mako:12 passim/templates/site.mako:104
#: passim/views/__init__.py:187
#: passim/views/__init__.py:186
msgid "Reuse"
msgstr ""
......@@ -384,26 +387,26 @@ msgid "Traveler Info Services List For"
msgstr ""
#: passim/templates/territories.mako:44 passim/templates/territories.mako:53
#: passim/templates/territories.mako:79 passim/templates/territories.mako:89
#: passim/templates/territories.mako:116 passim/templates/territories.mako:126
#: passim/templates/territories.mako:153 passim/templates/territories.mako:163
#: passim/templates/territories.mako:192 passim/templates/territories.mako:203
#: passim/templates/territories.mako:81 passim/templates/territories.mako:91
#: passim/templates/territories.mako:120 passim/templates/territories.mako:130
#: passim/templates/territories.mako:159 passim/templates/territories.mako:169
#: passim/templates/territories.mako:200 passim/templates/territories.mako:211
msgid "Web Site"
msgstr ""
#: passim/templates/territories.mako:70
#: passim/templates/territories.mako:72
msgid "Local Interest Traveler Info Services"
msgstr ""
#: passim/templates/territories.mako:107
#: passim/templates/territories.mako:111
msgid "Departmental Interest Traveler Info Services"
msgstr ""
#: passim/templates/territories.mako:144
#: passim/templates/territories.mako:150
msgid "Regional Interest Traveler Info Services"
msgstr ""
#: passim/templates/territories.mako:182
#: passim/templates/territories.mako:190
msgid "National Information"
msgstr ""
......@@ -499,36 +502,36 @@ msgid ""
"agency) public transport offer over a territory and a route planner."
msgstr ""
#: passim/views/__init__.py:83
#: passim/views/__init__.py:82
msgid "Access denied"
msgstr ""
#: passim/views/__init__.py:93
#: passim/views/__init__.py:92
msgid "Page not found"
msgstr ""
#: passim/views/__init__.py:124
#: passim/views/__init__.py:123
msgid "Home"
msgstr ""
#: passim/views/__init__.py:140
#: passim/views/__init__.py:139
msgid "Contact PASSIM: [your message subject]"
msgstr ""
#: passim/views/__init__.py:141
#: passim/views/__init__.py:140
msgid ""
"I am [an end-user, a company...]\n"
"\n"
"My message: ..."
msgstr ""
#: passim/views/__init__.py:160
#: passim/views/__init__.py:159
msgid ""
"Contribution to PASSIM : [new Info Service, correction to an existing Info "
"Service...]"
msgstr ""
#: passim/views/__init__.py:161
#: passim/views/__init__.py:160
msgid ""
"Proposed contribution : [new Info Service, correction to an existing Info "
"Service...]\n"
......@@ -554,15 +557,11 @@ msgid ""
"real time info...):"
msgstr ""
#: passim/views/__init__.py:232
#: passim/views/__init__.py:231
msgid "CSV data"
msgstr ""
#: passim/views/__init__.py:306
msgid "Contribution to PASSIM : [{0}]"
msgstr ""
#: passim/views/__init__.py:307
#: passim/views/__init__.py:238
msgid ""
"Your are [an end-user, a company...]\n"
"\n"
......@@ -578,7 +577,7 @@ msgid ""
"- Web site address :\n"
"- Mobile site or application :\n"
"- Transport services covered:\n"
" - Name, Territory (city, department, region), Transport type (public "
"- Name, Territory (city, department, region), Transport type (public "
"transport...):\n"
"- Your remarks (or information about web services, open data, real time "
"info...):\n"
......@@ -586,19 +585,23 @@ msgid ""
"Thank you advance for any remarks, questions or suggestions about PASSIM !\n"
msgstr ""
#: passim/views/__init__.py:361
#: passim/views/__init__.py:257
msgid "Contribution to PASSIM : [{0}]"
msgstr ""
#: passim/views/__init__.py:270 passim/views/__init__.py:371
msgid "Not found"
msgstr ""
#: passim/views/__init__.py:413
#: passim/views/__init__.py:423
msgid "API error"
msgstr ""
#: passim/views/__init__.py:416
#: passim/views/__init__.py:426
msgid "Error: "
msgstr ""
#: passim/views/__init__.py:556
#: passim/views/__init__.py:566
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-30 17:45+0200\n"
"PO-Revision-Date: 2015-04-30 17:46+0100\n"
"POT-Creation-Date: 2015-04-30 18:43+0200\n"
"PO-Revision-Date: 2015-04-30 18:43+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"
......@@ -32,7 +32,7 @@ msgid "Administrator"
msgstr "Administrateur"
#: passim/templates/about.mako:12 passim/templates/site.mako:95
#: passim/templates/site.mako:139 passim/views/__init__.py:100
#: passim/templates/site.mako:139 passim/views/__init__.py:99
msgid "About"
msgstr "À propos"
......@@ -77,10 +77,10 @@ msgstr ""
msgid "{0} most recently updated Information Services"
msgstr "Les {0} dernières mises à jour"
#: passim/templates/accueil.mako:33 passim/templates/organisms.mako:100
#: passim/templates/territories.mako:45 passim/templates/territories.mako:80
#: passim/templates/territories.mako:117 passim/templates/territories.mako:154
#: passim/templates/territories.mako:193 passim/templates/maps/dep.mako:20
#: passim/templates/accueil.mako:33 passim/templates/organisms.mako:102
#: passim/templates/territories.mako:45 passim/templates/territories.mako:82
#: passim/templates/territories.mako:121 passim/templates/territories.mako:160
#: passim/templates/territories.mako:201 passim/templates/maps/dep.mako:20
msgid "Name"
msgstr "Nom"
......@@ -93,7 +93,7 @@ msgid "Last modification time"
msgstr "Date de dernière modification"
#: passim/templates/contact.mako:19 passim/templates/site.mako:98
#: passim/views/__init__.py:144
#: passim/views/__init__.py:143
msgid "Contact"
msgstr "Contact"
......@@ -142,7 +142,7 @@ msgid "Contribute Form"
msgstr "Formulaire de contribution"
#: passim/templates/contribute.mako:9 passim/templates/site.mako:101
#: passim/views/__init__.py:180
#: passim/views/__init__.py:179
msgid "Contribute"
msgstr "Contribuer"
......@@ -190,12 +190,12 @@ msgstr "Oups! Page non trouvée"
msgid "We could not find the page you were looking for. Meanwhile, you may <a href=\"{}\">return to Home</a>"
msgstr "Nous n'avons pas trouvé la page demandée. Souhaitez-vous <a href=\"{}\">Retourner à l'accueil</a>"
#: passim/templates/feed.mako:5 passim/templates/organisms.mako:24
#: passim/templates/feed.mako:5 passim/templates/organisms.mako:26
msgid "Last update"
msgstr "Dernière mises à jour"
#: passim/templates/help.mako:12 passim/templates/site.mako:107
#: passim/views/__init__.py:214
#: passim/views/__init__.py:213
msgid "Help"
msgstr "Aide"
......@@ -253,51 +253,54 @@ msgstr ""
"\n"
"Merci d'avance d'utiliser PASSIM et de vos retours\n"
#: passim/templates/organisms.mako:15
#: passim/templates/organisms.mako:17
msgid "Information Service"
msgstr "Service d'information"
#: passim/templates/organisms.mako:34
#: passim/templates/organisms.mako:36
msgid "Website"
msgstr "Site web"
#: passim/templates/organisms.mako:37
#: passim/templates/organisms.mako:39
msgid "Transport offer website."
msgstr "Site web de l'offre de transport"
#: passim/templates/organisms.mako:45 passim/templates/organisms.mako:49
#: passim/templates/organisms.mako:52 passim/templates/organisms.mako:55
#: passim/templates/organisms.mako:47 passim/templates/organisms.mako:51
#: passim/templates/organisms.mako:54 passim/templates/organisms.mako:57
msgid "Mobile applications"
msgstr "Applications mobiles"
#: passim/templates/organisms.mako:63
#: passim/templates/organisms.mako:65
msgid "Covered Territory"
msgstr "Territoire couvert"
#: passim/templates/organisms.mako:68
#: passim/templates/organisms.mako:70 passim/templates/organisms.mako:123
#: passim/templates/territories.mako:60 passim/templates/territories.mako:98
#: passim/templates/territories.mako:137 passim/templates/territories.mako:176
#: passim/templates/territories.mako:218 passim/views/__init__.py:486
msgid "None"
msgstr "Aucun"
#: passim/templates/organisms.mako:76
#: passim/templates/organisms.mako:78
msgid "Transport Offers : "
msgstr "Offre de transport :"
#: passim/templates/organisms.mako:81
#: passim/templates/organisms.mako:83
msgid "List"
msgstr "Liste"
#: passim/templates/organisms.mako:101 passim/templates/territories.mako:46
#: passim/templates/territories.mako:81 passim/templates/territories.mako:118
#: passim/templates/territories.mako:155 passim/templates/territories.mako:194
#: passim/templates/organisms.mako:103 passim/templates/territories.mako:46
#: passim/templates/territories.mako:83 passim/templates/territories.mako:122
#: passim/templates/territories.mako:161 passim/templates/territories.mako:202
msgid "Transport Type"
msgstr "Type de transport"
#: passim/templates/organisms.mako:102
#: passim/templates/organisms.mako:104
msgid "Transport Mode"
msgstr "Mode de transport"
#: passim/templates/reuse.mako:12 passim/templates/site.mako:104
#: passim/views/__init__.py:187
#: passim/views/__init__.py:186
msgid "Reuse"
msgstr "Réutilisation"
......@@ -404,26 +407,26 @@ msgid "Traveler Info Services List For"
msgstr "Services d'info transport pour"
#: passim/templates/territories.mako:44 passim/templates/territories.mako:53
#: passim/templates/territories.mako:79 passim/templates/territories.mako:89
#: passim/templates/territories.mako:116 passim/templates/territories.mako:126
#: passim/templates/territories.mako:153 passim/templates/territories.mako:163
#: passim/templates/territories.mako:192 passim/templates/territories.mako:203
#: passim/templates/territories.mako:81 passim/templates/territories.mako:91
#: passim/templates/territories.mako:120 passim/templates/territories.mako:130
#: passim/templates/territories.mako:159 passim/templates/territories.mako:169
#: passim/templates/territories.mako:200 passim/templates/territories.mako:211
msgid "Web Site"
msgstr "Web Site"
#: passim/templates/territories.mako:70
#: passim/templates/territories.mako:72
msgid "Local Interest Traveler Info Services"
msgstr "Information d'intérêt local"
#: passim/templates/territories.mako:107
#: passim/templates/territories.mako:111
msgid "Departmental Interest Traveler Info Services"
msgstr "Information d'intérêt départemental"
#: passim/templates/territories.mako:144
#: passim/templates/territories.mako:150
msgid "Regional Interest Traveler Info Services"
msgstr "Information d'intérêt régional"
#: passim/templates/territories.mako:182
#: passim/templates/territories.mako:190
msgid "National Information"
msgstr "Information d'intérêt national"
......@@ -512,23 +515,23 @@ msgstr "Annuaire PASSIM : carte des services d'info multimodale (SIM) en France
msgid "A MIS is an information service which includes at least the complete (multi-agency) public transport offer over a territory and a route planner."
msgstr "Un SIM est défini en principe comme un service regroupant au moins l'information sur l'ensemble de l'offre de transport public pour un territoire et proposant une recherche d'itinéraires."
#: passim/views/__init__.py:83
#: passim/views/__init__.py:82
msgid "Access denied"
msgstr "Accès refusé"
#: passim/views/__init__.py:93
#: passim/views/__init__.py:92
msgid "Page not found"
msgstr "Page non trouvée"
#: passim/views/__init__.py:124
#: passim/views/__init__.py:123
msgid "Home"
msgstr "Accueil"
#: passim/views/__init__.py:140
#: passim/views/__init__.py:139
msgid "Contact PASSIM: [your message subject]"
msgstr "Contact PASSIM: [Le sujet de votre message]"
#: passim/views/__init__.py:141
#: passim/views/__init__.py:140
msgid ""
"I am [an end-user, a company...]\n"
"\n"
......@@ -538,11 +541,11 @@ msgstr ""
"\n"
"Mon message: ..."
#: passim/views/__init__.py:160
#: passim/views/__init__.py:159
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:161
#: passim/views/__init__.py:160
msgid ""
"Proposed contribution : [new Info Service, correction to an existing Info Service...]\n"
"\n"
......@@ -582,15 +585,11 @@ 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:232
#: passim/views/__init__.py:231
msgid "CSV data"
msgstr "Données"
#: passim/views/__init__.py:306
msgid "Contribution to PASSIM : [{0}]"
msgstr "Contribuer à PASSIM: [{0}]"
#: passim/views/__init__.py:307
#: passim/views/__init__.py:238
msgid ""
"Your are [an end-user, a company...]\n"
"\n"
......@@ -606,7 +605,7 @@ msgid ""
"- Web site address :\n"
"- Mobile site or application :\n"
"- Transport services covered:\n"
" - Name, Territory (city, department, region), Transport type (public transport...):\n"
"- Name, Territory (city, department, region), Transport type (public transport...):\n"
"- Your remarks (or information about web services, open data, real time info...):\n"
"\n"
"Thank you advance for any remarks, questions or suggestions about PASSIM !\n"
......@@ -622,7 +621,7 @@ msgstr ""
"- Nom du service d'information: (champ obligatoire):\n"
"- Guichet d'information /adresse/code postal/téléphone :\n"
"- Centre d'appel / téléphone: \n"
"- Adresse site web / url : \n"
" - Adresse site web / url : \n"
"- Application mobile (nom, site mobile ou App pour iPhone, Android, Windows, etc.):\n"
"\n"
"- Offre(s) de transport rattachée au service d'information.\n"
......@@ -634,19 +633,23 @@ 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:361
#: passim/views/__init__.py:257
msgid "Contribution to PASSIM : [{0}]"
msgstr "Contribuer à PASSIM: [{0}]"
#: passim/views/__init__.py:270 passim/views/__init__.py:371
msgid "Not found"
msgstr "Page non trouvée"
#: passim/views/__init__.py:413
#: passim/views/__init__.py:423
msgid "API error"
msgstr "Erreur d'API"
#: passim/views/__init__.py:416
#: passim/views/__init__.py:426
msgid "Error: "
msgstr "Erreur : "
#: passim/views/__init__.py:556
#: passim/views/__init__.py:566
msgid "Your email has been sent."
msgstr "Votre message a été envoyé."
......
......@@ -8,7 +8,20 @@ ${parent.head()}
</%def>
${parent.page_header()}
% if error:
<div class="error-page">
<h3 class="headline text-info">404</h3>
<div class="error-page-content">
<h4><i class="fa fa-warning text-yellow"></i> ${_(u'Oops! Page not found.')}</h4>
<p>
${error}
</p>
<p>
${_(u'We could not find the page you were looking for. Meanwhile, you may <a href="{}">return to Home</a>').format(request.route_path('accueil')) | n}.
</p>
</div><!-- /.error-content -->
</div><!-- /.error-page -->
%else:
<div class="container"><div class="row">
<div class="page-header">
<h4>
......@@ -120,3 +133,4 @@ ${parent.page_header()}
% else:
${_("None")}
% endif
% endif
......@@ -12,6 +12,18 @@ ${parent.head()}
${parent.page_header()}
${parent.search_bar()}
% if error:
<div class="error-page">
<h3 class="headline text-info">404</h3>
<div class="error-page-content">
<h4><i class="fa fa-warning text-yellow"></i> ${_(u'Oops! Page not found.')}</h4>
<p>
${_(u'We could not find the page you were looking for. Meanwhile, you may <a href="{}">return to Home</a>').format(request.route_path('accueil')) | n}.
</p>
</div><!-- /.error-content -->
</div><!-- /.error-page -->
% endif
<div class="search-navbar">
<h3>
% if error:
......
......@@ -234,15 +234,47 @@ def open_data(request):
@view_config(route_name='organisms', renderer='/organisms.mako')
def organisms(request):
_ = request.translate
name = request.matchdict.get('name')
body = _(u'''Your are [an end-user, a company...]
Your e-mail address: [xxx@yyy.org]
Your contribution : [{0}]
Information Service {1}
- Info Service name
- Info booth:
- Call centre number :
- Web site address :
- Mobile site or application :
- Transport services covered:
- Name, Territory (city, department, region), Transport type (public transport...):
- Your remarks (or information about web services, open data, real time info...):
Thank you advance for any remarks, questions or suggestions about PASSIM !
''')
subject = _(u'Contribution to PASSIM : [{0}]')
# get the service info data by id
id = request.matchdict.get('id')
petitpois_api = request.registry.settings['petitpois_api']
url = '{}poi/{}'.format(petitpois_api, id)
resp = requests.get(url)
error = dict(
id=id,
result=None,
success_message=None,
subject=subject.format(name),
body=body.format(name, request.url),
title=name,
error="" + name + " " + _("Not found")
)
petitpois_response = resp.json()
parse_result = dict()
if not petitpois_response.get("data"):
return error
parse_result["updated"] = datetime.datetime.strptime(petitpois_response["data"]["updated"]["date"].split("T")[0], "%Y-%m-%d").strftime('%d/%m/%Y')
# Extract all needed data for the service infos
......@@ -299,26 +331,8 @@ def organisms(request):
id=id,
result=parse_result,
success_message=None,
subject=_(u'Contribution to PASSIM : [{0}]').format(parse_result["name"]),
body=_(u'''Your are [an end-user, a company...]
Your e-mail address: [xxx@yyy.org]
Your contribution : [{0}]
Information Service {1}
- Info Service name
- Info booth:
- Call centre number :
- Web site address :
- Mobile site or application :
- Transport services covered:
- Name, Territory (city, department, region), Transport type (public transport...):
- Your remarks (or information about web services, open data, real time info...):