Sha256: 6250b3773a64a3f7084ac5b3b19d9d7a545d52ea3b7f00a54ff1b5a152f598a5

Contents?: true

Size: 1.5 KB

Versions: 3

Compression:

Stored size: 1.5 KB

Contents

= effective_form_with(model: post, engine: true) 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_path(f.object)
  = 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 && f.object.slug.present? }".html_safe

  - if Array(EffectivePosts.categories).length > 1
    = f.select :category, EffectivePosts.categories
  - else
    = f.hidden_field :category, value: (EffectivePosts.categories.first || 'posts')

  - if EffectivePosts.use_active_storage
    = f.file_field :image, hint: 'An image for your post'

  - if defined?(EffectiveArticleEditor)
    = f.article_editor :excerpt, hint: 'Will be used for the post excerpt on index pages.'
  - else
    = f.rich_text_area :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 }

  - if defined?(EffectiveArticleEditor)
    = f.article_editor :body, hint: 'The main body of your post'
  - else
    = f.rich_text_area :body, hint: 'The main body of your post'

  = f.submit 'Save'

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
effective_posts-2.6.2 app/views/effective/posts/_form.html.haml
effective_posts-2.6.1 app/views/effective/posts/_form.html.haml
effective_posts-2.6.0 app/views/effective/posts/_form.html.haml