<% if @article.errors.any? %>

<%= pluralize(@article.errors.count, "error") %> prohibited this article from being saved:

x
<% end %> <%= form_for([:admin, @article], id: 'article_form') do |f| %>
<%= f.file_field :hero_image %> <%= f.hidden_field :remove_hero_image %>
<%= t('lines.buttons.change') %>
<% if @article.short_hero_image.present? %> <% elsif @article.hero_image? %> <% end %> <%= f.hidden_field :hero_image_file %>

<%= t('lines.buttons.select_hero_image') %>

"><%= t('lines.buttons.remove_hero_image') %>
<%= f.label :hero_image, t('lines.buttons.upload_image') %>
<% Lines::Article::HERO_IMAGES.each_with_index do |h, i| %> " alt="" class="<%= 'selected-hero-image' if ('/heroes/' + h) == @article.short_hero_image %>" /> <% end %> <%= f.hidden_field :short_hero_image, class: "short-hero-image-cache" %>
<%= f.text_field :title, placeholder: true, class: 'title' %>
<%= f.text_field :sub_title, placeholder: true %>
<%= f.text_area :teaser, placeholder: true, rows: 1 %>
<%= f.text_area :content, placeholder: true, rows: 1, data: {editor: "codemirror"} %>
<%= f.label :document, "#{@article.document? ? @article.document.file.filename + ' (' + number_to_human_size(File.size(@article.document.file.file)) + ')' : t('lines.buttons.attach_document').html_safe }".html_safe, class: "attachment-label", title: t('lines.buttons.change_attachment').html_safe -%> <% if @article.document? %> <% end %> <%= f.file_field :document, class: "article-document-value" %>

<%= t('activerecord.models.lines/author', count: 2) %> *

<%= f.collection_check_boxes(:author_ids, Lines::Author.all, :id, :name) %>

<%= t('lines.additional_info').html_safe %>

<%= f.autocomplete_field :tag_list, autocomplete_tag_name_admin_articles_path, :"data-delimiter" => ', ', placeholder: "Tags" %>
<%= f.text_field :gplus_url, placeholder: true %>
<%= f.text_field :published_at, value: (@article.published_at || Time.now).strftime("%Y-%m-%d"), 'data-behaviour' => 'datepicker', placeholder: "Published on" %>
<%= render_navbar do %> <%= f.submit t('lines.buttons.save_article').html_safe, class: "btn btn-save-publish highlight" %> <%= link_to t('lines.buttons.cancel').html_safe, admin_articles_path, class: "btn btn-cancel" %> <% end %>
<% end %>