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

jesse jesse at bestpractical.com
Tue Feb 10 18:54:22 EST 2009


The branch, master has been updated
       via  cec42b7ffb717679385508eed272d4cdf9aa7a15 (commit)
       via  4e47fbe26eaf0eb82b551bfc5233c678e3eda248 (commit)
      from  d542bb5aea0405a16f88f285ac22d5c206dd0ec0 (commit)

Summary of changes:
 lib/App/SD/Server/Dispatcher.pm |    2 +-
 lib/App/SD/Server/View.pm       |  105 ++++++++++++++++++++++++++++----------
 share/web/static/css/main.css   |   74 ++++++++++++++++++++++-----
 3 files changed, 138 insertions(+), 43 deletions(-)

- Log -----------------------------------------------------------------
commit 4e47fbe26eaf0eb82b551bfc5233c678e3eda248
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Feb 10 17:19:13 2009 -0500

    Missed a dispatcher update

diff --git a/lib/App/SD/Server/Dispatcher.pm b/lib/App/SD/Server/Dispatcher.pm
index e3d419a..f1db8a1 100644
--- a/lib/App/SD/Server/Dispatcher.pm
+++ b/lib/App/SD/Server/Dispatcher.pm
@@ -66,7 +66,7 @@ under { method => 'GET' } => sub {
     };
     
     on qr'^/tickets/all$' => sub {shift->show_template('all_tickets')};
