= 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)