summaryrefslogtreecommitdiff
path: root/app/views/forumthreads/new.html.erb
blob: 2e1d7e08dcd80084e393cb37f1e007fee5883a60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<% title "New Thread: #{@thread.forum.name}" %>

<%
  labels = [["Label", nil]]
  Label.order(:name).each do |l|
    labels << [l.name, l.id]
  end
%>

<%= link_to @thread.forum.group, forumgroup_path(@thread.forum.group) %> → <%= link_to @thread.forum, @thread.forum %> → New thread
<h1>New thread</h1>
<%= 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>
    <% end %>
  </table>
  <div class="table-cell">
    <%= f.select :label_id, labels, {}, class: "auto-width" %>
  </div>
  <div class="table-cell full-width">
    <%= f.text_field :title, placeholder: "Title" %>
  </div>
  <%= render partial: "md_editor", locals: {name: "forumthread[content]", content: @thread.content} %>
  <%= f.hidden_field :forum_id %>
  <p><%= f.submit "Create thread", class: "btn blue left" %></p>
  <div class="clear"></div>
<% end %>