[Bps-public-commit] r17540 - in sd/trunk: lib/App/SD/CLI/Command/Help lib/App/SD/Server
jesse at bestpractical.com
jesse at bestpractical.com
Fri Jan 2 19:57:55 EST 2009
Author: jesse
Date: Fri Jan 2 19:57:55 2009
New Revision: 17540
Modified:
sd/trunk/lib/App/SD/CLI/Command/Help/About.pm
sd/trunk/lib/App/SD/CLI/Command/Help/Environment.pm
sd/trunk/lib/App/SD/CLI/Command/Help/Intro.pm
sd/trunk/lib/App/SD/Server/Dispatcher.pm
sd/trunk/lib/App/SD/Server/View.pm
sd/trunk/t/server.t
Log:
* Switch the webui from 'issue' to 'ticket', since that's what SD uses internally.
Modified: sd/trunk/lib/App/SD/CLI/Command/Help/About.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Help/About.pm (original)
+++ sd/trunk/lib/App/SD/CLI/Command/Help/About.pm Fri Jan 2 19:57:55 2009
@@ -8,7 +8,7 @@
$self->print_header('About SD');
print <<EOF
-sd is a peer-to-peer replicated issue tracking system built on the
+sd is a peer-to-peer replicated ticket tracking system built on the
Prophet dataabase and synchronization framework. sd is designed for
inter-organization replication and sharing, as well as offline
operation. For more information, join us at http://syncwith.us.
Modified: sd/trunk/lib/App/SD/CLI/Command/Help/Environment.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Help/Environment.pm (original)
+++ sd/trunk/lib/App/SD/CLI/Command/Help/Environment.pm Fri Jan 2 19:57:55 2009
@@ -17,7 +17,7 @@
export EMAIL=jesse\@example.com
Use jesse\@example.com as the default email address for reporting
- issues
+ tickets
export PROPHET_REPLICA_TYPE=prophet
Use the prophet native replica type. In the future other backend
Modified: sd/trunk/lib/App/SD/CLI/Command/Help/Intro.pm
==============================================================================
--- sd/trunk/lib/App/SD/CLI/Command/Help/Intro.pm (original)
+++ sd/trunk/lib/App/SD/CLI/Command/Help/Intro.pm Fri Jan 2 19:57:55 2009
@@ -8,11 +8,11 @@
my $cmd = $self->_get_cmd_name;
print <<EOF
-SD is a peer to peer issue tracking system built on the Prophet
-distributed database. SD is designed to make it easy to work with issues
-and to share issue databases with your collaborators.
+SD is a peer to peer ticket tracking system built on the Prophet
+distributed database. SD is designed to make it easy to work with tickets
+and to share ticket databases with your collaborators.
-To get started with SD, you need an issue database. To get an issue
+To get started with SD, you need an ticket database. To get an issue
database, you have two options: You can clone an existing database
or start a new one.
@@ -20,11 +20,11 @@
home directory. You can override this behaviour by setting the SD_REPO
environment variable.
-To clone an issue database:
+To clone an ticket database:
$cmd clone --from http://example.com/path/to/sd
-To start a new issue database:
+To start a new ticket database:
$cmd init
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 Jan 2 19:57:55 2009
@@ -9,7 +9,7 @@
my $self = shift;
if ( my $result = $self->server->result->get('create-ticket') ) {
if ( $result->success ) {
- $self->server->_send_redirect( to => '/issue/' . $result->record_uuid );
+ $self->server->_send_redirect( to => '/ticket/' . $result->record_uuid );
}
}
next_rule;
@@ -18,24 +18,24 @@
on qr'.' => sub {
my $self = shift;
- my $issues = $self->server->nav->child( issues => label => 'Issues', url => '/issues');
- $issues->child( go => label => '<form method="GET" action="/issue"><a href="#">Show issue # <input type=text name=id size=3></a></form>', escape_label => 0);
+ my $tickets = $self->server->nav->child( issues => label => 'Issues', url => '/issues');
+ $tickets->child( go => label => '<form method="GET" action="/issue"><a href="#">Show issue # <input type=text name=id size=3></a></form>', escape_label => 0);
- my $milestones = $issues->child( milestones => label => 'Milestones', url => '/milestones');
+ my $milestones = $tickets->child( milestones => label => 'Milestones', url => '/milestones');
my $items = $self->server->app_handle->setting( label => 'milestones' )->get();
foreach my $item (@$items) {
$milestones->child( $item => label => $item, url => '/milestone/'.$item);
}
- my $components = $issues->child( components => label => 'Components', url => '/components');
+ my $components = $tickets->child( components => label => 'Components', url => '/components');
my $items = $self->server->app_handle->setting( label => 'components' )->get();
foreach my $item (@$items) {
$components->child( $item => label => $item, url => '/component/'.$item);
}
- $self->server->nav->child( create => label => 'New issue', url => '/issue/new');
+ $self->server->nav->child( create => label => 'New ticket', url => '/issue/new');
$self->server->nav->child( home => label => 'Home', url => '/');
@@ -46,7 +46,7 @@
under 'POST' => sub {
on 'records' => sub { next_rule;};
- on qr'^POST/issue/([\w\d-]+)/edit$' => sub { shift->server->_send_redirect( to => '/issue/' . $1 ); };
+ on qr'^POST/ticket/([\w\d-]+)/edit$' => sub { shift->server->_send_redirect( to => '/issue/' . $1 ); };
on qr'^POST/(.*)$' => sub { shift->server->_send_redirect( to => $1 ); }
};
@@ -58,19 +58,19 @@
shift->show_template( $name => $type );
};
- under 'issue' => sub {
+ under 'ticket' => sub {
on '' => sub {
my $self = shift;
if ( my $id = $self->server->cgi->param('id') ) {
- $self->server->_send_redirect( to => "/issue/$id" );
+ $self->server->_send_redirect( to => "/ticket/$id" );
} else {
next_rule;
}
};
- on 'new' => sub { shift->show_template('new_issue') };
- on qr'^([\w\d-]+)/edit$' => sub { shift->show_template( 'edit_issue', $1 ) };
- on qr'^([\w\d-]+)/?$' => sub { shift->show_template( 'show_issue', $1 ) };
+ on 'new' => sub { shift->show_template('new_ticket') };
+ on qr'^([\w\d-]+)/edit$' => sub { shift->show_template( 'edit_ticket', $1 ) };
+ on qr'^([\w\d-]+)/?$' => sub { shift->show_template( 'show_ticket', $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 Jan 2 19:57:55 2009
@@ -51,18 +51,18 @@
padding-top: 0.5em;
}
-div.issue_list ul {
+div.ticket_list ul {
list-style-type:none;
}
-div.issue_list ul li {
+div.ticket_list ul li {
clear: both;
padding-bottom: 2em;
border-bottom: 1px solid #ccc;
margin-bottom: 1em;
}
-div.issue_list ul li span {
+div.ticket_list ul li span {
float: left;
padding: 0.2em;
}
@@ -82,22 +82,22 @@
background: #ccc;
}
-ul.issue_list {
+ul.ticket_list {
border: 1px solid grey;
-moz-border-radius: 0.5em;
-webkit-botder-radius: 0.5em;
}
-div.issue_list ul li span.summary {
+div.ticket_list ul li span.summary {
width: 70%;
}
-div.issue_list ul li span.issue-link {
+div.ticket_list ul li span.issue-link {
width: 2em;
text-align: right;
}
-div.issue_list ul li span.status {
+div.ticket_list ul li span.status {
width: 3em;
}
@@ -187,9 +187,9 @@
' );
};
-template '/' => page {'Open issues'}
+template '/' => page {'Open tickets'}
content {
- show('/issues/open');
+ show('/tickets/open');
};
@@ -223,9 +223,9 @@
my $self = shift;
my $component = shift;
- h2 {'Open issues for this component'};
+ h2 {'Open tickets for this component'};
- $self->show_issues(
+ $self->show_tickets(
sub {my $item = shift;
( ( $item->prop('component') || '' ) eq $component && $item->has_active_status )
? 1
@@ -240,9 +240,9 @@
my $self = shift;
my $milestone = shift;
- h2 {'Open issues for this milestone'};
+ h2 {'Open tickets for this milestone'};
- $self->show_issues(
+ $self->show_tickets(
sub {my $item = shift;
( ( $item->prop('milestone') || '' ) eq ($milestone || '') && $item->has_active_status )
? 1
@@ -252,50 +252,50 @@
};
-sub show_issues {
+sub show_tickets {
my $self = shift;
my $callback = shift;
- my $issues = App::SD::Collection::Ticket->new(
+ my $tickets = App::SD::Collection::Ticket->new(
app_handle => $self->app_handle,
handle => $self->app_handle->handle
);
- $issues->matching($callback);
- show( '/issue_list', $issues );
+ $tickets->matching($callback);
+ show( '/ticket_list', $issues );
}
-template edit_issue => page {
+template edit_ticket => page {
my $self = shift;
my $id = shift;
- my $issue = App::SD::Model::Ticket->new(
+ my $ticket = App::SD::Model::Ticket->new(
app_handle => $self->app_handle,
handle => $self->app_handle->handle
);
- $issue->load(($id =~ /^\d+$/ ? 'luid' : 'uuid') =>$id);
+ $ticket->load(($id =~ /^\d+$/ ? 'luid' : 'uuid') =>$id);
- $issue->luid.": ".$issue->prop('summary');
+ $ticket->luid.": ".$issue->prop('summary');
} content {
my $self = shift;
my $id = shift;
- my $issue = App::SD::Model::Ticket->new(
+ my $ticket = App::SD::Model::Ticket->new(
app_handle => $self->app_handle,
handle => $self->app_handle->handle
);
- $issue->load(($id =~ /^\d+$/ ? 'luid' : 'uuid') =>$id);
+ $ticket->load(($id =~ /^\d+$/ ? 'luid' : 'uuid') =>$id);
- title is $issue->luid.": ".$issue->prop('summary');
+ title is $ticket->luid.": ".$issue->prop('summary');
ul { {class is 'actions'};
- li { a {{ href is '/issue/'.$issue->uuid.''}; 'Show'}; };
+ li { a {{ href is '/ticket/'.$issue->uuid.''}; 'Show'}; };
};
form {
my $f = function(
- record => $issue,
+ record => $ticket,
action => 'update',
order => 1,
name => 'edit-ticket'
@@ -330,7 +330,7 @@
input { attr { label => 'save', type => 'submit' } };
};
};
-template new_issue => page {'Create a new ticket'} content {
+template new_ticket => page {'Create a new ticket'} content {
my $self = shift;
form { { class is 'create-ticket'};
@@ -395,15 +395,15 @@
};
-template '/issues/open' => sub {
+template '/tickets/open' => sub {
my $self = shift;
- $self->show_issues (sub { my $item = shift; return $item->has_active_status ? 1 : 0; });
+ $self->show_tickets (sub { my $item = shift; return $item->has_active_status ? 1 : 0; });
};
-private template 'issue_list' => sub {
+private template 'ticket_list' => sub {
my $self = shift;
- my $issues = shift;
+ my $tickets = shift;
my $id = substr(rand(10),2); # hack to get a unique id
table {
{ class is 'tablesorter'; id is $id; };
@@ -416,13 +416,13 @@
}
};
tbody {
- for my $issue (@$issues) {
+ for my $ticket (@$issues) {
row {
- cell { issue_link( $issue => $issue->luid );};
- cell{ class is 'status'; $issue->prop('status') };
- cell { class is 'summary'; $issue->prop('summary') };
- cell { class is 'created'; $issue->prop('created') };
+ cell { ticket_link( $issue => $issue->luid );};
+ cell{ class is 'status'; $ticket->prop('status') };
+ cell { class is 'summary'; $ticket->prop('summary') };
+ cell { class is 'created'; $ticket->prop('created') };
}
@@ -436,32 +436,32 @@
};
-template 'show_issue' => page {
+template 'show_ticket' => page {
my $self = shift;
my $id = shift;
- my $issue = App::SD::Model::Ticket->new(
+ my $ticket = App::SD::Model::Ticket->new(
app_handle => $self->app_handle,
handle => $self->app_handle->handle
);
- $issue->load(($id =~ /^\d+$/ ? 'luid' : 'uuid') =>$id);
+ $ticket->load(($id =~ /^\d+$/ ? 'luid' : 'uuid') =>$id);
- $issue->luid.": ".$issue->prop('summary');
+ $ticket->luid.": ".$issue->prop('summary');
} content {
my $self = shift;
my $id = shift;
- my $issue = App::SD::Model::Ticket->new(
+ my $ticket = App::SD::Model::Ticket->new(
app_handle => $self->app_handle,
handle => $self->app_handle->handle
);
- $issue->load(($id =~ /^\d+$/ ? 'luid' : 'uuid') =>$id);
+ $ticket->load(($id =~ /^\d+$/ ? 'luid' : 'uuid') =>$id);
ul { {class is 'actions'};
- li { a {{ href is '/issue/'.$issue->uuid.'/edit'}; 'Edit'}; };
+ li { a {{ href is '/ticket/'.$issue->uuid.'/edit'}; 'Edit'}; };
};
- show issue_basics => $issue;
- show issue_attachments => $issue;
- show issue_comments => $issue;
- show issue_history => $issue;
+ show ticket_basics => $issue;
+ show ticket_attachments => $issue;
+ show ticket_comments => $issue;
+ show ticket_history => $issue;
};
@@ -469,11 +469,11 @@
sub _by_creation_date { $a->prop('created') cmp $b->prop('created') };
-private template 'issue_basics' => sub {
+private template 'ticket_basics' => sub {
my $self = shift;
- my $issue = shift;
- my $props = $issue->get_props;
- div { { class is 'issue-props'};
+ my $ticket = shift;
+ my $props = $ticket->get_props;
+ div { { class is 'ticket-props'};
for my $key (sort keys %$props) {
div { class is 'widget';
label{ $key };
@@ -484,28 +484,28 @@
}
};
};
-template issue_attachments => sub {
+template ticket_attachments => sub {
my $self = shift;
- my $issue = shift;
+ my $ticket = shift;
};
-template issue_history => sub {
+template ticket_history => sub {
my $self = shift;
- my $issue = shift;
+ my $ticket = shift;
h2 { 'History'};
ul {
- for my $changeset (sort {$a->created cmp $b->created} $issue->changesets) {
+ for my $changeset (sort {$a->created cmp $b->created} $ticket->changesets) {
li {
ul {
li { $changeset->created. " ". $changeset->creator };
li { $changeset->original_sequence_no. ' @ ' . $changeset->original_source_uuid };
for my $change ($changeset->changes) {
- next unless $change->record_uuid eq $issue->uuid;
+ next unless $change->record_uuid eq $ticket->uuid;
li {
ul {
map { li {$_->summary} } $change->prop_changes;
@@ -520,10 +520,10 @@
};
-template issue_comments => sub {
+template ticket_comments => sub {
my $self = shift;
- my $issue = shift;
- my @comments = sort @{ $issue->comments };
+ my $ticket = shift;
+ my @comments = sort @{ $ticket->comments };
if (@comments) {
h2 {'Comments'};
ul {
@@ -539,15 +539,15 @@
};
-sub issue_link {
- my $issue = shift;
+sub ticket_link {
+ my $ticket = shift;
my $label = shift;
span {
- class is 'issue-link';
+ class is 'ticket-link';
a {
{
- class is 'issue';
- href is '/issue/' . $issue->uuid;
+ class is 'ticket';
+ href is '/ticket/' . $issue->uuid;
};
$label;
}
Modified: sd/trunk/t/server.t
==============================================================================
--- sd/trunk/t/server.t (original)
+++ sd/trunk/t/server.t Fri Jan 2 19:57:55 2009
@@ -67,6 +67,12 @@
$ua->get_ok( url() );
like( $ua->content, qr/SD for Your SD Project/ );
+
+
+$ua->follow_link( text_regex => qr/New ticket/);
+$ua->content_contains ('Create a new ticket');
+
+
sub start_server {
my $server_cli = App::SD::CLI->new();
my $s = App::SD::Server->new();
More information about the Bps-public-commit
mailing list