<%= error_messages_for 'article' %>
<div id="autosave"></div>
<div id="article_keywords_auto_complete" class="auto_complete"></div>
<ul class="admin">
  <li>
    <label for="article_title" class="block title"><%= _("Title")%></label>
    <%= text_field 'article', 'title', :class => 'large' %>
  </li>
  <li>
    <div style="float: right; width: 230px;">
      <label class="block content"><%= _("Categories") %></label>
      <div id="categories" style="height: 170px;">
        <%= checkboxes_from_collection(@categories, "id", "name", @selected) %>        
      </div>
      <p class="paginate r">
          <label for="article_allow_comments"><%= _("Allow comments") %>: </label>
          <%= check_box 'article', 'allow_comments'  %><br />
          <label for="article_allow_pings"><%= _("Allow trackbacks")%>: </label>
          <%= check_box 'article', 'allow_pings'  %><br />
          <label for="article_published"><%= _("Published")%>:</label>
          <%= check_box 'article', 'published'  %><br />
        <%= link_to_destroy_draft @article %>
        <input class="submit" type="submit" value="<%= _('Save as draft') %> &raquo;" name="article[draft]"/>&nbsp;
        <%= save( _("Publish") + " &raquo;") %><br />
        <%= link_to_destroy_with_profiles @article%>
      </p>
    </div>
    <div id="editor">
      <label for="article_body_and_extended" class="block content"><%= _("Content")%></label>
      <% unless current_user.editor == 2 -%>
        <script type="text/javascript">edToolbar('article_body_and_extended');</script>
      <% end -%>
      <%= t_textarea 'article', 'body_and_extended', {:height => '300', :class => 'medium'} %>
      <%= render_macros(@macros) unless current_user.editor == 2 %>
    </div>
  </li>
  <li>
    <label class="block content" for="article_keywords"><%= _("Tags") %></label>
    <%= text_field 'article', 'keywords', {:autocomplete => 'off', :class => 'large'} %>
    <%= auto_complete_field 'article_keywords', { :url => { :action => "auto_complete_for_article_keywords"}, :tokens => ','}%>
  </li>
</ul>

<ul class="admin">
  <li class="paginate l">
    <label class="block">
      <%= link_to_function _("Excerpt") + " (+/-)",update_page { |page| page.visual_effect(:toggle_blind, "excerpt", :duration => 0.2) } %>
    </label>
    <ul id="excerpt" <%= "style='display: none;'" if @article.excerpt.blank? %>>
      <li>
        <%= t_textarea 'article', 'excerpt', {:height => '150', :class => 'medium', :rows => '8'} %>
      </li>     
    </ul>
  </li>
    
  <li class="paginate l">
    <label class="block">
      <%= link_to_function _("Uploads") + " (+/-)",update_page { |page| page.visual_effect(:toggle_blind, "attachments", :duration => 0.2) } %>
    </label>
    <ul id="attachments" <%= 'style="display: none"' unless @article.resources.count > 0 %>>
      <li><small>Uploads will be displayed as attachments in your RSS feed, but won't appear in your articles.</small></li>
      <%= render :partial => 'admin/content/attachment', :locals => { :attachment_num => 1, :hidden => false } -%>
    </ul>
  </li>

  <li class="paginate l">
    <label class="block">
      <%= link_to_function _("Post settings") + " (+/-)",update_page { |page| page.visual_effect(:toggle_blind, "publishing_options", :duration => 0.2) } %>
    </label>
    <ul id="publishing_options" <%= "style='display: none;'" unless @article.published.blank? %>>
      <li>
        <label class="float"><%= _("Publish at")%>:</label>
        <%= datetime_select 'article', 'published_at', :include_blank => true  %>            
      </li>
      <li>
        <label for="article_permalink" class="float"><%= _("Permalink") %></label>
        <span id="permalink"><%= text_field 'article', 'permalink' %></span>
      </li>     
    </ul>
  </li>  
</ul>
<%= hidden_field_tag 'text_filter', this_blog.text_filter %>
