[Bps-public-commit] r16974 - sd/trunk/lib/App/SD/Server
jesse at bestpractical.com
jesse at bestpractical.com
Fri Nov 21 19:45:30 EST 2008
Author: jesse
Date: Fri Nov 21 19:45:28 2008
New Revision: 16974
Modified:
sd/trunk/lib/App/SD/Server/Dispatcher.pm
sd/trunk/lib/App/SD/Server/View.pm
Log:
* beginnings of being able to show an individual bug
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 Fri Nov 21 19:45:28 2008
@@ -1,18 +1,31 @@
package App::SD::Server::Dispatcher;
use Prophet::Server::Dispatcher -base;
+on qr'^GET/bug/([\w\d-]+)' => sub {
+ my $self = shift;
+ warn "my bug is $1";
+ $self->show_template('show_bug', $1);
+
+ };
on qr'^GET/(.*)$' => sub {show_template($1)->(@_)};
redispatch_to 'Prophet::Server::Dispatcher';
sub show_template {
+ if(ref($_[0])) {
+ # called in oo context. do it now
+ my $self = shift;
+ my $template = shift;
+ $self->server->show_template($template, @_);
+ } else {
+
my $template = shift;
return sub {
my $self = shift;
- $self->server->show_template($template);
+ $self->server->show_template($template, @_);
};
-
+ }
}
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 Fri Nov 21 19:45:28 2008
@@ -116,10 +116,29 @@
}
};
-template '/show_bug' => page {
+template 'show_bug' => page {
+ my $self = shift;
+ my $id = shift;
+ warn "SELF Is $self";
+ warn "ID IS $id";
+ warn $self->app_handle;
+ my $bug = App::SD::Model::Ticket->new(
+ app_handle => $self->app_handle,
+ handle => $self->app_handle->handle
+ );
+ $bug->load(uuid =>$id);
+ title is $bug->luid.":".$bug->summary;
} content {
-
+ my $self = shift;
+ my $id = shift;
+ my $bug = App::SD::Model::Ticket->new(
+ app_handle => $self->app_handle,
+ handle => $self->app_handle->handle
+ );
+ $bug->load(uuid => $id);
+ h1 { 'this is a bug' };
+ p {$bug->prop('summary')};
};
sub bug_link {
More information about the Bps-public-commit
mailing list