<%= error_messages_for("forum_topic") %>

<div id="form-content">
  <%= simple_form_for(forum_topic) do |f| %>
    <%= f.input :title %>

    <div class="input">
      <label for="forum_topic_category_id">Category</label>
      <%= forum_topic_category_select("forum_topic", "category_id") %>
    </div>

    <%= f.simple_fields_for :original_post do |pf| %>
      <% if !forum_topic.new_record? %>
        <%= hidden_field_tag "forum_topic[original_post_attributes][topic_id]", forum_topic.id %>
      <% end %>

      <%= dtext_field "forum_post", "body", :classes => "autocomplete-mentions", :input_name => "forum_topic[original_post_attributes][body]", :value => forum_topic.original_post.body, :input_id => "forum_post_body_for_#{forum_topic.original_post.id}", :preview_id => "dtext-preview-for-#{forum_topic.original_post.id}" %>
    <% end %>

    <% if CurrentUser.is_moderator? %>
      <%= f.input :min_level, :include_blank => false, :collection => available_min_user_levels %>
      <%= f.input :is_sticky, :label => "Sticky" %>
      <%= f.input :is_locked, :label => "Locked" %>
    <% end %>

    <%= f.button :submit, "Submit", :data => { :disable_with => "Submitting..." } %>
    <%= dtext_preview_button "forum_post", "body", :input_id => "forum_post_body_for_#{forum_topic.original_post.id}", :preview_id => "dtext-preview-for-#{forum_topic.original_post.id}" %>
  <% end %>
</div>
