% if @article.text_coding == Article::CODING_HTML %>
<%= render partial: "javascripts/mce_full" %>
<% end %>
Editing Article
<%= form_for(@article, html: { class: 'article square' }) do |f| %>
<%= render 'shared/errors', messages: @article.errors.full_messages %>
<%= 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]} %>
Content
<%= 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| %>
<%= render 'shared/errors', messages: @file.errors.full_messages %>
<%= f.hidden_field :directory_id %>
<%= f.hidden_field :article_id %>
<%= f.file_field :name %>
<%= f.submit 'Create' %>
<% end %>
<% end %>
<% end %>