Sha256: dddc5092079d29c912f7c68ba364093bdec650a3780f5105ef8bca56c4818432

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

= effective_form_with(model: [:admin, poll], engine: true) do |f|
  = f.text_field :title, hint: 'The title of your poll.'

  = f.datetime_field :start_at, input_js: { minDate: [f.object.start_at.presence, Time.zone.now].compact.min.strftime('%F') }
  = f.datetime_field :end_at

  .alert.alert-warning
    Once the start date has passed, this poll will become read only and you will be unable to make changes.

  -# Audience
  = 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 poll

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

        - user_ids = User.respond_to?(:sorted) ? User.sorted : User.all
        = f.select :audience_scope, user_ids, multiple: true, label: false

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

  = effective_submit(f)

Version data entries

1 entries across 1 versions & 1 rubygems

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