diff --git a/plugins/recent_content/features/add_recent_content.feature b/plugins/recent_content/features/add_recent_content.feature index 730bd3a..cf87137 100644 --- a/plugins/recent_content/features/add_recent_content.feature +++ b/plugins/recent_content/features/add_recent_content.feature @@ -13,6 +13,9 @@ Background: And the following blocks | owner | type | | joaosilva | RecentContentBlock | + And the following blogs + | owner | name | + | joaosilva | JSilva blog | And the following articles | owner | parent | name | body | abstract | | joaosilva | JSilva blog | post #1 | Primeiro post do joao silva | Resumo 1 | diff --git a/plugins/recent_content/lib/recent_content_block.rb b/plugins/recent_content/lib/recent_content_block.rb index 200a9ca..d7a1ce7 100644 --- a/plugins/recent_content/lib/recent_content_block.rb +++ b/plugins/recent_content/lib/recent_content_block.rb @@ -5,6 +5,8 @@ class RecentContentBlock < Block settings_items :show_blog_picture, :type => :boolean, :default => false settings_items :selected_folder, :type => Integer + attr_accessible :presentation_mode, :total_items, :show_blog_picture, :selected_folder + VALID_CONTENT = ['RawHTMLArticle', 'TextArticle', 'TextileArticle', 'TinyMceArticle'] def self.description @@ -41,12 +43,11 @@ class RecentContentBlock < Block end end - include ActionController::UrlWriter include DatesHelper def content(args={}) block = self - lambda do + proc do render :file => 'blocks/recent_content_block', :locals => {:root => block.root, :block => block} end end diff --git a/plugins/recent_content/views/blocks/recent_content_block.html.erb b/plugins/recent_content/views/blocks/recent_content_block.html.erb new file mode 100644 index 0000000..8668d64 --- /dev/null +++ b/plugins/recent_content/views/blocks/recent_content_block.html.erb @@ -0,0 +1,45 @@ +<% unless root.nil? %> +
<%= link_to(_('Read more'), item.url) %>
+ <% end %> +<%= link_to(_('Read more'), item.url) %>
+ <% end %> +<%= link_to(_('Read more'), item.url) %>
- <% end %> -<%= link_to(_('Read more'), item.url) %>
- <% end %> -