diff --git a/plugins/display_content/lib/display_content_block.rb b/plugins/display_content/lib/display_content_block.rb index 228e71d..a5fb92b 100644 --- a/plugins/display_content/lib/display_content_block.rb +++ b/plugins/display_content/lib/display_content_block.rb @@ -26,6 +26,8 @@ class DisplayContentBlock < Block {:name => _('Tags'), :checked => false}] settings_items :display_folder_children, :type => :boolean, :default => true + attr_accessible :sections, :checked_nodes, :display_folder_children + def self.description _('Display your contents') end @@ -66,7 +68,8 @@ class DisplayContentBlock < Block holder.articles.find(:all, :conditions => {:type => VALID_CONTENT, :parent_id => (parent.nil? ? nil : parent)}) end - include ActionController::UrlWriter + include ActionView::Helpers + include Rails.application.routes.url_helpers def content(args={}) extra_condition = display_folder_children ? 'OR articles.parent_id IN(:nodes)':'' docs = nodes.blank? ? [] : owner.articles.find(:all, :conditions => ["(articles.id IN(:nodes) #{extra_condition}) AND articles.type IN(:types)", {:nodes => self.nodes, :types => VALID_CONTENT}]) diff --git a/plugins/display_content/test/functional/display_content_plugin_admin_controller_test.rb b/plugins/display_content/test/functional/display_content_plugin_admin_controller_test.rb index faea36c..711dcec 100644 --- a/plugins/display_content/test/functional/display_content_plugin_admin_controller_test.rb +++ b/plugins/display_content/test/functional/display_content_plugin_admin_controller_test.rb @@ -20,8 +20,7 @@ class DisplayContentPluginAdminControllerTest < ActionController::TestCase @environment.portal_community = fast_create(Community, :name => 'my test profile', :identifier => 'mytestcommunity') @environment.save! - box = Box.new(:owner => @environment, :position => 1) - box.save + box = create(Box, :owner => @environment, :position => 1) DisplayContentBlock.delete_all @block = DisplayContentBlock.new diff --git a/plugins/display_content/views/box_organizer/_display_content_block.html.erb b/plugins/display_content/views/box_organizer/_display_content_block.html.erb new file mode 100644 index 0000000..e096175 --- /dev/null +++ b/plugins/display_content/views/box_organizer/_display_content_block.html.erb @@ -0,0 +1,47 @@ +
+ +

<%= _('Choose which attributes should be displayed and drag to reorder them:') %>

+ + + + <% for section in @block.sections do %> + + + + + <% end %> + +
<%= hidden_field_tag 'block[sections][][name]', section[:name] %> <%= check_box_tag 'block[sections][][checked]', section[:name], section[:checked] %><%= section[:name]%>
+ +

<%= _('Choose which content should be displayed:') %>

+
+
+ +
+ <%= labelled_form_field check_box(:block, :display_folder_children) + _('Dinamically load children of selected folders'), '' %> +
+ + +
diff --git a/plugins/display_content/views/box_organizer/_display_content_block.rhtml b/plugins/display_content/views/box_organizer/_display_content_block.rhtml deleted file mode 100644 index e096175..0000000 --- a/plugins/display_content/views/box_organizer/_display_content_block.rhtml +++ /dev/null @@ -1,47 +0,0 @@ -
- -

<%= _('Choose which attributes should be displayed and drag to reorder them:') %>

- - - - <% for section in @block.sections do %> - - - - - <% end %> - -
<%= hidden_field_tag 'block[sections][][name]', section[:name] %> <%= check_box_tag 'block[sections][][checked]', section[:name], section[:checked] %><%= section[:name]%>
- -

<%= _('Choose which content should be displayed:') %>

-
-
- -
- <%= labelled_form_field check_box(:block, :display_folder_children) + _('Dinamically load children of selected folders'), '' %> -
- - -
-- libgit2 0.21.2