<%= form_for(@admin_post) do |f| %>

<%= ts("All news posts need a title and some content.") %>

<%= error_messages_for @admin_post %>
<%= ts("Post News") %>

<%= f.text_field :title, :title =>"title" %>

<%= allowed_html_instructions %>

<% use_tinymce %>

<%= f.text_area :content, :class => "mce-editor observe_textlength", :id => "content", :title =>"content" %>

<%= live_validation_for_field('content', :maximum_length => ArchiveConfig.CONTENT_MAX, :minimum_length => ArchiveConfig.CONTENT_MIN, :tooLongMessage => ts("We salute your ambition! But sadly the content must be less than %{max} letters long.", :max => ArchiveConfig.CONTENT_MAX.to_s), :tooShortMessage => ts("Brevity is the soul of wit, but your content does have to be at least %{min} letters long.", :min => ArchiveConfig.CONTENT_MIN.to_s), :failureMessage => ts("You need to post some content here.")) %> <%= generate_countdown_html("content", ArchiveConfig.CONTENT_MAX) %>
<%= ts("Set Preferences") %>

<%= ts("Set Preferences") %>

<%= f.label :tag_list, t(".tags.label") %>
<% if @admin_post.translated_post %>
    <% for tag in @admin_post.tags %>
  • <%= link_to tag.name, admin_posts_path(tag: tag.id), class: "tag" %>
  • <% end %>
<% else %> <%= f.text_field :tag_list, autocomplete_options("admin_post_tags") %>

<%= ts("Comma separated, %{max} characters per tag", max: ArchiveConfig.TAG_MAX) %>

<% end %>
<%= f.label :language_id, t(".language.label") %>
<%= f.label :translated_post_id, t(".translated_post.label") %>
<%= f.text_field :translated_post_id, autocomplete_options('admin_posts', title: ts('translation of'), data: { autocomplete_token_limit: 1 }) %> <% unless @admin_post.translated_post %>

<%= t(".translated_post.footnote_comment_permissions") %>

<%= t(".translated_post.footnote_tags") %>

<% end %>
<%= f.check_box :moderated_commenting_enabled %>
<%= f.label :moderated_commenting_enabled, t("comments.commentable.permissions.moderated_commenting.enable") %>
<%= t(".comment_permissions.label") %>
<% if @admin_post.translated_post %>

<%= t("comments.commentable.permissions.options.#{@admin_post.comment_permissions}") %>

<% else %>
<%= radio_button_list(f, :comment_permissions, [ [:enable_all, t("comments.commentable.permissions.options.enable_all")], [:disable_anon, t("comments.commentable.permissions.options.disable_anon")], [:disable_all, t("comments.commentable.permissions.options.disable_all")] ]) %>
<% end %>
<%= ts('Post') %>

<%= ts("Post") %>

<%= submit_tag ts('Post'), :name => 'post_button' %>

<% end %>