[Bps-public-commit] r17220 - sd/trunk/lib/App/SD/Server

jesse at bestpractical.com jesse at bestpractical.com
Sun Dec 14 01:04:37 EST 2008


Author: jesse
Date: Sun Dec 14 01:04:37 2008
New Revision: 17220

Modified:
   sd/trunk/lib/App/SD/Server/Dispatcher.pm
   sd/trunk/lib/App/SD/Server/View.pm

Log:
* First stab at new issue flow, including redirect to record display

Modified: sd/trunk/lib/App/SD/Server/Dispatcher.pm
==============================================================================
--- sd/trunk/lib/App/SD/Server/Dispatcher.pm	(original)
+++ sd/trunk/lib/App/SD/Server/Dispatcher.pm	Sun Dec 14 01:04:37 2008
@@ -1,6 +1,17 @@
 package App::SD::Server::Dispatcher;
 use Prophet::Server::Dispatcher -base;
 
+on qr '.' => sub {
+    my $self = shift;
+    if (my $result = $self->server->result->get('create-ticket')) {
+            if ($result->success) {
+                $self->server->_send_redirect( to => '/issue/'.$result->record_uuid);
+               }
+    }
+    next_rule;
+
+};
+
 on qr'.' => sub {
     my $self = shift;
     my $issues = $self->server->nav->child( issues => label => 'Issues', url => '/issues');

Modified: sd/trunk/lib/App/SD/Server/View.pm
==============================================================================
--- sd/trunk/lib/App/SD/Server/View.pm	(original)
+++ sd/trunk/lib/App/SD/Server/View.pm	Sun Dec 14 01:04:37 2008
@@ -89,7 +89,7 @@
 
 template 'milestones' => page {
     show 'milestone_list';
-    }
+};
 
 
 template 'milestone_list' => sub {
@@ -133,7 +133,28 @@
     show( '/issue_list', $issues );
 }
 
+template new_issue => page {
+    my $self = shift;
+    title is 'Create a new issue';
+
+    form {
+        my $f = function(
+            record =>
+                App::SD::Model::Ticket->new( app_handle => $self->app_handle ),
+            action => 'create',
+            name => 'create-ticket'
+        );
+        for my $prop (
+            'summary', 'status',  'owner',    'created',
+            'due',     'creator', 'reporter', 'milestone'
+            )
+        {
 
+            div { widget( function => $f, prop => $prop ) };
+        }
+        input { attr { label => 'save', type => 'submit' } };
+    };
+};
 
 template footer => sub { "SD $App::SD::VERSION - Issue tracking for the distributed age"};
 



More information about the Bps-public-commit mailing list