Sha256: 8b2f55be1cbd635c49c860cf1ddfb15c1083df33fb5dca1099cdd36c0b404438

Contents?: true

Size: 1.43 KB

Versions: 3

Compression:

Stored size: 1.43 KB

Contents

= effective_form_with(model: [:admin, poll], engine: true) do |f|

  = f.text_field :title, hint: 'The title of your poll or election.'

  = f.datetime_field :start_at
  = f.datetime_field :end_at

  - if f.object.poll_notifications.present?
    .alert.alert-info
      Please be aware of the existing #{ets(f.object.poll_notifications)} when changing the start or end availability date.

  -# Audience
  - f.object.audience_class_name ||= current_user.class.name

  = f.hidden_field :audience_class_name
  = f.radios :audience, Effective::Poll::AUDIENCES

  = f.show_if :audience, 'All Users' do
    .card
      .card-body
        %h5 All Users
        %p All users may complete this #{etd(poll)} 

  = f.show_if :audience, 'Individual Users' do
    .card
      .card-body
        %h5 Individual Users
        %p Only the following individual users may complete this #{etd(poll)} 

        -# Audience Users
        - ajax_url = (@select2_users_ajax_path || effective_resources.users_admin_select2_ajax_index_path) unless Rails.env.test?
        = f.select :audience_scope, current_user.class.all, ajax_url: ajax_url, multiple: true

  = f.show_if :audience, 'Selected Users' do
    .card
      .card-body
        %h5 Selected Users
        %p Users within any of the following groups may complete this #{etd(poll)} 
        = f.checks :audience_scope, effective_polls_audience_scope_collection(f.object), multiple: true, label: false

  = effective_submit(f)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
effective_polls-0.5.0 app/views/admin/polls/_form_poll.html.haml
effective_polls-0.4.1 app/views/admin/polls/_form_poll.html.haml
effective_polls-0.4.0 app/views/admin/polls/_form_poll.html.haml