<% title "Edit Info: #{@info.title}" %> <% def can_edit? mod? && current_user.confirmed? end %>

Edit Info

<%= form_for @info do |f|%> <%= f.text_field :title, disabled: !can_edit? %> <%= render partial: "md_editor", locals: {name: "info[content]", content: @info.content, options: {disabled: !can_edit?}} %>

<%= f.submit "Update Info", class: "btn blue left", disabled: !can_edit? %>

<% end %>

<%= button_to "Delete Info", @info, method: "delete", data: {confirm: "Are you sure you want to delete this info page?"}, class: "btn red right", disabled: !can_edit? %>

<% if !current_user.confirmed? %> You must confirm your email before you can edit info pages. <% end %>