diff --git a/app/controllers/my_profile/cms/text_html.rb b/app/controllers/my_profile/cms/text_html.rb
index 0321d87..67b3d82 100644
--- a/app/controllers/my_profile/cms/text_html.rb
+++ b/app/controllers/my_profile/cms/text_html.rb
@@ -6,6 +6,7 @@ class CmsController
@article.parent = profile.articles.find(params[:parent_id])
end
@article.profile = profile
+ @article.last_changed_by = user
if request.post?
if @article.save
redirect_to :action => 'view', :id => @article.id
@@ -16,6 +17,7 @@ class CmsController
def text_html_edit
@article = Article.find(params[:id])
if request.post?
+ @article.last_changed_by = user
if @article.update_attributes(params[:article])
redirect_to :action => 'view', :id => @article.id
end
diff --git a/app/views/cms/view.rhtml b/app/views/cms/view.rhtml
index 1074021..93ea10a 100644
--- a/app/views/cms/view.rhtml
+++ b/app/views/cms/view.rhtml
@@ -51,7 +51,7 @@
-
- <%= _('"%{article}", last changed by %{author}') % { :article => @article.name, :author => 'bli' } %>
+ <%= _('"%{article}", last changed by %{author}') % { :article => @article.name, :author => (@article.last_changed_by.name || _('Unknown User')) } %>
-
<%= _('Public address of this article: %s') % (@article.public_path) %>
diff --git a/test/functional/cms_controller_test.rb b/test/functional/cms_controller_test.rb
index 0389140..d6752b3 100644
--- a/test/functional/cms_controller_test.rb
+++ b/test/functional/cms_controller_test.rb
@@ -53,6 +53,14 @@ class CmsControllerTest < Test::Unit::TestCase
flunk 'pending'
end
+ should 'set last_changed_by when creating article' do
+ flunk 'pending'
+ end
+
+ should 'set last_changed_by when updating article' do
+ flunk 'pending'
+ end
+
should 'list available editors' do
editors = [ "#{RAILS_ROOT}/app/controllers/my_profile/cms/bli.rb", "#{RAILS_ROOT}/app/controllers/my_profile/cms/blo.rb" ]
Dir.expects(:glob).with("#{RAILS_ROOT}/app/controllers/my_profile/cms/*.rb").returns(editors)
--
libgit2 0.21.2