<% title "Edit Thread: #{@thread}" %>

Edit thread

<%= link_to @thread.forum.group, forumgroup_path(@thread.forum.group) %> → <%= link_to @thread.forum, @thread.forum %> → New thread <%= form_for @thread do |f|%> <% if mod? %> <% forums = [] Forum.all.sort_by{ |f| f.forumgroup.position || 0 }.each do |f| forums << ["#{f.forumgroup.name} → #{f.name}", f.id] end %> <% end %>
<%= f.label :sticky %> <%= f.check_box :sticky %>
<%= f.label :locked %> <%= f.check_box :locked %>
<%= f.label :forum_id, "Move thread" %><%= f.select :forum_id, forums %>
<%= f.text_field :title, placeholder: "Title" %> <%= render partial: "md_editor", locals: {name: "forumthread[content]", content: @thread.content, mini: false} %>

<%= f.submit "Update thread", class: "btn blue left" %>

<% end %> <%= button_to "Delete thread", @thread, :method => "delete", data: {confirm: "Delete thread & comments forever?"}, class: "btn red right" %>