[Bps-public-commit] App-Changeloggr branch, master, updated. 5a0fa5ad6a44c5fb51dd1dda222adda8ad3c7aa2

sartak at bestpractical.com sartak at bestpractical.com
Mon Mar 30 15:22:15 EDT 2009


The branch, master has been updated
       via  5a0fa5ad6a44c5fb51dd1dda222adda8ad3c7aa2 (commit)
       via  b2448174418342aa55595f0ae7b04b1ae757ec06 (commit)
      from  caee82443328448ddc87835a53b99af502e36171 (commit)

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

- Log -----------------------------------------------------------------
commit b2448174418342aa55595f0ae7b04b1ae757ec06
Author: Shawn M Moore <sartak at gmail.com>
Date:   Mon Mar 30 15:20:23 2009 -0400

    Changelog->choose_change which chooses a good change to vote on

diff --git a/lib/App/Changeloggr/Model/Changelog.pm b/lib/App/Changeloggr/Model/Changelog.pm
index 762614b..496efa3 100644
--- a/lib/App/Changeloggr/Model/Changelog.pm
+++ b/lib/App/Changeloggr/Model/Changelog.pm
@@ -59,5 +59,14 @@ sub changes {
     return M('ChangeCollection', changelog => $self);
 }
 
+sub choose_change {
+    my $self = shift;
+
+    # This will become more advanced in the future, picking a change that
+    # the current user has not voted on yet, ordered by the confidence of the
+    # top tag. But for now.. an arbitrary change belonging to this changelog.
+    return M('Change', changelog => $self);
+}
+
 1;
 

commit 5a0fa5ad6a44c5fb51dd1dda222adda8ad3c7aa2
Author: Shawn M Moore <sartak at gmail.com>
Date:   Mon Mar 30 15:20:38 2009 -0400

    Begin sketching out the real UI for voting

diff --git a/lib/App/Changeloggr/View.pm b/lib/App/Changeloggr/View.pm
index 97564a2..da95f9e 100644
--- a/lib/App/Changeloggr/View.pm
+++ b/lib/App/Changeloggr/View.pm
@@ -34,8 +34,23 @@ template '/create-changelog' => page {
 
 template '/changelog' => page {
     my $changelog = Changelog(name => get('name'));
+
     h1 { $changelog->name };
-    show_changes_of($changelog);
+
+    render_region(
+        name => 'vote-on-change',
+        path => '/vote-on-change',
+        defaults => {
+            changelog => $changelog->id,
+        },
+    );
+};
+
+template '/vote-on-change' => sub {
+    my $changelog = M('Changelog', id => get('changelog'));
+    my $change = $changelog->choose_change;
+
+    show_change($change);
 };
 
 template '/changelog/admin' => page {
@@ -83,15 +98,10 @@ sub changelog_summary {
     );
 }
 
-sub show_changes_of {
-    my $changelog = shift;
-    my $changes = $changelog->changes;
+sub show_change {
+    my $change = shift;
 
-    ol {
-        while (my $change = $changes->next) {
-            li { $change->message }
-        }
-    }
+    h3 { $change->message }
 }
 
 1;

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



More information about the Bps-public-commit mailing list