[Jifty-commit] r7200 - jifty/trunk/lib/Jifty/Plugin/REST

Jifty commits jifty-commit at lists.jifty.org
Mon Jun 8 10:12:54 EDT 2009


Author: sartak
Date: Mon Jun  8 10:12:54 2009
New Revision: 7200

Modified:
   jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm

Log:
Put the app name in REST HTML titles

Modified: jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm	(original)
+++ jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm	Mon Jun  8 10:12:54 2009
@@ -329,8 +329,11 @@
     my $prefix = shift;
     my $url = shift;
     my $content = shift;
+
+    my $title = _("%1 - REST API", Jifty->config->framework('ApplicationName'));
+
     if (ref($content) eq 'ARRAY') {
-        return start_html(-encoding => 'UTF-8', -declare_xml => 1, -title => 'REST API'),
+        return start_html(-encoding => 'UTF-8', -declare_xml => 1, -title => $title),
               ul(map {
                 ref($_) eq 'HASH' ? render_as_html($url, $prefix,$_) :
                     li(
@@ -343,7 +346,7 @@
               end_html();
     }
     elsif (ref($content) eq 'HASH') {
-        return start_html(-encoding => 'UTF-8', -declare_xml => 1, -title => 'REST API'),
+        return start_html(-encoding => 'UTF-8', -declare_xml => 1, -title => $title),
               dl(map {
                   dt($prefix ?
                      a({-href => "$url/".Jifty::Web->escape_uri($_)}, Jifty::Web->escape($_))
@@ -353,7 +356,7 @@
               end_html();
     }
     else {
-        return start_html(-encoding => 'UTF-8', -declare_xml => 1, -title => 'REST API'),
+        return start_html(-encoding => 'UTF-8', -declare_xml => 1, -title => $title),
               Jifty::Web->escape($content),
               end_html();
     }


More information about the Jifty-commit mailing list