cirandas.net

ref: master

app/views/shared/_lead_and_body.html.erb


<% object ||= :article %>
<% abstract_label ||= 'Lead' %>
<% abstract_method ||= :abstract %>
<% body_label ||= 'Text' %>
<% body_method ||= :body %>
<% editor_type = current_editor %>
<% lead_id ||= 0%>
<% f ||= false%>

<% if @article %>
  <%# fields_for 'article[image_builder]', @article.image do |i| %>
    <%# file_field_or_thumbnail(_('Image:'), @article.image, i) %>
  <%# end %>
<% end %>


<%= button :add, _("Lead"), '#', :class => "lead-button", :article_id => "#article-lead-"+lead_id.to_s, :style => "margin-left: 0px;" %> <%= _('Used when a short version of your text is needed.') %>
<% abstract_options = {:style => 'width: 100%; height: 200px;', :class => editor_type} %> <% if f %> <%= labelled_form_field(_(abstract_label), f.text_area(abstract_method, abstract_options)) %> <% else %> <%= labelled_form_field(_(abstract_label), text_area(object, abstract_method, abstract_options)) %> <% end %>
<% body_options = {:style => 'width: 100%; height: 400px;', :class => editor_type} %> <% if f %> <%= labelled_form_field(_(body_label), f.text_area(body_method, body_options)) %> <% else %> <%= labelled_form_field(_(body_label), text_area(object, body_method, body_options)) %> <% end %>
<%= javascript_include_tag 'article-lead-and-body'%>