Sha256: befa22fcdc74c6b440a825a65e65a47f4e4eb96c95157eed3c4d635d427a546d
Contents?: true
Size: 1.84 KB
Versions: 1
Compression:
Stored size: 1.84 KB
Contents
= effective_form_with(model: page, url: (page.persisted? ? effective_pages.admin_page_path(page.id) : effective_pages.admin_pages_path)) do |f| = f.text_field :title, hint: 'The title of your page.', input_html: { maxlength: 255 } - if (templates = EffectivePages.templates).length == 1 = f.hidden_field :template, value: templates.first - else = f.select :template, templates - if (layouts = EffectivePages.layouts).length == 1 = f.hidden_field :layout, value: layouts.first - else = f.select :layout, layouts - if f.object.persisted? || f.object.errors.include?(:slug) - current_url = (effective_pages.page_url(f.object) rescue nil) = f.text_field :slug, hint: "The slug controls this page's internet address. Be careful, changing the slug will break links that other websites may have to the old address.<br>#{('This page is currently reachable via ' + link_to(current_url.gsub(f.object.slug, '<strong>' + f.object.slug + '</strong>').html_safe, current_url)) if current_url }".html_safe = f.text_field :meta_description, hint: "A one or two sentence summary of this page. Appears on Google search results underneath the page title.", input_html: { maxlength: 150 } = render partial: '/admin/pages/additional_fields', locals: { page: page, form: f, f: f } = f.check_box :draft, label: 'Save this page as a draft. It will not be accessible on the website.' - if defined?(EffectiveRoles) and f.object.respond_to?(:roles) && EffectivePages.use_effective_roles = f.checks :roles, EffectiveRoles.roles_collection(f.object), hint: '* leave blank for a regular public page that anyone can view' = f.submit do = f.save 'Save' = f.save 'Save and Edit Content', class: 'btn btn-secondary' = f.save 'Save and View', class: 'btn btn-secondary' - if f.object.persisted? = f.save 'Duplicate', class: 'btn btn-info'
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
effective_pages-2.0.2 | app/views/admin/pages/_form.html.haml |