-    under qr'^/ticket' => sub {
+    under qr'^/ticket/' => sub {
         on '' => sub {
             my $self = shift;
             if ( my $id = $self->server->cgi->param('id') ) {

commit cec42b7ffb717679385508eed272d4cdf9aa7a15
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Feb 10 18:53:54 2009 -0500

    Make the layout for ticket history a little prettier

diff --git a/lib/App/SD/Server/View.pm b/lib/App/SD/Server/View.pm
index f06c05e..e2cd138 100644
--- a/lib/App/SD/Server/View.pm
+++ b/lib/App/SD/Server/View.pm
@@ -449,13 +449,14 @@ private template 'ticket_basics' => sub {
             delete $props{$key};
         
         };
-
+        if ($props{description} ) {
             div { class is 'widget description';
                 label {'description'};
                 div { { class is 'value description' };
                         outs($props{description});
                 }
             };
+            }
     };
     script { outs_raw('$("div.created,div.due").prettyDateTag();
 setInterval(function(){ $("div.created,div.due").prettyDateTag(); }, 5000);') };
@@ -470,33 +471,75 @@ template ticket_attachments => sub {
 
 };
 template ticket_history => sub {
-    my $self = shift;
+    my $self   = shift;
     my $ticket = shift;
 
-   
-    dl { { class is 'history'};
-    for my $changeset  (sort {$a->created cmp $b->created}  $ticket->changesets) {
-        dt {
-                span { { class is 'created'};  $changeset->created };
-                span { { class is 'creator'};  $changeset->creator || i { 'Missing author'};  };
-                span { { class is 'original_sequence_no'};  $changeset->original_sequence_no};
-                span { { class is 'original_source_uuid'}; $changeset->original_source_uuid };
+    dl {
+        { class is 'history' };
+        for my $changeset ( sort { $a->created cmp $b->created } $ticket->changesets ) {
+            dt {
+                span {
+                    { class is 'created' };
+                    $changeset->created;
+                };
+                span {
+                    { class is 'creator' };
+                    $changeset->creator || i {'Missing author'};
+                };
+                span { class is 'source_info';
+                span {
+                    { class is 'original_sequence_no' };
+                    $changeset->original_sequence_no;
                 };
-        dd { 
-                for my $change ($changeset->changes) {
-                    next unless $change->record_uuid eq $ticket->uuid;
-                        ul {
-                            map { li {$_->summary} } $change->prop_changes;
-                        };
+                span {
+                    { class is 'original_source_uuid' };
+                    $changeset->original_source_uuid;
+                };
+                };
+            };
+            dd {
+                for my $change ( $changeset->changes ) {
+                    if ( $change->record_uuid eq $ticket->uuid ) {
+                    ul {
+
+                        li { outs_raw($_) }
+                        for (grep {$_}
+                            map { show_history_prop_change($_) } ( $change->prop_changes ));
                     }
-                
+                    } else {
+                        i { 'Something else changed - It was ' . $change->record_type . " ".$change->record_uuid};
+                    }
+
+                }
             }
+
         }
-    }
-    script { outs_raw('$("span.created").prettyDateTag();
-setInterval(function(){ $("span.created").prettyDateTag(); }, 5000);') };
+    };
+    script {
+        outs_raw(
+            '$("span.created").prettyDateTag();
+setInterval(function(){ $("span.created").prettyDateTag(); }, 5000);'
+        );
+    };
 };
 
+sub show_history_prop_change {
+    my $pc = shift;
+    if ( defined $pc->old_value && defined $pc->new_value ) {
+        span { class is 'property'; $pc->name }
+        . span { class is 'prose'; ' changed from ' }
+            . span { class is 'value old'; $pc->old_value } . span { class is 'prose'; " to " }
+            . span { class is 'value new'; $pc->new_value };
+    } elsif ( defined $pc->new_value ) {
+        span                { class is 'property';  $pc->name }
+        . span { class is 'prose'; ' set to '} . span { class is 'value new'; $pc->new_value }
+
+    } elsif ( defined $pc->new_value ) {
+        span       { class is 'property';  $pc->name } . ' ' 
+            . span { class is 'value old'; $pc->new_value } . span { class is 'prose'; ' deleted'};
+    }
+}
+
 template ticket_comments => sub {
     my $self     = shift;
     my $ticket    = shift;
@@ -506,6 +549,19 @@ template ticket_comments => sub {
         ul {
             { class is 'comments' };
             for my $comment (@comments) {
+                show('ticket_comment', $comment);
+
+            }
+        }
+    script { outs_raw('$("span.created").prettyDateTag();
+setInterval(function(){ $("span.created").prettyDateTag(); }, 5000);') };
+    }
+
+};
+
+template ticket_comment => sub {
+    my $self = shift;
+    my $comment = shift;
                 li {
                     span {
                         { class is 'metadata' };
@@ -525,14 +581,7 @@ template ticket_comments => sub {
                         }
                     }
                 }
-            }
-        }
-    script { outs_raw('$("span.created").prettyDateTag();
-setInterval(function(){ $("span.created").prettyDateTag(); }, 5000);') };
-    }
-
-};
-
+                };
 
 sub ticket_link {
     my $ticket   = shift;
diff --git a/share/web/static/css/main.css b/share/web/static/css/main.css
index 29bfae3..ccfeec2 100644
--- a/share/web/static/css/main.css
+++ b/share/web/static/css/main.css
@@ -161,8 +161,6 @@ th.headerSortDown {
 }
 
     
-}
-
 
 ul.comments {
     list-style: none;
@@ -249,7 +247,7 @@ div.comment-form {
     padding: 2em;
     padding-top: 0;
     align: center;
-    background: #eee;
+    background: #ddd;
 }
 
 div.comment-form textarea {
@@ -290,7 +288,9 @@ div.widget.status, div.widget.component, div.widget.milestone {
     padding-left: 0.5em;
     padding-right: 1em;
     margin-right: -0.3em;
-    width: 29%;
+    width: 28%;
+    border-bottom: none;
+    border-top: none;
 }
 
 div.widget.description {
@@ -438,7 +438,7 @@ ul.page-nav ul li:hover {
 }
 
  table.tablesorter tbody tr:nth-child(odd) td {
-    background: #eee;
+    background: #ddd;
 }
 
 
@@ -456,15 +456,26 @@ table.tablesorter tr td.summary {
 }
 
 
-
+dl.history {
+    margin-right: 1em;
+}
 dl.history dt {
     border-top: 1px solid #ccc;
-    padding: 0.5em;
+    padding-top: 0.5em;
+    padding-bottom: 0.5em;
+
     color: #666; 
+    width: 100%;
+    font-size: 0.8em;
+}
+
+dl.history dt .source_info {
+    float: right;
 }
 
 dl.history dt .created {
-    padding-right: 1em;
+    width: 8em;
+    display: inline-block;
 
 }
 
@@ -474,7 +485,7 @@ dl.history dt .creator {
 }
 
 dl.history dt .original_sequence_no {
-    color: #ccc;
+    color: #666;
 }
 
 dl.history dt .original_sequence_no:after {
@@ -482,14 +493,46 @@ dl.history dt .original_sequence_no:after {
 }
 
 dl.history dt .original_source_uuid {
-    color: #ccc;
+    color: #666;
 }
+
+
 dl.history dd {
     margin-bottom: 0.5em; 
+    font-size: 0.9em;
+    margin-right: 0;
     }
 
-dl.history dd ul { 
-    list-style: none;
+dl.history dd ul li{ 
+    list-style-type: none;
+    padding: 0.5em;
+    padding-left: 1.5em;
+}
+
+dl.history dd ul li:nth-child(odd) {
+    background: #ddd;
+    -webkit-border-radius: 0.4em;
+    -moz-border-radius: 0.4em;
+}
+
+
+dl.history span.property {
+    font-weight: bold;
+    display: inline-block;
+    width: 8em;
+    text-align: right;
+    overflow: hidden;
+}
+
+dl.history span.prose {
+    color: #666;    
+}
+
+dl.history span.value.new,
+dl.history span.value.old {
+}
+
+dl.history span.value.old {
 }
 
 ul.comments li {
@@ -523,7 +566,9 @@ ul.comments li .content {
 }
 
 ul.comments li:nth-child(odd) {
-    background: #f5f5f5;
+    background: #ddd;
+    -moz-border-radius: 0.4em;
+    -webkit-border-radius: 0.4em;
 }
 
 table.tablesorter {
@@ -560,7 +605,7 @@ table.tablesorter td.summary {
  overflow: hidden;
  margin-top: 0.75em;
  height: 1em;
- left: 3.75em;
+ left: 4.5em;
  position: absolute;
  padding-bottom: 1.25em;
  border-bottom: none;
@@ -587,6 +632,7 @@ table.tablesorter td.id  {
     padding-top: 1.5em;
     text-align: right;
     margin-right: em;
+    width: 3.5em;
 }
 table.tablesorter td.id a {
     color: #bbb;

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



More information about the Bps-public-commit mailing list