[freeside-commits] freeside/httemplate/browse msg_template.html, 1.3, 1.3.4.1

Mark Wells mark at wavetail.420.am
Fri Aug 5 00:25:45 PDT 2011


Update of /home/cvs/cvsroot/freeside/httemplate/browse
In directory wavetail.420.am:/tmp/cvs-serv15439/httemplate/browse

Modified Files:
      Tag: FREESIDE_2_3_BRANCH
	msg_template.html 
Log Message:
message template localization, #13601

Index: msg_template.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/browse/msg_template.html,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -w -d -r1.3 -r1.3.4.1
--- msg_template.html	17 Aug 2010 06:57:53 -0000	1.3
+++ msg_template.html	5 Aug 2011 07:25:43 -0000	1.3.4.1
@@ -10,10 +10,12 @@
               'disabled_statuspos' => 2,
               'agent_virt'         => 1,
               'agent_null_right'   => ['Edit global templates','Configuration'],
-              'agent_pos'          => 3,
-              'header' => [ 'Name' ],
-              'fields' => [ 'msgname' ],
-              'links'  => [ $link ],
+              'agent_pos'          => 1,
+              'header' => [ 'Name', '', ('' x scalar @locales) ],
+              'fields' => [ 'msgname', @locales ],
+              'links'  => [ $link, @locale_links ],
+              'cell_style' => 
+                          [ '', '', ($locale_style) x (scalar @locales) ],
           )
 %>
 <%init>
@@ -23,6 +25,22 @@
   ||     $FS::CurrentUser::CurrentUser->access_right('Edit global templates')
   ||     $FS::CurrentUser::CurrentUser->access_right('Configuration');
 
-my $link = [ "${p}edit/msg_template.html?", 'msgnum' ];
+my $link = [ "${p}edit/msg_template.html?msgnum=", 'msgnum' ];
+
+my $locale_style = 'font-size:0.8em; padding:3px; background-color:';
+
+my (@locales, @locale_links);
+foreach my $l ( FS::Locales->locales ) {
+  push @locales, sub {
+    exists ( $_[0]->content_locales->{$l} )
+    ? +{ FS::Locales->locale_info($l) }->{'name'} 
+    : '';
+  };
+  push @locale_links, sub {
+    my $content = $_[0]->content_locales->{$l} or return '';
+    [ "${p}edit/msg_template.html?locale=$l;msgnum=", 'msgnum' ];
+  };
+}
+    
 
 </%init>



More information about the freeside-commits mailing list