diff --git a/plugins/recent_content/lib/recent_content_block.rb b/plugins/recent_content/lib/recent_content_block.rb index 66a02d7..a042b06 100644 --- a/plugins/recent_content/lib/recent_content_block.rb +++ b/plugins/recent_content/lib/recent_content_block.rb @@ -44,13 +44,6 @@ class RecentContentBlock < Block include DatesHelper - def content(args={}) - block = self - proc do - render :file => 'blocks/recent_content_block', :locals => {:root => block.root, :block => block} - end - end - def mode?(attr) attr == self.presentation_mode end diff --git a/plugins/recent_content/views/blocks/recent_content.html.erb b/plugins/recent_content/views/blocks/recent_content.html.erb new file mode 100644 index 0000000..33cf954 --- /dev/null +++ b/plugins/recent_content/views/blocks/recent_content.html.erb @@ -0,0 +1,45 @@ +<% unless block.root.nil? %> +
+ <% children = block.articles_of_folder(block.root, block.total_items)%> +
+ <%= block_title(block.title.blank? ? c_("Recent content") : block.title, block.subtitle ) %> + <% if block.show_blog_picture and !block.root.image.nil? %> +
+ <%= image_tag(block.root.image.public_filename(:big)) %> +
+ <% end %> +
+ <% if block.mode?('title_only') %> +
+ +
+ <% elsif block.mode?('title_and_abstract') %> +
+ <% children.each do |item| %> +

<%= link_to(item.title,item.url, :class => 'post-title')%>

+ +
<%=item.lead%>
+

<%= link_to(_('Read more'), item.url) %>

+ <% end %> +
+ <% else %> +
+ <% children.each do |item| %> +

<%= link_to(item.title,item.url, :class => 'post-title')%>

+ +
<%=item.body%>
+

<%= link_to(_('Read more'), item.url) %>

+ <% end %> +
+ <% end %> + <%= link_to _('View All'), :profile => profile.identifier, :controller => 'content_viewer', :action => 'view_page', :page => block.root.path %> +
+<% else %> + + <%= _('This is the recent content block. Please edit it to show the content you want.') %> + +<% 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 deleted file mode 100644 index 3ab5376..0000000 --- a/plugins/recent_content/views/blocks/recent_content_block.html.erb +++ /dev/null @@ -1,45 +0,0 @@ -<% unless root.nil? %> -
- <% children = block.articles_of_folder(root, block.total_items)%> -
- <%= block_title(block.title.blank? ? c_("Recent content") : block.title, block.subtitle ) %> - <% if block.show_blog_picture and !root.image.nil? %> -
- <%= image_tag(root.image.public_filename(:big)) %> -
- <% end %> -
- <% if block.mode?('title_only') %> -
- -
- <% elsif block.mode?('title_and_abstract') %> -
- <% children.each do |item| %> -

<%= link_to(item.title,item.url, :class => 'post-title')%>

- -
<%=item.lead%>
-

<%= link_to(_('Read more'), item.url) %>

- <% end %> -
- <% else %> -
- <% children.each do |item| %> -

<%= link_to(item.title,item.url, :class => 'post-title')%>

- -
<%=item.body%>
-

<%= link_to(_('Read more'), item.url) %>

- <% end %> -
- <% end %> - <%= link_to _('View All'), :profile => profile.identifier, :controller => 'content_viewer', :action => 'view_page', :page => block.root.path %> -
-<% else %> - - <%= _('This is the recent content block. Please edit it to show the content you want.') %> - -<% end %> -- libgit2 0.21.2