From 8eb2c200c8e6befbbb0b9592019279aeacee58da Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Wed, 19 Feb 2014 23:50:41 +0100 Subject: [PATCH] Put informations on a separate page for those with no script --- lib/Lutim.pm | 5 +++++ lib/Lutim/I18N/en.pm | 1 + lib/Lutim/I18N/fr.pm | 1 + templates/about.html.ep | 6 ++++++ templates/layouts/default.html.ep | 9 +-------- 5 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 templates/about.html.ep diff --git a/lib/Lutim.pm b/lib/Lutim.pm index 1abae1a..8b374cb 100644 --- a/lib/Lutim.pm +++ b/lib/Lutim.pm @@ -132,6 +132,11 @@ sub startup { } )->name('index'); + $r->get('/about' => sub { + shift->render(template => 'about'); + } + )->name('about'); + $r->post('/' => sub { my $c = shift; my $upload = $c->param('file'); diff --git a/lib/Lutim/I18N/en.pm b/lib/Lutim/I18N/en.pm index a188e99..e39858c 100644 --- a/lib/Lutim/I18N/en.pm +++ b/lib/Lutim/I18N/en.pm @@ -50,6 +50,7 @@ our %Lexicon = ( '7_days' => '7 days', '30_days' => '30 days', '1_year' => 'One year', + 'back-to-index' => 'Back to homepage' ); 1; diff --git a/lib/Lutim/I18N/fr.pm b/lib/Lutim/I18N/fr.pm index f0e0038..4980e4d 100644 --- a/lib/Lutim/I18N/fr.pm +++ b/lib/Lutim/I18N/fr.pm @@ -50,6 +50,7 @@ our %Lexicon = ( '7_days' => '7 jours', '30_days' => '30 jours', '1_year' => 'Un an', + 'back-to-index' => 'Retour à la page d\'accueil' ); 1; diff --git a/templates/about.html.ep b/templates/about.html.ep new file mode 100644 index 0000000..d3fdbfd --- /dev/null +++ b/templates/about.html.ep @@ -0,0 +1,6 @@ +% # vim:set sw=4 ts=4 sts=4 ft=html.epl expandtab: +% my $scheme = (defined(config('https')) && config('https')) ? 'https' : 'http'; + diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep index 87c01c3..0000a1f 100644 --- a/templates/layouts/default.html.ep +++ b/templates/layouts/default.html.ep @@ -53,6 +53,7 @@ © 2014 <%= link_to 'http://www.fiat-tux.fr' => begin %>Luc Didry<% end %> —  <%=l 'license' %> <%= link_to 'https://www.gnu.org/licenses/agpl-3.0.html' => begin %>AGPL<% end %> —  <%=l 'informations' %> —  + <%= link_to 'https://github.com/ldidry/lutim' => (title => l 'fork-me') => begin %><% end %>  <%= link_to $twitter_url => (title => l 'share-twitter') => begin %><% end %>  <%= link_to 'https://flattr.com/submit/auto?user_id=_SKy_&url='.$url.'&title=LUTIm&category=software' => (title => 'Flattr this') => begin %><% end %>  @@ -77,14 +78,6 @@ - % if (defined(config('piwik_img'))) {