Sha256: 6942a1fd72571a458beb2cd6b8b49ed93b21f2eaba2beea4ce3f728fd346e2f1

Contents?: true

Size: 1.75 KB

Versions: 3

Compression:

Stored size: 1.75 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.

  = f.check_box :hide_results, 
    label: 'Hide results until the poll has ended',
    hint: 'If checked, admin users will be unable to view the poll results until the poll has ended.'

  = f.check_box :skip_logging,
    label: 'Skip logging of ballots',
    hint: 'If checked, no logs of who has submitted or completed ballots will be kept.'

  -# 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

  = effective_submit(f)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
effective_polls-0.6.2 app/views/admin/polls/_form_poll.html.haml
effective_polls-0.6.1 app/views/admin/polls/_form_poll.html.haml
effective_polls-0.6.0 app/views/admin/polls/_form_poll.html.haml