[Bps-public-commit] SD - A distributed issue tracker branch, master, updated. b218fdae1be844efb2ae70cebcf7549c5893924c

jesse jesse at bestpractical.com
Sun Jan 18 23:57:15 EST 2009


The branch, master has been updated
       via  b218fdae1be844efb2ae70cebcf7549c5893924c (commit)
      from  9d5880914f5a28613ac75cc3342e06f81f4ff746 (commit)

Summary of changes:
 lib/App/SD/Model/Ticket.pm |   20 +++++++++++++++++++-
 lib/App/SD/Server/View.pm  |   41 +++++++++++++++++++++++++----------------
 2 files changed, 44 insertions(+), 17 deletions(-)

- Log -----------------------------------------------------------------
commit b218fdae1be844efb2ae70cebcf7549c5893924c
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Sun Jan 18 23:56:56 2009 -0500

    Work toward autocanonicalizing due dates in webui

diff --git a/lib/App/SD/Model/Ticket.pm b/lib/App/SD/Model/Ticket.pm
index 2e0dcb0..57646f4 100644
--- a/lib/App/SD/Model/Ticket.pm
+++ b/lib/App/SD/Model/Ticket.pm
@@ -18,7 +18,6 @@ sub BUILD {
     $ACTIVE_STATUSES ||= $self->app_handle->setting(label => 'active_statuses')->get();
 }
 
-
 sub default_prop_component { 
     my $self = shift; 
     return $self->app_handle->setting(label => 'default_component')->get()->[0];
@@ -80,6 +79,25 @@ sub canonicalize_prop_status {
     return 1;
 }
 
+
+sub canonicalize_prop_due {
+    my $self = shift;
+    my %args = @_;
+
+    return 1; # XXX TODO
+    my $props = $args{props};
+    return 1 unless $props->{due};
+    require DateTime::Format::Natural;
+    my $parser = DateTime::Format::Natural->new;
+    my $dt = $parser->parse_datetime($props->{due});
+    if ($parser->success) {
+     # operate on $dt/@dt, for example:
+     $props->{due} = sprintf( "%04d-%02d-%02d %02d:%02d:%02d\n", $dt->year, $dt->month, $dt->day, $dt->hour, $dt->min, $dt->sec);
+    }
+    return 1;
+}
+
+
 =head2 _default_summary_format
 
 The default ticket summary format (used for displaying tickets in a
diff --git a/lib/App/SD/Server/View.pm b/lib/App/SD/Server/View.pm
index 624197d..b68f2dd 100644
--- a/lib/App/SD/Server/View.pm
+++ b/lib/App/SD/Server/View.pm
@@ -404,9 +404,11 @@ template new_ticket => page {'Create a new ticket'} content {
 
 
         for my $prop (
-            'status', 'milestone', 'component',  
+            'milestone', 'component',  
+            'due',     
+            'owner',  
             'reporter',
-            'owner',  'due',     
+            'status',
             ) {
 
             div { {class is 'widget '.$prop};
@@ -468,28 +470,30 @@ private template 'ticket_list' => sub {
     my $id = substr(rand(10),2); # hack  to get a unique id
     table {
         { class is 'tablesorter'; id is $id; };
-        thead {     
+        thead {
             row {
-            th { 'id'};
-            th {'Status'};
-            th {'Owner'};
-            th {'Summary'};
-            th {'Created'};
+                th { 'id'};
+                th { 'Summary'};
+                th {'Status'};
+                th {'Milestone'};
+                th {'Owner'};
+                th {'Created'};
+                th {'Due'};
             }
         };
         tbody {
-        for my $ticket (@$tickets) {
-            row {
-
-                cell { ticket_link( $ticket => $ticket->luid );};
-                for (qw(status owner summary created)) {
-                cell{ class is $_;  $ticket->prop($_) };
-                }
+            for my $ticket (@$tickets) {
+                row {
+                    cell { ticket_link( $ticket => $ticket->luid ); };
+                    cell { class is 'summary'; ticket_link( $ticket => $ticket->prop('summary') ); };
+                    for (qw(status milestone owner created due)) {
+                        cell { class is $_; $ticket->prop($_) };
+                    }
                 }
 
             }
         };
-        };
+    };
          script {outs_raw(qq{
             \$(document).ready(function() { \$("#@{[$id]}").tablesorter(); } ); 
         });
@@ -535,7 +539,12 @@ private template 'ticket_basics' => sub {
     my $ticket = shift;
         my $props = $ticket->get_props;
         div { { class is 'ticket-props'};
+            div { class is 'widget'; 
+                label { 'UUID' };
+            div { { class is 'value uuid'}; $ticket->uuid; } 
+            };
         for my $key (sort keys %$props) {
+            next if ($key =~ /.{8}-.{4}-.{4}-.{12}-id/);
             div { class is 'widget'; 
                 label{ $key };
             div { { class is 'value '.$key}; $props->{$key};

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



More information about the Bps-public-commit mailing list