Sha256: 46465ce39f5776fa4f73b68702331862efc080e07ce3bfc83ebdcb37cab5e4e5
Contents?: true
Size: 1.95 KB
Versions: 3
Compression:
Stored size: 1.95 KB
Contents
h1 = @page.title - unless @page.template.is_page? small =<> link_to page_path(@page), method: :delete, data: { confirm: 'You are about to delete this page. Are you sure?' }, class: "red" do i.icon-trash .right = link_to "View Page", @page.url, class:"btn-large btn", target: '_blank' = simple_form_for @page, html: {:multipart => true} do |f| = f.error_notification = f.input :title = render "url_field", f: f - unless @page.template.is_page? label Template = @page.template.name = f.input :in_menu, label: false, inline_label: "Display in main menu?" = field_set_tag "SEO" do .nested-fields = f.simple_fields_for :meta_seo, OpenStruct.new(@page.seo) do |seo| = seo.input :title, label: "Browser titlebar", required: false = seo.input :description, as: :text, required: false - for key in seo.object.methods(nil).grep(/[^=]$/) - [:title, :description] = seo.input key, required: false - @page.template_hash.each do |part_identifier, part_hash| = field_set_tag part_hash[:title] || part_identifier.titleize do - if parts = @page.parts.select{|ob| ob.identifier == part_identifier} - parts.sort!{|a,b| a.position && b.position ? a.position <=> b.position : a.position ? -1 : 1 } - parts.each do |part| = f.simple_fields_for :parts, part do |g| = render "part_fields", f: g, part: part, part_hash: part_hash, part_identifier: part_identifier - if part_hash[:repeatable] .links / the "links" class is important for the cocoon gem = link_to_add_association "Add another #{part_hash[:repeatable]}", f, :parts, render_options: {locals: {part_hash: part_hash, part: @page.parts.build(identifier: part_identifier), part_identifier: part_identifier}}, class: "btn btn-block" .form-actions = f.button :submit, "Save", class:"btn-primary" = link_to "Cancel", dashboard_path, class:"btn"
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
cardboard_cms-0.3.1 | app/views/cardboard/pages/edit.html.slim |
cardboard_cms-0.2.2 | app/views/cardboard/pages/edit.html.slim |
cardboard_cms-0.2.1 | app/views/cardboard/pages/edit.html.slim |