28 lines
762 B
Elixir
28 lines
762 B
Elixir
<%= form_for @changeset, @action, fn f -> %>
|
|
<%= if @changeset.action do %>
|
|
<div class="alert alert-danger">
|
|
<p>oops, something went wrong! please check the errors below.</p>
|
|
</div>
|
|
<% IO.inspect @changeset %>
|
|
<% end %>
|
|
|
|
<%= hidden_input f, :user_id %>
|
|
|
|
<div class="form-group">
|
|
<%= label f, :name, "thread title" %>
|
|
<%= text_input f, :name, placeholder: "my cool new thread", class: "form-control", autofocus: true %>
|
|
<%= error_tag f, :name %>
|
|
</div>
|
|
|
|
<%= if Util.is_sudoer?(@conn) do %>
|
|
<div class="form-group">
|
|
<%= label f, :sticky, "sticky thread?" %>
|
|
<%= checkbox f, :sticky %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<div class="form-group">
|
|
<%= submit "save", class: "btn btn-primary" %>
|
|
</div>
|
|
<% end %>
|