This repository has been archived on 2024-08-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
redstoner.com/app/views/forumthreads/edit.html.erb
2014-06-16 00:05:09 +02:00

33 lines
1.2 KiB
Plaintext

<% title "Edit Thread: #{@thread}" %>
<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: "md_editor", locals: {name: "forumthread[content]", content: @thread.content, mini: false} %>
<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" %>
<div class="clear"></div>