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

jesse at bestpractical.com jesse at bestpractical.com
Sun Sep 7 22:42:35 EDT 2008


Author: jesse
Date: Sun Sep  7 22:42:34 2008
New Revision: 15790

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

Log:
 The very beginning of an actual html ui for the bug trakcing side

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 Sep  7 22:42:34 2008
@@ -6,11 +6,63 @@
 use Prophet::Server::ViewHelpers;
 use base 'Prophet::Server::View';
 
+    use App::SD::Model::Ticket;
+    use App::SD::Collection::Ticket;
+
+
 template '/' => 
     page    { 'SD' }
     content {
          p { 'sd is a P2P bug tracking system.' };
 
+    show('/bugs/open');
+
+};
+
+
+template '/bugs/open' => sub {
+    my $self = shift;
+    my $bugs = App::SD::Collection::Ticket->new( app_handle => $self->app_handle, handle     => $self->app_handle->handle);
+    $bugs->matching( sub { my $item = shift; return $item->prop('status') ne 'closed'  ? 1 : 0; } );
+
+
+    h2 { 'Open bugs' };
+
+    for my $bug (@$bugs) {
+    ul {
+    
+        li {
+
+
+            bug_link($bug => $bug->luid);
+            span { $bug->prop('status') };
+            span { $bug->prop('summary') };
+            span { $bug->prop('created') };
+
+        }
+
+    }
+
+        }
+
 };
 
+
+template '/show_bug' => page {
+    
+
+} content {
+
+
+};
+
+
+sub bug_link {
+        my $bug = shift;
+        my $label = shift;
+        a {{ class is 'bug';
+            href is '/bug/'.$bug->uuid; };
+            $label;
+        };
+    } 
 1;



More information about the Bps-public-commit mailing list