[Bps-public-commit] App-Changeloggr branch, master, updated. 87e06d4ba2270477f671b40f8f512027b8dcf8e0

sartak at bestpractical.com sartak at bestpractical.com
Wed May 20 16:06:09 EDT 2009


The branch, master has been updated
       via  87e06d4ba2270477f671b40f8f512027b8dcf8e0 (commit)
      from  0f999e9248d46b7ba215e4908799b87725aaee36 (commit)

Summary of changes:
 lib/App/Changeloggr/Dispatcher.pm |   38 ++++++++++++++++++++----------------
 1 files changed, 21 insertions(+), 17 deletions(-)

- Log -----------------------------------------------------------------
commit 87e06d4ba2270477f671b40f8f512027b8dcf8e0
Author: Shawn M Moore <sartak at gmail.com>
Date:   Wed May 20 16:06:01 2009 -0400

    Move export nav to admin page

diff --git a/lib/App/Changeloggr/Dispatcher.pm b/lib/App/Changeloggr/Dispatcher.pm
index 7ca69dc..84bf3ae 100644
--- a/lib/App/Changeloggr/Dispatcher.pm
+++ b/lib/App/Changeloggr/Dispatcher.pm
@@ -18,23 +18,7 @@ on '/admin/created-changelog' => run {
 };
 
 on '/changelog/*' => run {
-    my $name = $1;
-    set name => $name;
-
-    my $changelog = Jifty->web->navigation->child(
-        $name  => url => "/changelog/$name",
-        active => 1,
-    );
-
-    my @output_formats = map { s/.*:://; $_ } App::Changeloggr->output_formats;
-
-    for my $format_name (@output_formats) {
-        $changelog->child(
-            "Export as $format_name" =>
-            url => "/changelog/$name/$format_name/Changes",
-        );
-    }
-
+    set name => $1;
     show '/changelog';
 };
 
@@ -75,6 +59,8 @@ on qr{^/admin/changelog((?:/[^/]+)*)/([^/]+)$} => run {
         Votes => url => "/admin/changelog/votes/$uuid",
     );
 
+    add_export_format_nav($cl->name);
+
     set id => $cl->id;
     show "/admin/changelog$subpage";
 };
@@ -86,5 +72,23 @@ before '/account' => sub {
     );
 };
 
+sub add_export_format_nav {
+    my $name = shift;
+
+    my $changelog = Jifty->web->navigation->child(
+        $name  => url => "/changelog/$name",
+        active => 1,
+    );
+
+    my @output_formats = map { s/.*:://; $_ } App::Changeloggr->output_formats;
+
+    for my $format_name (@output_formats) {
+        $changelog->child(
+            "Export as $format_name" =>
+            url => "/changelog/$name/$format_name/Changes",
+        );
+    }
+}
+
 1;
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list