[Bps-public-commit] App-Changeloggr branch, master, updated. 3417fdc70840964ab012e90776d4a67307b20666

sartak at bestpractical.com sartak at bestpractical.com
Thu Aug 13 21:56:09 EDT 2009


The branch, master has been updated
       via  3417fdc70840964ab012e90776d4a67307b20666 (commit)
       via  d320a734b2ae5446ddc4a781510b554ab05d30c8 (commit)
       via  2b9bb341b848004d411365d3f15017aeed751d21 (commit)
       via  1e444455920a3cbc1f1bc11345102808a3cd8e33 (commit)
      from  20a2a7d43539e5b5a553fab9c221e8486ee004c5 (commit)

Summary of changes:
 lib/App/Changeloggr/Model/Changelog.pm |    7 +++-
 lib/App/Changeloggr/View.pm            |   54 +++++++++++++++++++++++++++++---
 2 files changed, 54 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit 1e444455920a3cbc1f1bc11345102808a3cd8e33
Author: Shawn M Moore <sartak at gmail.com>
Date:   Thu Aug 13 21:54:05 2009 -0400

    If we have a change argument, use it

diff --git a/lib/App/Changeloggr/View.pm b/lib/App/Changeloggr/View.pm
index f2aef90..b200828 100644
--- a/lib/App/Changeloggr/View.pm
+++ b/lib/App/Changeloggr/View.pm
@@ -107,8 +107,18 @@ template '/changelog/download' => sub {
 };
 
 template '/vote-on-change' => sub {
-    my $changelog = M('Changelog', id => get('changelog'));
-    my $change = $changelog->choose_change;
+    my $change;
+    my $changelog;
+
+    if (get('change')) {
+        $change = M('Change', id => get('change'));
+        $changelog = $change->changelog;
+    }
+    else {
+        $changelog = M('Changelog', id => get('changelog'));
+        $change = $changelog->choose_change;
+    }
+
     if ($change) {
         show_change($change);
     } else {

commit 2b9bb341b848004d411365d3f15017aeed751d21
Author: Shawn M Moore <sartak at gmail.com>
Date:   Thu Aug 13 21:54:15 2009 -0400

    If we have a next change, preload it

diff --git a/lib/App/Changeloggr/View.pm b/lib/App/Changeloggr/View.pm
index b200828..edc1be8 100644
--- a/lib/App/Changeloggr/View.pm
+++ b/lib/App/Changeloggr/View.pm
@@ -315,6 +315,7 @@ sub show_vote_form {
     my $change = shift;
     my $changelog = $change->changelog;
     my $valid_tags = $change->prioritized_tags;
+    my $next_change = $changelog->choose_next_change;
 
     div {
         id is 'vote_buttons';
@@ -336,7 +337,18 @@ sub show_vote_form {
                         form_submit(
                             label   => $label,
                             onclick     => [
-                                { submit => $vote, refresh_self => 1 },
+                                {
+                                    submit       => $vote,
+                                    refresh_self => 1,
+
+                                    # only preload if we have a next change
+                                    ($next_change && $next_change->id) ? (
+                                        preload      => 'forward',
+                                        arguments    => {
+                                            change => $next_change->id,
+                                        },
+                                    ) : (),
+                                },
                                 { refresh => 'score' },
                             ],
                         );
@@ -374,7 +386,18 @@ sub show_vote_form {
                                 key_binding => $valid_tag->hotkey,
                                 tooltip     => $valid_tag->tooltip,
                                 onclick     => [
-                                    { submit => $vote, refresh_self => 1 },
+                                    {
+                                        submit => $vote,
+                                        refresh_self => 1,
+
+                                        # only preload if we have a next change
+                                        ($next_change && $next_change->id) ? (
+                                            preload      => 'forward',
+                                            arguments    => {
+                                                change => $next_change->id,
+                                            },
+                                        ) : (),
+                                    },
                                     { refresh => 'score' },
                                 ],
                                 arguments   => { tag => $valid_tag->text },
@@ -396,7 +419,18 @@ sub show_vote_form {
                         class       => "vote",
                         label       => 'Skip this change',
                         onclick     => [
-                            { submit => $vote, refresh_self => 1 },
+                            {
+                                submit => $vote,
+                                refresh_self => 1,
+
+                                # only preload if we have a next change
+                                ($next_change && $next_change->id) ? (
+                                    preload      => 'forward',
+                                    arguments    => {
+                                        change => $next_change->id,
+                                    },
+                                ) : (),
+                            },
                             { refresh => 'score' },
                         ],
                         arguments   => { tag => '_skip' },

commit d320a734b2ae5446ddc4a781510b554ab05d30c8
Author: Shawn M Moore <sartak at gmail.com>
Date:   Thu Aug 13 21:55:11 2009 -0400

    If the changelog has no tags, then don't preload

diff --git a/lib/App/Changeloggr/Model/Changelog.pm b/lib/App/Changeloggr/Model/Changelog.pm
index c5b561a..ec1be7e 100644
--- a/lib/App/Changeloggr/Model/Changelog.pm
+++ b/lib/App/Changeloggr/Model/Changelog.pm
@@ -238,7 +238,10 @@ sub choose_next_change {
     my $change = $self->choose_change(1)
         or return;
 
-    $change->vote($self->tags->first->text);
+    my $tag = $self->tags->first
+        or return;
+
+    $change->vote($tag->text);
 
     my $next_change = $self->choose_change(1);
 

commit 3417fdc70840964ab012e90776d4a67307b20666
Author: Shawn M Moore <sartak at gmail.com>
Date:   Thu Aug 13 21:55:57 2009 -0400

    The method is force_rollback not rollback_transaction

diff --git a/lib/App/Changeloggr/Model/Changelog.pm b/lib/App/Changeloggr/Model/Changelog.pm
index ec1be7e..30a4c8c 100644
--- a/lib/App/Changeloggr/Model/Changelog.pm
+++ b/lib/App/Changeloggr/Model/Changelog.pm
@@ -245,7 +245,7 @@ sub choose_next_change {
 
     my $next_change = $self->choose_change(1);
 
-    Jifty->handle->rollback_transaction;
+    Jifty->handle->force_rollback;
 
     return $next_change;
 }

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list