[Bps-public-commit] r16293 - in sd/trunk/lib/App: . SD/Server

jesse at bestpractical.com jesse at bestpractical.com
Tue Oct 14 17:55:11 EDT 2008


Author: jesse
Date: Tue Oct 14 17:55:11 2008
New Revision: 16293

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

Log:
use new prophet supprot for database settings

Modified: sd/trunk/lib/App/SD.pm
==============================================================================
--- sd/trunk/lib/App/SD.pm	(original)
+++ sd/trunk/lib/App/SD.pm	Tue Oct 14 17:55:11 2008
@@ -4,6 +4,19 @@
 extends 'Prophet::App';
 our $VERSION = '0.01';
 
+
+sub database_settings {
+{ 
+        statuses            => ['24183C4D-EFD0-4B16-A207-ED7598E875E6' => qw/new open stalled closed/],
+        default_status      => ['2F9E6509-4468-438A-A733-246B3061003E' => 'new' ],
+        components          => ['6CBD84A1-4568-48E7-B90C-F1A5B7BD8ECD' => qw/core ui docs tests/],
+        default_component   => ['0AEC922F-57B1-44BE-9588-816E5841BB18' => 'core'],
+        milestones          => ['1AF5CF74-A6D4-417E-A738-CCE64A0A7F71' => qw/alpha beta 1.0/]
+};
+
+}
+
 __PACKAGE__->meta->make_immutable;
+
 no Moose;
 1;

Modified: sd/trunk/lib/App/SD/Model/Ticket.pm
==============================================================================
--- sd/trunk/lib/App/SD/Model/Ticket.pm	(original)
+++ sd/trunk/lib/App/SD/Model/Ticket.pm	Tue Oct 14 17:55:11 2008
@@ -14,7 +14,12 @@
 
 =cut
 
-sub default_prop_status { 'new' }
+
+
+sub default_prop_status { 
+    my $self = shift; 
+    return $self->app_handle->setting(label => 'default_status')->get()->[0];
+}
 
 =head2 default_prop_reported_by
 

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	Tue Oct 14 17:55:11 2008
@@ -8,7 +8,73 @@
 
     use App::SD::Model::Ticket;
     use App::SD::Collection::Ticket;
+template head => sub {
+    my $self = shift;
+    my $args = shift;
+    head {
+        title { shift @$args };
+show('style');
+    }
+
+};
+
+
+
+template 'style' => sub {
+
+style {
+outs_raw('
+    body {
+  font-family: sans-serif;
+}
+
+div.buglist {
+
+ border: 1px solid grey;
+  -moz-border-radius: 0.5em;
+   -webkit-botder-radius: 0.5em;
+   }
+
+   div.buglist ul {
+   list-style-type:none;
+
+   }
+
+   div.buglist ul li {
+   clear: both;
+   padding-bottom: 2em;
+   border-bottom: 1px solid #ccc;
+   margin-bottom: 1em;
 
+ 
+   }
+
+   
+
+   div.buglist ul li span {
+
+     float: left;
+   padding: 0.2em;
+     }
+
+div.buglist ul li span.summary {
+  width: 70%;
+
+}
+
+div.buglist ul li span.bug-link {
+  width: 2em;
+  text-align: right;
+}
+
+div.buglist ul li span.status {
+   width: 3em;
+
+}
+
+');
+}
+};
 
 template '/' => 
     page    { 'SD' }
@@ -28,6 +94,8 @@
 
     h2 { 'Open bugs' };
 
+    div { class is 'buglist'; 
+
     for my $bug (@$bugs) {
     ul {
     
@@ -35,16 +103,16 @@
 
 
             bug_link($bug => $bug->luid);
-            span { $bug->prop('status') };
-            span { $bug->prop('summary') };
-            span { $bug->prop('created') };
+            span { class is 'status'; $bug->prop('status') };
+            span { class is 'summary'; $bug->prop('summary') };
+            span { class is 'created'; $bug->prop('created') };
 
         }
 
     }
 
         }
-
+    }
 };
 
 
@@ -60,9 +128,9 @@
 sub bug_link {
         my $bug = shift;
         my $label = shift;
-        a {{ class is 'bug';
+        span { class is 'bug-link'; a {{ class is 'bug';
             href is '/bug/'.$bug->uuid; };
             $label;
-        };
+        }};
     } 
 1;



More information about the Bps-public-commit mailing list