<% submit_url = (@forum.new_record? ? admin_forum_category_forums_path(@forum_category) : admin_forum_path) %> <%= simple_form_for @forum, url: submit_url, html: { class: 'form-horizontal' }, wrapper: :bs3_horizontal_form, wrapper_mappings: DmAdmin::FormWrapperMappings do |f| %> <%= f.error_notification message: "Please review the problems below" %> <% toolbar = capture do %> <%= link_to icons(:cancel), (@forum.new_record? ? admin_forum_category_path(@forum.forum_category) : admin_forum_path(@forum)), class: 'btn btn-link btn-icon' %> <% end %> <%= panel title: @title, toolbar: toolbar do %> <%= f.input :name, required: true, autofocus: true %> <%= f.input :slug, label: 'Slug', hint: 'Leave blank to have auto-generated based on title.' %> <%= f.input :description, as: :text, label: 'Description', input_html: { rows: 4, class: 'input-block-level' } %> <%= f.input :published, as: :toggle, label: 'Publish It?' %> <%= f.input :is_public, as: :toggle, label: 'Make Forum Public?', hint: 'This will allow anyone to see the forum. Use option below to restrict to registered users' %> <%= f.input :requires_login, as: :toggle, label: 'Public Requires Login?', hint: 'If this is a public forum, user must be logged in to see it. (All private forums automatically require login)' %> <% if defined? DmSubscriptions %> <%= f.input :requires_subscription, as: :toggle, label: 'Subscription Required?', hint: 'User must have a paid subscription to access' %> <% end %> <%= submit_or_cancel cancel_url: (@forum.new_record? ? admin_forum_category_path(@forum.forum_category) : admin_forum_path(@forum)), delete_url: ([:admin, @forum] unless @forum.new_record?), delete_confirm: 'Are you sure you wish to delete this forum? All comments will also be deleted!' %> <% end %> <% end %>