[Bps-public-commit] App-Changeloggr branch, master, updated. bb42e1d6ebef0171c5215851058ab97c776c06b4
sartak at bestpractical.com
sartak at bestpractical.com
Wed May 27 12:47:47 EDT 2009
The branch, master has been updated
via bb42e1d6ebef0171c5215851058ab97c776c06b4 (commit)
via a21fe10f027880efd8a0f3df51d1864d41d86dcf (commit)
from 569ee94b3ee5f6ecc640151439067942a27e6399 (commit)
Summary of changes:
lib/App/Changeloggr/Model/Change.pm | 4 ++++
lib/App/Changeloggr/View.pm | 12 +++++++++++-
2 files changed, 15 insertions(+), 1 deletions(-)
- Log -----------------------------------------------------------------
commit a21fe10f027880efd8a0f3df51d1864d41d86dcf
Author: Shawn M Moore <sartak at gmail.com>
Date: Wed May 27 12:45:46 2009 -0400
Make the tag->id column the count+1
diff --git a/lib/App/Changeloggr/Model/Change.pm b/lib/App/Changeloggr/Model/Change.pm
index c6e905c..dbc1b57 100644
--- a/lib/App/Changeloggr/Model/Change.pm
+++ b/lib/App/Changeloggr/Model/Change.pm
@@ -141,6 +141,10 @@ sub prioritized_tags {
);
$tags->column(
+ column => 'id',
+ function => "count($votes.tag) + 1",
+ );
+ $tags->column(
column => 'text',
);
$tags->group_by(
commit bb42e1d6ebef0171c5215851058ab97c776c06b4
Author: Shawn M Moore <sartak at gmail.com>
Date: Wed May 27 12:46:41 2009 -0400
If a tag has votes, display them in the tag name
diff --git a/lib/App/Changeloggr/View.pm b/lib/App/Changeloggr/View.pm
index 511200d..dcb90c8 100644
--- a/lib/App/Changeloggr/View.pm
+++ b/lib/App/Changeloggr/View.pm
@@ -238,9 +238,19 @@ sub show_vote_form {
if ($valid_tags->count) {
while (my $valid_tag = $valid_tags->next) {
+ my $label;
+ # This is actually checking count+1, not id. It's count+1
+ # because id 0 (aka count 0) records are not loaded. :/
+ if ($valid_tag->id - 1 > 0) {
+ $label = _('%1 (%2)', $valid_tag->text, $valid_tag->id - 1);
+ }
+ else {
+ $label = $valid_tag->text;
+ }
+
$vote->button(
class => "vote",
- label => $valid_tag->text,
+ label => $label,
key_binding => $valid_tag->hotkey,
onclick => { submit => $vote, refresh_self => 1 },
arguments => { tag => $valid_tag->text },
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list