Sha256: 0068aa37d42cb029a8f65bbf8f13be0c43c554606b7172cbaeb40ceb7d5a9862

Contents?: true

Size: 1.29 KB

Versions: 2

Compression:

Stored size: 1.29 KB

Contents

= f.text_field :title
= f.select :category, EffectiveClassifieds.categories, required: true

- if f.object.persisted? || f.object.errors.include?(:slug)
  - current_url = (effective_classifieds.classified_url(f.object) rescue nil)
  = f.text_field :slug, hint: "The slug controls this resource's internet address. Be careful, changing the slug will break links that other websites may have to the old address.<br>#{('This 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

- minDate = [Time.zone.now, f.object.created_at].compact.min

= f.date_field :start_on, label: "Classified Start",
  hint: 'The classified ad will be displayed starting on this date',
  input_js: { minDate: minDate.strftime('%F') }

= f.date_field :end_on, label: "Classified End",
  hint: 'The classified ad will no longer be displayed on this date'

- if f.object.persisted? && !f.object.draft?
  = f.check_box :archived, label: 'Yes, this classified is archived and will not be displayed'

%h2 Classified Content
= f.rich_text_area :body, hint: 'The main body of your classified'
= f.text_field :location
= f.url_field :website

%h2 Contact Information
= f.text_field :organization
= f.email_field :email
= f.tel_field :phone

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
effective_classifieds-0.0.3 app/views/effective/classifieds/_fields.html.haml
effective_classifieds-0.0.2 app/views/effective/classifieds/_fields.html.haml