[vhffs-dev] [1701] Simplified object history code.

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1701
Author:   beuss
Date:     2011-05-12 22:10:05 +0200 (Thu, 12 May 2011)
Log Message:
-----------
Simplified object history code.

Modified Paths:
--------------
    trunk/vhffs-panel/history.pl
    trunk/vhffs-panel/templates/misc/history.tt

Modified: trunk/vhffs-panel/history.pl
===================================================================
--- trunk/vhffs-panel/history.pl	2011-05-11 06:12:37 UTC (rev 1700)
+++ trunk/vhffs-panel/history.pl	2011-05-12 20:10:05 UTC (rev 1701)
@@ -75,15 +75,6 @@
     $panel->set_title( gettext("History") );
 
 	my $history = $object->get_history;
-
-    use DateTime;
-    use DateTime::Locale;
-    my $loc = DateTime::Locale->load($user->get_lang);
-
-    foreach(@$history) {
-        my $dt = DateTime->from_epoch( epoch => $_->{date}, locale => $user->get_lang);
-        $_->{date} = $dt->format_cldr($loc->date_format_medium().' '.$loc->time_format_long());
-    }
     $panel->render('misc/history.tt', { history => $history });
 }
 

Modified: trunk/vhffs-panel/templates/misc/history.tt
===================================================================
--- trunk/vhffs-panel/templates/misc/history.tt	2011-05-11 06:12:37 UTC (rev 1700)
+++ trunk/vhffs-panel/templates/misc/history.tt	2011-05-12 20:10:05 UTC (rev 1701)
@@ -13,7 +13,7 @@
     <tbody>
 [% FOREACH h IN history %]
     <tr>
-        <td>[% h.date %]</td>
+        <td>[% date.format(h.date, '%x %X') %]</td>
         [% IF h.object.defined() %]<td>[% h.object_type | html %]</td>
         <td>[% h.object.get_label %]</td>[% END %]
         <td>[% h.message %]</td>


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/