Changeset 1692
- Timestamp:
- 01/30/16 13:06:47 (8 years ago)
- Location:
- trunk/LATMOS-Accounts-Web
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/About.pm
r870 r1692 3 3 use warnings; 4 4 use base 'Catalyst::Controller'; 5 6 use POSIX; 7 use DateTime; 8 use Date::Calc; 9 use Date::Parse; 5 10 6 11 =head1 NAME … … 25 30 26 31 $c->stash->{page}{title} = "A propos..."; 32 33 if ($c->user) { 34 my $ouser = $c->model('Accounts')->db->get_object( 35 'user', 36 $c->user->{username}, 37 ); 38 39 my @cd = split('-', DateTime->from_epoch( 40 epoch => str2time( 41 $ouser->get_attributes('create'), 42 ) 43 )->ymd('-')); 44 my @now = split('-', DateTime->now()->ymd('-')); 45 46 my ($Dy,$Dm,$Dd) = Date::Calc::N_Delta_YMD(@cd, @now); 47 $c->stash->{accountExists} = join(', ', 48 ($Dy ? $c->loc('[_1] years', $Dy) : ()), 49 ($Dm ? $c->loc('[_1] months', $Dm) : ()), 50 ($Dd ? $c->loc('[_1] days', $Dd) : ()), 51 ); 52 53 if (my $expire = $ouser->get_attributes('expire')) { 54 my @ed = split('-', DateTime->from_epoch( 55 epoch => str2time( 56 $expire 57 ) 58 )->ymd('-')); 59 60 my ($Dy,$Dm,$Dd) = Date::Calc::N_Delta_YMD(@now, @ed); 61 $c->stash->{accountExpire} = join(', ', 62 ($Dy ? $c->loc('[_1] years', $Dy) : ()), 63 ($Dm ? $c->loc('[_1] months', $Dm) : ()), 64 ($Dd ? $c->loc('[_1] days', $Dd) : ()), 65 ); 66 } 67 } 27 68 } 28 69 -
trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Root.pm
r1690 r1692 74 74 75 75 if ($c->user) { 76 my $ouser = $c->model('Accounts')->db->get_object( 77 'user', 78 $c->user->{username}, 79 ); 80 81 my @cd = split('-', DateTime->from_epoch( 82 epoch => str2time( 83 $ouser->get_attributes('create'), 84 ) 85 )->ymd('-')); 86 my @now = split('-', DateTime->now()->ymd('-')); 87 88 my ($Dy,$Dm,$Dd) = Date::Calc::N_Delta_YMD(@cd, @now); 89 $c->stash->{accountExists} = join(', ', 90 ($Dy ? $c->loc('[_1] years', $Dy) : ()), 91 ($Dm ? $c->loc('[_1] months', $Dm) : ()), 92 ($Dd ? $c->loc('[_1] days', $Dd) : ()), 93 ); 94 95 if (my $expire = $ouser->get_attributes('expire')) { 96 my @ed = split('-', DateTime->from_epoch( 97 epoch => str2time( 98 $expire 99 ) 100 )->ymd('-')); 101 102 my ($Dy,$Dm,$Dd) = Date::Calc::N_Delta_YMD(@now, @ed); 103 $c->stash->{accountExpire} = join(', ', 104 ($Dy ? $c->loc('[_1] years', $Dy) : ()), 105 ($Dm ? $c->loc('[_1] months', $Dm) : ()), 106 ($Dd ? $c->loc('[_1] days', $Dd) : ()), 107 ); 108 } 76 $c->res->redirect( 77 $c->uri_for('/users', $c->user->{username}) 78 ) 109 79 } 110 80 } -
trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/I18N/fr.po
r1691 r1692 7 7 msgstr "" 8 8 "Project-Id-Version: 1\n" 9 "POT-Creation-Date: 2016-01-01 12:00:00\n"9 "POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n" 10 10 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 11 11 "Last-Translator: Olivier Thauvin <olivier.thauvin@latmos.ipsl.fr\n" … … 17 17 18 18 #. ($Dd) 19 #: lib/LATMOS/Accounts/Web/Controller/ Root.pm:10620 #: lib/LATMOS/Accounts/Web/Controller/ Root.pm:9219 #: lib/LATMOS/Accounts/Web/Controller/About.pm:50 20 #: lib/LATMOS/Accounts/Web/Controller/About.pm:64 21 21 msgid "%1 days" 22 22 msgstr "%1 jours" 23 23 24 24 #. ($Dm) 25 #: lib/LATMOS/Accounts/Web/Controller/ Root.pm:10526 #: lib/LATMOS/Accounts/Web/Controller/ Root.pm:9125 #: lib/LATMOS/Accounts/Web/Controller/About.pm:49 26 #: lib/LATMOS/Accounts/Web/Controller/About.pm:63 27 27 msgid "%1 months" 28 28 msgstr "%1 mois" 29 29 30 30 #. ($Dy) 31 #: lib/LATMOS/Accounts/Web/Controller/ Root.pm:10432 #: lib/LATMOS/Accounts/Web/Controller/ Root.pm:9031 #: lib/LATMOS/Accounts/Web/Controller/About.pm:48 32 #: lib/LATMOS/Accounts/Web/Controller/About.pm:62 33 33 msgid "%1 years" 34 34 msgstr "%1 ans" … … 41 41 msgid "(none)" 42 42 msgstr "(sans)" 43 44 #: root/html/includes/sidebar.tt:77 45 msgid "About" 46 msgstr "à propos" 43 47 44 48 #: lib/LATMOS/Accounts/Web/Controller/Json/Timeline.pm:128 … … 154 158 155 159 #. (c.model("Accounts").db.get_object("user", c.user.username)) 156 #: root/html/ index.tt:1160 #: root/html/about/index.tt:3 157 161 msgid "Welcome %1." 158 162 msgstr "Bienvenue %1." 159 163 160 164 #. (c.stash.accountExists) 161 #: root/html/ index.tt:3165 #: root/html/about/index.tt:5 162 166 msgid "Your account exists for %1, we hope it does not end too soon." 163 167 msgstr "Votre compte existe depuis %1, nous espérons qu'il durera longtemps" 164 168 165 169 #. (accountExpire) 166 #: root/html/ index.tt:7170 #: root/html/about/index.tt:9 167 171 msgid "Your account will expire in %1, we are really sorry about this" 168 172 msgstr "Votre compte exprirera dans %1, Nous vraiment désolé." -
trunk/LATMOS-Accounts-Web/root/html/about/index.tt
r971 r1692 1 1 <div class="objectform"> 2 3 <p>[% l('Welcome [_1].', c.model('Accounts').db.get_object('user', c.user.username )) | html %]</p> 4 5 <p>[% l('Your account exists for [_1], we hope it does not end too soon.', 6 c.stash.accountExists) %]</p> 7 8 [% IF accountExpire %] 9 <p>[% l('Your account will expire in [_1], we are really sorry about this', accountExpire) %] 10 [% END %] 11 2 12 <h2>LATMOS::Accounts::Web</h2> 3 13 … … 12 22 <p>Philippe Weill, Yann Delcambre</p> 13 23 </div> 24 25 -
trunk/LATMOS-Accounts-Web/root/html/includes/sidebar.tt
r1674 r1692 73 73 </li> 74 74 75 <li><a href="[% c.uri_for('/admin') 76 %]">Gestion...</a></li> 75 <li><a href="[% c.uri_for('/admin') %]">Gestion...</a></li> 76 <li><a href="[% c.uri_for('/about') %]"> 77 [% l('About') %]</a></li> 77 78 </ul> 78 79 -
trunk/LATMOS-Accounts-Web/root/html/index.tt
r1687 r1692 1 <p>[% l('Welcome [_1].', c.model('Accounts').db.get_object('user', c.user.username )) | html %]</p>2 1 3 <p>[% l('Your account exists for [_1], we hope it does not end too soon.',4 c.stash.accountExists) %]</p>5 6 [% IF accountExpire %]7 <p>[% l('Your account will expire in [_1], we are really sorry about this', accountExpire) %]8 [% END %]9 10
Note: See TracChangeset
for help on using the changeset viewer.