edit.rhtml 1.84 KB
<%= error_messages_for 'article' %>

<div class='<%= (environment.enabled?('media_panel') ? 'with_media_panel' : 'no_media_panel') %>'>
<% labelled_form_for 'article', @article, :html => { :multipart => true, :class => @type } do |f| %>

  <%= hidden_field_tag("type", @type) if @type %>

  <%= hidden_field_tag('parent_id', @parent_id) if @parent_id %>

  <%= hidden_field_tag('back_to', @back_to) %>

  <%= render :partial => partial_for_class(@article.class), :locals => { :f => f } %>

  <% if environment.is_portal_community?(profile) %>
    <div>
      <%= check_box(:article, :highlighted) %>
      <label for="article_highlighted"><%= _('Highlight this article')%></label>
    </div>
  <% end %>

  <% button_bar do %>
    <%= submit_button :save, _('Save') %>
    <%= submit_button :save, _('Save and continue'), :name => "continue" %>
  <% end %>

  <div style='float: right'>
    <%= lightbox_button :help, _('Why categorize?'), :action => 'why_categorize' %>
  </div>

  <%= select_categories(:article, _('Categorize your article')) %>

  <%= f.text_field('tag_list', :size => 64) %>
  <%= content_tag( 'small', _('Separate tags with commas') ) %>

  <div id='edit-article-options'>
    <%= options_for_article(@article) %>
  </div>

  <% button_bar do %>
    <%= submit_button :save, _('Save') %>
    <% if @back_to %>
      <%= button :cancel, _('Cancel'), @back_to %>
    <% elsif @parent_id || @article.parent %>
      <%= button :cancel, _('Cancel'), :action => 'view', :id => @parent_id || @article.parent %>
    <% else %>
      <%= button :cancel, _('Cancel'), :action => 'index' %>
    <% end %>
  <% end %>
<% end %>
</div>

<% if environment.enabled?('media_panel') && [TinyMceArticle, TextileArticle, Event, EnterpriseHomepage].any?{|klass| @article.kind_of?(klass)} %>
  <%= render :partial => 'text_editor_sidebar' %>
<% end %>

<br style='clear: both'/>