summaryrefslogtreecommitdiff
path: root/app/views/info/new.html.erb
blob: dc50720b9080570f8342040cb5d12d22ee989655 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<% title "New Info" %>

<%
  def can_create?
    mod? && current_user.confirmed?
  end
%>

<h1>New Info</h1>
<%= form_for @info, url: info_index_path do |f|%>
  <%= f.text_field :title, placeholder: "Title", disabled: !can_create? %>
  <%= render partial: "md_editor", locals: {name: "info[content]", content: @info.content, options: {disabled: !can_create?}} %>
  <p><%= f.submit "Create Info", class: "btn blue left", disabled: !can_create? %></p>
  <div class="clear"></div>

  <% if !current_user.confirmed? %>
    <span class='red-alert'>You must confirm your email before you can create new info pages.</span>
  <% end %>
<% end %>