ref: master
app/views/box_organizer/_article_block.html.erb
<% if @block.owner.kind_of?(Environment) and @block.owner.portal_community.nil? %><%= _("You don't have an community defined as the portal community. Define it before use this block properly.") %>
<% else %> <% articles = @block.available_articles.select {|a| !a.folder? || a.blog? } first_text = articles[articles.find_index{|a| a.kind_of? TextArticle}||-1] selected = @block.article || first_text %> <%= select_tag( 'block[article_id]', options_for_select_with_title(articles.map {|item| [item.path, item.id]}, selected.id), :onchange => 'this.changedTo(this.value)' )%> <%= labelled_form_field( _('How to display this content:'), select_tag( 'block[visualization_format]', options_for_select([[_('Lead'), 'short'], [_('Full post'), 'full']], @block.visualization_format) ) )%> <% blogs = @block.available_articles.select{|a|a.blog?} %> <% end %>