[Jifty-commit] r1033 - in wifty: . trunk/etc trunk/share/web/templates

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed May 10 18:14:10 EDT 2006


Author: nelhage
Date: Wed May 10 18:14:08 2006
New Revision: 1033

Modified:
   wifty/   (props changed)
   wifty/trunk/etc/config.yml
   wifty/trunk/lib/Wifty/Model/Page.pm
   wifty/trunk/lib/Wifty/Model/Revision.pm
   wifty/trunk/share/web/templates/history
   wifty/trunk/share/web/templates/recent

Log:
 r1381 at phanatique:  nelhage | 2006-05-10 18:13:50 -0400
 Fixing the saving of updated_by by Wifty, and keeping track of
 revisions' authors.


Modified: wifty/trunk/etc/config.yml
==============================================================================
--- wifty/trunk/etc/config.yml	(original)
+++ wifty/trunk/etc/config.yml	Wed May 10 18:14:08 2006
@@ -6,7 +6,7 @@
     Driver: SQLite
     Host: localhost
     User: postgres
-    Version: 0.0.19
+    Version: 0.0.20
     Password: ''
     RequireSSL: 0
 #  Mailer: IO

Modified: wifty/trunk/lib/Wifty/Model/Page.pm
==============================================================================
--- wifty/trunk/lib/Wifty/Model/Page.pm	(original)
+++ wifty/trunk/lib/Wifty/Model/Page.pm	Wed May 10 18:14:08 2006
@@ -99,9 +99,9 @@
 
     my $rev = Wifty::Model::Revision->new( current_user => Wifty::CurrentUser->superuser);
     $rev->create(
-        page    => $self->id,
-        content => $args{'content'},
-        # by      => $args{'updated_by'}
+        page			=> $self->id,
+        content			=> $args{'content'},
+        created_by      => $args{'updated_by'}
     );
 
 }
@@ -127,9 +127,7 @@
 
     $self->SUPER::_set(
         column => 'updated_by',
-        value  => 
-                    ( $self->current_user? $self->current_user->user_object : undef )
-        
+        value  => ( $self->current_user? $self->current_user->user_object->id : undef )
     );
 
     return ( $val, $msg );
@@ -138,7 +136,7 @@
 
 =head2 current_user_can ACTION
 
-Let everybody create, read and update pages, but not delete the.
+Let everybody create, read and update pages, but not delete them.
 
 =cut
 

Modified: wifty/trunk/lib/Wifty/Model/Revision.pm
==============================================================================
--- wifty/trunk/lib/Wifty/Model/Revision.pm	(original)
+++ wifty/trunk/lib/Wifty/Model/Revision.pm	Wed May 10 18:14:08 2006
@@ -7,7 +7,7 @@
 
 column created => type is 'timestamp';
 
-#column by => refers_to Wifty::Model::User, since '0.0.18';
+column created_by => refers_to Wifty::Model::User, since '0.0.20';
 
 
 package Wifty::Model::Revision;

Modified: wifty/trunk/share/web/templates/history
==============================================================================
--- wifty/trunk/share/web/templates/history	(original)
+++ wifty/trunk/share/web/templates/history	Wed May 10 18:14:08 2006
@@ -8,7 +8,13 @@
 % while (my $rev = $revisions->next) {
 <dt><% Jifty->web->link( label => $rev->created, 
                           url => '/view/'.$page->name.'/'.$rev->id
-                        ) %></dt>
+                        ) %>
+% if($rev->created_by) {
+  (<% $rev->created_by->name %>)
+% } else {
+  (Anonymous)
+% }
+</dt>
 <dd><%length($rev->content)%> bytes</dd>
 % }
 </ul>

Modified: wifty/trunk/share/web/templates/recent
==============================================================================
--- wifty/trunk/share/web/templates/recent	(original)
+++ wifty/trunk/share/web/templates/recent	Wed May 10 18:14:08 2006
@@ -5,7 +5,13 @@
 <dl id="recentudates">
 % while (my $page = $pages->next) {
 <dt><% Jifty->web->link( label => $page->name, url => '/view/'.$page->name)%></dt>
-<dd><%$page->updated%></dd>
-% } 
+<dd><%$page->updated%>
+% if($page->updated_by) {
+  (<% $page->updated_by->name %>)
+% } else {
+  (Anonymous)
+% }
+</dd>
+% }
 </dl>
 </&>


More information about the Jifty-commit mailing list