Sha256: 099df7a7d559937ffaaf7de346e6d8f386e2b77db6606e320ad8554e5b3fba1f

Contents?: true

Size: 1.47 KB

Versions: 3

Compression:

Stored size: 1.47 KB

Contents

- if current_user.try(:is_any?, :member, :admin)
  = f.radios :member_or_non_member_choice, Effective::EventRegistrant::MEMBER_OR_NON_MEMBER_CHOICES, label: false, inline: true
- else
  = f.hidden_field :member_or_non_member_choice, value: 'Add a regular registration'

= f.show_if(:member_or_non_member_choice, 'Add a member registration', nested: true) do
  = f.hidden_field :first_name, value: nil
  = f.hidden_field :last_name, value: nil
  = f.hidden_field :email, value: nil
  = f.hidden_field :company, value: nil

  - # Choose ANY member
  - klass = (f.object.user || current_user).class
  - ajax_url = (@select2_users_ajax_path || effective_memberships.member_users_membership_select2_ajax_index_path) unless Rails.env.test?

  = f.hidden_field :user_type, value: klass.name
  = f.select :user_id, klass.all, ajax_url: ajax_url, label: 'Member', hint: effective_events_event_registrant_user_hint()

  - # Choose RELATED ORGANIZATION member
  -# = f.hidden_field :user_type, value: current_user.class.name
  -# = f.select :user_id, effective_events_event_registrant_user_collection(f.object), hint: effective_events_event_registrant_user_hint()

= f.show_if(:member_or_non_member_choice, 'Add a regular registration', nested: true) do
  = f.hidden_field :user_type, value: nil
  = f.hidden_field :user_id, value: nil

  - # Choose non-member
  .row
    .col-md= f.text_field :first_name
    .col-md= f.text_field :last_name

  .row
    .col-md= f.email_field :email
    .col-md= f.text_field :company

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
effective_events-0.19.2 app/views/effective/event_registrants/_fields_member_or_non_member.html.haml
effective_events-0.19.1 app/views/effective/event_registrants/_fields_member_or_non_member.html.haml
effective_events-0.19.0 app/views/effective/event_registrants/_fields_member_or_non_member.html.haml