<% if @article.text_coding == Article::CODING_HTML %> <%= render :partial => "javascripts/mce_full" %> <% end %>

Editing article

<%= form_for(@article) do |f| %> <% if @article.errors.any? %>

<%= pluralize(@article.errors.count, t(:error)) %> <%= t(:prohibited) %>

<% end %>

<%= f.label :title %>
<%= f.text_field :title %>

<% if cuser.admin? %>

<%= f.label :status %>
<%= f.select :status, @article.statuses.invert %>

<% end %>

<%= f.label :text_coding %>
<%= f.select :text_coding, @article.codings.invert %>

<%= f.label :category_id %>
<%= f.select :category_id, Category.ordered.collect{|c| ["#{c.domains[c.domain]} - #{c}", c.id]} %>

<%= f.label :text %>
<%= f.text_area :text, :rows => 30, :cols => 80 %>

<%= f.submit %>

<% end %>
<% unless @article.new_record? %>

Files

<%= render :partial => "data_files/list", :locals => {:files => @article.files} %> <% if @file && @file.can_create?(cuser) %>

New file

<%= form_for @file, :html => { :multipart => true } do |f| %>
    <% @file.errors.full_messages.each do |msg| %>
  • <%= msg %>
  • <% end %>
<%= f.hidden_field :directory_id %> <%= f.hidden_field :article_id %>

<%= f.file_field :name %> <%= f.submit 'Create' %>

<% end %>
<% end %>
<% end %>