Sha256: a95809d59f1bfc06e13e4229bcfbd46d0438fe7fc5cbec4cbf5afe3c3f6b90c2
Contents?: true
Size: 1.9 KB
Versions: 1
Compression:
Stored size: 1.9 KB
Contents
= effective_form_with(model: post, url: post.persisted? ? effective_posts.admin_post_path(post.id) : effective_posts.admin_posts_path) do |f| = f.text_field :title, hint: 'The title of your post.' - if f.object.persisted? || f.object.errors.include?(:slug) - current_url = (effective_posts.post_url(f.object) rescue nil) = f.text_field :slug, hint: "The slug controls this post's internet address. Be careful, changing the slug will break links that other websites may have to the old address.<br>#{('This post 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 - if Array(EffectivePosts.categories).length > 1 = f.select :category, EffectivePosts.categories - else = f.hidden_field :category, (EffectivePosts.categories.first || 'posts') = f.ck_editor :excerpt, hint: 'Will be used for the post excerpt on index pages.' = f.text_field :description, hint: 'The content of the post meta tags.', maxlength: 150 = render partial: '/effective/posts/additional_fields', locals: { post: post, form: f, f: f } = f.datetime_field :published_at, label: 'Publish date', hint: 'When should this be displayed on the website.' = f.check_box :draft, hint: 'Save this post as a draft. It will not be accessible on the website.' - unless EffectivePosts.use_fullscreen_editor = f.ck_editor :body, hint: 'The content of your post.' - if defined?(EffectiveRoles) and f.object.respond_to?(:roles) && EffectivePosts.use_effective_roles = render partial: '/admin/posts/roles', locals: { post: post, form: f, f: f } = f.submit do = f.save 'Save' - if EffectivePosts.use_fullscreen_editor = 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_posts-1.1.3 | app/views/admin/posts/_form.html.haml |