Sha256: 14198ee426ed4c79514408cbc792b640560df97ae88c440a208c84e9fd7d4a10

Contents?: true

Size: 1.9 KB

Versions: 2

Compression:

Stored size: 1.9 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.mb-3
      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

  - # We don't want any future polls to include 'All Users'
  - if f.object.audience == 'All Users'
    = f.radios :audience, Effective::Poll::AUDIENCES
  - else
    = f.radios :audience, (Effective::Poll::AUDIENCES - ['All Users'])

  = 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 = (effective_resources.users_effective_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

2 entries across 2 versions & 1 rubygems

Version Path
effective_polls-0.7.3 app/views/admin/polls/_form_poll.html.haml
effective_polls-0.7.2 app/views/admin/polls/_form_poll.html.haml