31 lines
1.1 KiB
Plaintext
31 lines
1.1 KiB
Plaintext
<h1>Edit thread</h1>
|
|
<%= link_to @thread.forum.group, forumgroup_path(@thread.forum.group) %> → <%= link_to @thread.forum, @thread.forum %> → New thread
|
|
<%= form_for @thread do |f|%>
|
|
<table>
|
|
<% if mod? %>
|
|
<tr>
|
|
<td><%= f.label :sticky %></td>
|
|
<td><%= f.check_box :sticky %></td>
|
|
</tr>
|
|
<tr>
|
|
<td><%= f.label :locked %></td>
|
|
<td><%= f.check_box :locked %></td>
|
|
</tr>
|
|
<tr>
|
|
<td><%= f.label :forum_id, "Move thread" %></td>
|
|
<%
|
|
forums = []
|
|
Forum.all.sort_by{ |f| f.forumgroup.position || 0 }.each do |f|
|
|
forums << ["#{f.forumgroup.name} → #{f.name}", f.id]
|
|
end
|
|
%>
|
|
<td><%= f.select :forum_id, forums %></td>
|
|
</tr>
|
|
<% end %>
|
|
</table>
|
|
<%= f.text_field :title, placeholder: "Title" %>
|
|
<%= render partial: "mdhelp" %>
|
|
<%= f.text_area :content, placeholder: "Text" %>
|
|
<p><%= f.submit "Update thread", class: "btn blue left" %></p>
|
|
<% end %>
|
|
<%= button_to "Delete thread", @thread, :method => "delete", data: {confirm: "Delete thread & comments forever?"}, class: "btn red right" %> |