<% title "Edit Thread: #{@thread}" %> <% forums = [] Forum.all.sort_by{ |f| f.forumgroup && f.forumgroup.position || 0 }.each do |f| forums << ["#{f.forumgroup.name} → #{f.name}", f.id] if f.forumgroup end labels = [["Label", nil]] Label.order(:name).each do |l| labels << [l.name, l.id] end %>

Edit Thread

<%= link_to @thread.forum.group, forumgroup_path(@thread.forum.group) %> → <%= link_to @thread.forum, @thread.forum %> → <%= link_to @thread, @thread %> → Edit thread <%= form_for @thread do |f|%> <% if mod? %> <% end %>
<%= f.check_box :sticky %> <%= f.label :sticky %>
<%= f.check_box :locked %> <%= f.label :locked %>
<%= f.label :forum_id, "Move thread" %> <%= f.select :forum_id, forums %>
<%= f.select :label_id, labels, {}, class: "auto-width", disabled: (@thread.locked? && !mod?) %>
<%= f.text_field :title, placeholder: "Title" %>
<%= render partial: "md_editor", locals: {name: "forumthread[content]", content: @thread.content} %>

<%= 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" %>