[Bps-public-commit] App-Changeloggr branch, master, updated. 170c401bc914e72f42a067ed5f5255aa3faaee38
sartak at bestpractical.com
sartak at bestpractical.com
Thu Jul 30 16:27:28 EDT 2009
The branch, master has been updated
via 170c401bc914e72f42a067ed5f5255aa3faaee38 (commit)
via 164d83837eb00787c698bdcc307351e6ff0955d2 (commit)
from 31b00a5ac22c878c400ecac6094a7631d04d0902 (commit)
Summary of changes:
lib/App/Changeloggr/Model/Tag.pm | 1 -
lib/App/Changeloggr/View/Admin.pm | 59 +++++++++++++++++++++++++++++++++++--
2 files changed, 56 insertions(+), 4 deletions(-)
- Log -----------------------------------------------------------------
commit 164d83837eb00787c698bdcc307351e6ff0955d2
Author: Shawn M Moore <sartak at gmail.com>
Date: Thu Jul 30 16:25:20 2009 -0400
Tag text should be mutable
diff --git a/lib/App/Changeloggr/Model/Tag.pm b/lib/App/Changeloggr/Model/Tag.pm
index fbe3adc..e88264b 100644
--- a/lib/App/Changeloggr/Model/Tag.pm
+++ b/lib/App/Changeloggr/Model/Tag.pm
@@ -15,7 +15,6 @@ use App::Changeloggr::Record schema {
type is 'text',
label is 'Tag',
is mandatory,
- is immutable,
ajax canonicalizes;
column hotkey =>
commit 170c401bc914e72f42a067ed5f5255aa3faaee38
Author: Shawn M Moore <sartak at gmail.com>
Date: Thu Jul 30 16:27:24 2009 -0400
Tag updating
diff --git a/lib/App/Changeloggr/View/Admin.pm b/lib/App/Changeloggr/View/Admin.pm
index 0c829cf..c422dad 100644
--- a/lib/App/Changeloggr/View/Admin.pm
+++ b/lib/App/Changeloggr/View/Admin.pm
@@ -223,7 +223,7 @@ EOT
ul {
while (my $tag = $tags->next) {
li {
- edit_tag($tag);
+ display_tag($tag);
}
}
}
@@ -238,8 +238,25 @@ EOT
}
}
-sub edit_tag {
+sub display_tag {
my $tag = shift;
+ my $changelog = $tag->changelog;
+
+ render_region(
+ path => '/admin/changelog/tag/display/' . $changelog->admin_token,
+ name => 'tag_' . $tag->id,
+ arguments => {
+ tag => $tag->id,
+ },
+ );
+
+}
+
+template '/changelog/tag/display' => sub {
+ my $tag_id = get('tag');
+ my $tag = Tag($tag_id);
+
+ my $changelog = $tag->changelog;
my $delete_tag = $tag->as_delete_action;
render_action $delete_tag;
@@ -251,6 +268,15 @@ sub edit_tag {
"(hotkey: ".$tag->hotkey.")"
}
}
+
+ hyperlink(
+ label => _('Edit'),
+ as_button => 1,
+ onclick => {
+ replace_with => '/admin/changelog/tag/edit/' . $changelog->admin_token,
+ },
+ );
+
$delete_tag->button(label => "Delete", class => "inline delete");
my $tooltip = $tag->tooltip;
@@ -268,7 +294,34 @@ sub edit_tag {
}
}
}
-}
+};
+
+template '/changelog/tag/edit' => sub {
+ my $tag_id = get('tag');
+ my $tag = Tag($tag_id);
+ my $changelog = $tag->changelog;
+
+ my $update_tag = $tag->as_update_action;
+ render_action $update_tag;
+
+ $update_tag->button(
+ label => "Save",
+ class => "inline update",
+ onclick => {
+ submit => $update_tag,
+ replace_with => '/admin/changelog/tag/display/' . $changelog->admin_token,
+ },
+ );
+
+ hyperlink(
+ label => "Cancel",
+ class => "inline cancel",
+ as_button => 1,
+ onclick => {
+ replace_with => '/admin/changelog/tag/display/' . $changelog->admin_token,
+ },
+ );
+};
1;
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list