[Bps-public-commit] r17162 - sd/trunk/lib/App/SD/Server
jesse at bestpractical.com
jesse at bestpractical.com
Tue Dec 9 19:18:50 EST 2008
Author: jesse
Date: Tue Dec 9 19:18:49 2008
New Revision: 17162
Modified:
sd/trunk/lib/App/SD/Server/Dispatcher.pm
sd/trunk/lib/App/SD/Server/View.pm
Log:
* a bit more ui
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 Tue Dec 9 19:18:49 2008
@@ -1,6 +1,15 @@
package App::SD::Server::Dispatcher;
use Prophet::Server::Dispatcher -base;
+on qr'.' => sub {
+ my $self = shift;
+ $self->server->nav->child( home => label => 'Home', url => '/');
+ $self->server->nav->child( create => label => 'New issue', url => '/issue/new');
+ $self->server->nav->child( milestones => label => 'Milestones', url => '/milestones');
+ next_rule;
+
+};
+
under 'GET' => sub {
on qr'^milestone/([\w\d-]+)$' => sub {
my $milestone = $1;
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 Dec 9 19:18:49 2008
@@ -5,6 +5,7 @@
use Template::Declare::Tags;
use Prophet::Server::ViewHelpers;
use base 'Prophet::Server::View';
+use Prophet::Web::Menu;
use App::SD::Model::Ticket;
use App::SD::Collection::Ticket;
@@ -131,6 +132,16 @@
+template footer => sub { "SD $SD::VERSION - Issue tracking for the distributed age"};
+
+template header => sub {
+ my $self = shift;
+ my $args = shift;
+ my $title = shift @$args;
+ outs_raw($self->nav->render_as_yui_menubar);
+ h1 { $title };
+};
+
template '/issues/open' => sub {
my $self = shift;
@@ -173,7 +184,7 @@
);
$issue->load(uuid =>$id);
- $issue->luid.":".$issue->prop('summary');
+ $issue->luid.": ".$issue->prop('summary');
} content {
my $self = shift;
my $id = shift;
@@ -182,26 +193,31 @@
handle => $self->app_handle->handle
);
$issue->load(uuid => $id);
- h1 { 'this is a issue' };
p {$issue->prop('summary')};
- my $props = $issue->get_props;
- dl { { class is 'issue-props'};
- for my $key (sort keys %$props) {
- dt{ $key };
- dd { $props->{$key}};
- }
- };
- show ( 'issue_attachments' => $issue);
- show ( 'issue_comments' => $issue);
- show ( 'issue_history' => $issue);
+ show issue_basics => $issue;
+ show issue_attachments => $issue;
+ show issue_comments => $issue;
+ show issue_history => $issue;
};
sub _by_creation_date { $a->prop('created') cmp $b->prop('created') };
+
+private template 'issue_basics' => sub {
+ my $self = shift;
+ my $issue = shift;
+ my $props = $issue->get_props;
+ dl { { class is 'issue-props'};
+ for my $key (sort keys %$props) {
+ dt{ $key };
+ dd { $props->{$key}};
+ }
+ };
+};
template issue_attachments => sub {
my $self = shift;
my $issue = shift;
More information about the Bps-public-commit
mailing list