spree_cm_commissioner 2.5.2.pre.pre2 → 2.5.2.pre.pre3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test_and_build_gem.yml +1 -1
  3. data/Gemfile.lock +1 -1
  4. data/app/controllers/concerns/spree/api/v2/product_list_includes_decorator.rb +37 -0
  5. data/app/controllers/spree/api/v2/storefront/active_homepage_events_controller.rb +6 -1
  6. data/app/controllers/spree/api/v2/storefront/homepage_sections_controller.rb +41 -4
  7. data/app/controllers/spree/api/v2/storefront/invite_guests_controller.rb +11 -2
  8. data/app/controllers/spree/api/v2/storefront/products_controller_decorator.rb +27 -0
  9. data/app/controllers/spree/api/v2/storefront/taxons_controller_decorator.rb +92 -0
  10. data/app/controllers/spree_cm_commissioner/application_controller_decorator.rb +0 -2
  11. data/app/jobs/spree_cm_commissioner/line_items/sync_event_date_job.rb +10 -0
  12. data/app/models/concerns/spree_cm_commissioner/line_item_durationable.rb +30 -23
  13. data/app/models/concerns/spree_cm_commissioner/variant_options_concern.rb +47 -6
  14. data/app/models/spree/stock/quantifier_decorator.rb +26 -0
  15. data/app/models/spree_cm_commissioner/export.rb +1 -3
  16. data/app/models/spree_cm_commissioner/guest.rb +3 -3
  17. data/app/models/spree_cm_commissioner/taxon_decorator.rb +27 -1
  18. data/app/serializers/spree/v2/storefront/product_serializer_decorator.rb +36 -7
  19. data/app/services/spree_cm_commissioner/line_items/sync_event_date.rb +22 -0
  20. data/app/services/spree_cm_commissioner/trips/create_single_leg.rb +14 -19
  21. data/app/services/spree_cm_commissioner/trips/update_single_leg.rb +2 -4
  22. data/app/services/spree_cm_commissioner/trips/variants/create.rb +6 -6
  23. data/config/routes.rb +0 -27
  24. data/lib/spree_cm_commissioner/transit/route_stop_collection.rb +0 -28
  25. data/lib/spree_cm_commissioner/transit/trip_form.rb +0 -24
  26. data/lib/spree_cm_commissioner/transit/trip_stop_form.rb +1 -5
  27. data/lib/spree_cm_commissioner/version.rb +1 -1
  28. data/lib/spree_cm_commissioner.rb +0 -1
  29. metadata +8 -33
  30. data/app/controllers/concerns/spree_cm_commissioner/events/role_authorization.rb +0 -36
  31. data/app/controllers/spree/events/base_controller.rb +0 -35
  32. data/app/controllers/spree/events/check_ins_controller.rb +0 -23
  33. data/app/controllers/spree/events/data_exports_controller.rb +0 -41
  34. data/app/controllers/spree/events/errors_controller.rb +0 -19
  35. data/app/controllers/spree/events/guests_controller.rb +0 -139
  36. data/app/controllers/spree/events/state_changes_controller.rb +0 -11
  37. data/app/errors/spree_cm_commissioner/unauthorized_event_error.rb +0 -4
  38. data/app/interactors/spree_cm_commissioner/event_line_items_date_syncer.rb +0 -19
  39. data/app/jobs/spree_cm_commissioner/event_line_items_date_syncer_job.rb +0 -8
  40. data/app/jobs/spree_cm_commissioner/export_csv_job.rb +0 -7
  41. data/app/models/spree_cm_commissioner/exports/export_guest_csv.rb +0 -33
  42. data/app/services/spree_cm_commissioner/exports/export_guest_csv_service.rb +0 -48
  43. data/app/views/spree/events/check_ins/index.html.erb +0 -59
  44. data/app/views/spree/events/data_exports/index.html.erb +0 -54
  45. data/app/views/spree/events/errors/_error.html.erb +0 -7
  46. data/app/views/spree/events/errors/forbidden.html.erb +0 -1
  47. data/app/views/spree/events/errors/resource_not_found.html.erb +0 -1
  48. data/app/views/spree/events/guests/_check_in_status.html.erb +0 -44
  49. data/app/views/spree/events/guests/_form.html.erb +0 -37
  50. data/app/views/spree/events/guests/_swap_guest_bib_number.html.erb +0 -18
  51. data/app/views/spree/events/guests/edit.html.erb +0 -86
  52. data/app/views/spree/events/guests/index.html.erb +0 -102
  53. data/app/views/spree/events/shared/_event_switcher.html.erb +0 -39
  54. data/app/views/spree/events/shared/_filters.html.erb +0 -50
  55. data/app/views/spree/events/shared/_guest_tabs.html.erb +0 -19
  56. data/app/views/spree/events/shared/_header.html.erb +0 -10
  57. data/app/views/spree/events/shared/_main_menu.html.erb +0 -22
  58. data/app/views/spree/events/state_changes/index.html.erb +0 -48
  59. data/lib/spree_cm_commissioner/test_helper/factories/export_guest_csv_factory.rb +0 -9
  60. data/lib/spree_cm_commissioner/transit/service_calendar_form.rb +0 -51
@@ -1,139 +0,0 @@
1
- module Spree
2
- module Events
3
- class GuestsController < Spree::Events::BaseController
4
- before_action :load_guest_and_event, only: %i[edit send_email generate_guest_bib_number swap_guest_bib_number]
5
- before_action :load_filtered_guests, only: %i[edit swap_guest_bib_number]
6
- helper SpreeCmCommissioner::Admin::GuestHelper
7
-
8
- def collection_url
9
- event_guests_url
10
- end
11
-
12
- def model_class
13
- SpreeCmCommissioner::Guest
14
- end
15
-
16
- def check_in
17
- guest_ids = [params[:id]]
18
- result = SpreeCmCommissioner::CheckIns::CreateBulk.call(
19
- check_ins_attributes: guest_ids.map { |guest_id| { guest_id: guest_id, check_in_session_id: params[:check_in_session_id] } },
20
- check_in_by: spree_current_user
21
- )
22
-
23
- if result.success?
24
- flash[:success] = Spree.t('event.check_in.success')
25
- else
26
- flash[:error] = result.error.to_s
27
- end
28
-
29
- redirect_to edit_object_url
30
- end
31
-
32
- def uncheck_in
33
- result = SpreeCmCommissioner::CheckIns::DestroyBulk.call(
34
- check_ins_attributes: [{ guest_id: params[:id], check_in_session_id: params[:check_in_session_id] }],
35
- destroyed_by: spree_current_user
36
- )
37
-
38
- if result.success?
39
- flash[:success] = Spree.t('event.uncheck_in.success')
40
- else
41
- flash[:error] = result.error.to_s
42
- end
43
-
44
- redirect_to edit_object_url
45
- end
46
-
47
- def edit
48
- @check_in = @guest.earliest_check_in
49
- end
50
-
51
- def edit_object_url
52
- edit_event_guest_url
53
- end
54
-
55
- def send_email
56
- @email = params[:guest][:email]
57
-
58
- Spree::OrderMailer.ticket_email(@guest, @email).deliver_later
59
-
60
- flash[:success] = 'Email sent successfully' # rubocop:disable Rails/I18nLocaleTexts
61
- redirect_to event_guest_path
62
- end
63
-
64
- def generate_guest_bib_number
65
- @guest.generate_bib!
66
-
67
- flash[:success] = 'Bib number generated successfully' # rubocop:disable Rails/I18nLocaleTexts
68
- redirect_to event_guest_path
69
- end
70
-
71
- def swap_guest_bib_number
72
- target_guest = @filtered_guests.find(params[:target_guest_id])
73
-
74
- SpreeCmCommissioner::BibNumberSwapper.call(
75
- guests: @filtered_guests,
76
- current_guest: @guest,
77
- target_guest: target_guest
78
- )
79
-
80
- flash[:success] = 'Bib number swapped successfully' # rubocop:disable Rails/I18nLocaleTexts
81
- redirect_to event_guests_path
82
- end
83
-
84
- # POST: /guests/generate_guest_csv
85
- def generate_guest_csv
86
- name = "guest-csv#{Time.current.to_i}"
87
- file_name = "guests-data-#{current_event.name.gsub(' ', '-')}-#{Time.current.to_i}.csv"
88
- file_path = Rails.root.join('tmp', file_name)
89
- export_type = SpreeCmCommissioner::Exports::ExportGuestCsv
90
-
91
- guest_csv = SpreeCmCommissioner::Exports::ExportGuestCsv.new(
92
- name: name,
93
- file_name: file_name,
94
- file_path: file_path,
95
- export_type: export_type,
96
- preferred_event_id: current_event.id
97
- )
98
-
99
- if guest_csv.save
100
- flash[:success] = Spree.t('csv.csv_generate')
101
- redirect_to event_data_exports_path
102
- else
103
- flash[:error] = Spree.t('csv.generate_error')
104
- redirect_back(fallback_location: event_guests_path)
105
- end
106
- end
107
-
108
- private
109
-
110
- def load_guest_and_event
111
- @guest = SpreeCmCommissioner::Guest.find(params[:id])
112
- @event = @guest.event
113
- end
114
-
115
- def load_filtered_guests
116
- @filtered_guests = @event.guests
117
- .where(bib_prefix: @guest.bib_prefix)
118
- .where.not(id: @guest.id).order(:bib_number)
119
- end
120
-
121
- def permitted_resource_params
122
- params.required(:spree_cm_commissioner_guest).permit(:entry_type)
123
- end
124
-
125
- def collection
126
- scope = model_class.where(event_id: current_event&.id)
127
- @search = scope.ransack(params[:q])
128
- @collection = @search.result
129
- .includes(:id_card)
130
- .page(params[:page])
131
- .per(params[:per_page])
132
- end
133
-
134
- def collection_actions
135
- super << :generate_guest_csv
136
- end
137
- end
138
- end
139
- end
@@ -1,11 +0,0 @@
1
- module Spree
2
- module Events
3
- class StateChangesController < Spree::Events::BaseController
4
- def index
5
- @guest = SpreeCmCommissioner::Guest.find(params[:guest_id])
6
- @event = @guest.event
7
- @state_changes = @guest.state_changes.includes(:user)
8
- end
9
- end
10
- end
11
- end
@@ -1,4 +0,0 @@
1
- module SpreeCmCommissioner
2
- class UnauthorizedEventError < StandardError
3
- end
4
- end
@@ -1,19 +0,0 @@
1
- module SpreeCmCommissioner
2
- class EventLineItemsDateSyncer < BaseInteractor
3
- delegate :event, to: :context
4
-
5
- def call
6
- return unless event.event?
7
- return unless event.depth == 1
8
-
9
- event.event_line_items.includes(:variant).find_each do |line_item|
10
- new_from = line_item.variant.start_date_time || event.from_date
11
- new_to = line_item.variant.end_date_time || event.to_date
12
-
13
- # Update could be failed here if case line item does not allowed to change or no longer available.
14
- # We can ignore this line item in this case.
15
- line_item.update(from_date: new_from, to_date: new_to) if line_item.from_date != new_from || line_item.to_date != new_to
16
- end
17
- end
18
- end
19
- end
@@ -1,8 +0,0 @@
1
- module SpreeCmCommissioner
2
- class EventLineItemsDateSyncerJob < ApplicationJob
3
- def perform(options = {})
4
- event = Spree::Taxon.event.find(options[:event_id])
5
- SpreeCmCommissioner::EventLineItemsDateSyncer.call(event: event)
6
- end
7
- end
8
- end
@@ -1,7 +0,0 @@
1
- module SpreeCmCommissioner
2
- class ExportCsvJob < ApplicationUniqueJob
3
- def perform(options = {})
4
- Exports::ExportGuestCsvService.new(options[:export_id]).call
5
- end
6
- end
7
- end
@@ -1,33 +0,0 @@
1
- module SpreeCmCommissioner
2
- module Exports
3
- class ExportGuestCsv < Export
4
- preference :event_id, :integer
5
- after_create :export_csv
6
-
7
- def construct_header
8
- SpreeCmCommissioner::Guest.column_names.map(&:titleize)
9
- end
10
-
11
- def construct_row(guest)
12
- guest.attributes.map do |key, value|
13
- case key
14
- when 'dob'
15
- value&.strftime('%d %b %Y')
16
- when 'event_id'
17
- guest.event&.name
18
- when 'nationality_id'
19
- guest.nationality&.name
20
- when 'occupation_id'
21
- guest.occupation&.name
22
- else
23
- value
24
- end
25
- end
26
- end
27
-
28
- def scope
29
- SpreeCmCommissioner::Guest.where(event_id: preferred_event_id)
30
- end
31
- end
32
- end
33
- end
@@ -1,48 +0,0 @@
1
- module SpreeCmCommissioner
2
- module Exports
3
- class ExportGuestCsvService
4
- attr_reader :export_id
5
-
6
- def initialize(export_id)
7
- @export_id = export_id
8
- end
9
-
10
- def call
11
- update_export_status_when_start
12
- generate_csv_file
13
- update_export_status_when_finish(:done)
14
- rescue StandardError => e
15
- update_export_status_when_finish(:failed)
16
- raise e
17
- end
18
-
19
- def export
20
- @export ||= SpreeCmCommissioner::Exports::ExportGuestCsv.find(export_id)
21
- end
22
-
23
- def generate_csv_file
24
- CSV.open(export.file_path, 'w') do |csv|
25
- csv << export.construct_header
26
-
27
- export.scope.find_each do |resource|
28
- csv << export.construct_row(resource)
29
- end
30
- end
31
-
32
- attach_csv_file
33
- end
34
-
35
- def attach_csv_file
36
- export.exported_file.attach(io: File.open(export.file_path), filename: export.file_name)
37
- end
38
-
39
- def update_export_status_when_start
40
- export.update(status: :progress, started_at: Time.zone.now)
41
- end
42
-
43
- def update_export_status_when_finish(status)
44
- export.update(status: status, finished_at: Time.zone.now)
45
- end
46
- end
47
- end
48
- end
@@ -1,59 +0,0 @@
1
- <% content_for :page_title do %>
2
- <%= Spree.t(:check_in_guests) %>
3
- <% end %>
4
-
5
- <% if @collection.any? %>
6
- <div class="table-responsive border rounded bg-white">
7
- <table class="table" id="listing_products">
8
- <thead class="text-muted">
9
- <tr data-hook="admin_products_index_headers">
10
- <th scope="col" class="text-left"><%= Spree.t(:full_name) %></th>
11
- <th scope="col" class="text-left"><%= Spree.t(:verification_state) %></th>
12
- <th scope="col" class="text-left"><%= Spree.t(:check_in_type) %></th>
13
- <th scope="col" class="text-left"><%= Spree.t(:entry_type) %></th>
14
- <th scope="col" class="text-left"><%= Spree.t(:check_in_method) %></th>
15
- <th scope="col" class="text-left"><%= Spree.t(:check_in_by) %></th>
16
- <th scope="col" class="text-left"><%= Spree.t(:confirmed_at) %></th>
17
- </tr>
18
- </thead>
19
- <tbody>
20
- <% @collection.each do |check_in| %>
21
- <tr data-hook="event_check_ins_index_rows">
22
- <td class="text-left">
23
- <%= check_in.guest.full_name %>
24
- </td>
25
- <td class="text-left">
26
- <%= check_in.verification_state.titleize %>
27
- </td>
28
- <td class="text-left">
29
- <%= content_tag(:strong, class: "badge #{badge_color_base_on_check_in_type(check_in.check_in_type)} font-weight-bold uppercase") do %>
30
- <%= check_in.check_in_type.titleize %>
31
- <% end %>
32
- </td>
33
- <td class="text-left">
34
- <%= content_tag(:strong, class: "badge #{badge_color_base_on_entry_type(check_in.guest.entry_type)} font-weight-bold uppercase") do %>
35
- <%= SpreeCmCommissioner::CheckIn.entry_types.key(check_in.guest.entry_type).titleize %>
36
- <% end %>
37
- </td>
38
- <td class="text-left">
39
- <%= content_tag(:strong, class: "badge #{badge_color_base_on_check_in_method(check_in.check_in_method)} font-weight-bold uppercase") do %>
40
- <%= check_in.check_in_method.titleize %>
41
- <% end %>
42
- </td>
43
- <td class="text-left">
44
- <%= check_in.check_in_by.full_name %>
45
- </td>
46
- <td class="text-left">
47
- <%= check_in.confirmed_at %>
48
- </td>
49
- </tr>
50
- <% end %>
51
- </tbody>
52
- </table>
53
- </div>
54
- <%= render partial: 'spree/admin/shared/index_table_options', locals: { collection: @collection } %>
55
- <% else %>
56
- <div class="text-left no-objects-found m-5">
57
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(SpreeCmCommissioner::CheckIn)) %>
58
- </div>
59
- <% end %>
@@ -1,54 +0,0 @@
1
- <% content_for :page_title do %>
2
- <%= Spree.t(:data_exports) %>
3
- <% end %>
4
-
5
- <% if @collection.any? %>
6
- <div class="table-responsive border rounded bg-white">
7
- <table class="table" id="listing_products">
8
- <thead class="text-muted">
9
- <tr data-hook="admin_products_index_headers">
10
- <th class="text-left"><%= Spree.t(:name) %></th>
11
- <th class="text-left"><%= Spree.t(:type) %></th>
12
- <th class="text-left"><%= Spree.t(:status) %></th>
13
- <th class="text-left"><%= Spree.t(:created_at) %></th>
14
- <th class="text-center"><%= Spree.t(:action) %></th>
15
- </tr>
16
- </thead>
17
- <tbody>
18
- <% @collection.each do |export| %>
19
- <tr data-hook="event_exports_index_rows">
20
- <td class="text-left">
21
- <%= export.name %>
22
- </td>
23
- <td class="text-left">
24
- <%= export.export_type %>
25
- </td>
26
- <td class="text-left">
27
- <% case export.status %>
28
- <% when 'queue' %>
29
- <span class="badge badge-primary"><%= export.status %></span>
30
- <% when 'progress' %>
31
- <span class="badge badge-warning"><%= export.status %></span>
32
- <% when 'done' %>
33
- <span class="badge badge-success"><%= export.status %></span>
34
- <% else %>
35
- <span class="badge badge-secondary"><%= export.status %></span>
36
- <% end %>
37
- </td>
38
- <td class="text-left">
39
- <%= pretty_time(export.created_at) %>
40
- </td>
41
- <td class="text-center">
42
- <%= link_to 'Download CSV', download_event_data_export_path(export.uuid), method: :post, class: 'btn btn-outline-primary' if export.status == 'done' %>
43
- </td>
44
- <% end %>
45
- </tbody>
46
- </table>
47
- </div>
48
- <% else %>
49
- <div class="text-left no-objects-found m-5">
50
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(SpreeCmCommissioner::Export)) %>
51
- </div>
52
- <% end %>
53
-
54
- <%= render partial: 'spree/admin/shared/index_table_options', locals: { collection: @collection } %>
@@ -1,7 +0,0 @@
1
- <div class="d-flex align-items-center justify-content-center" style="height: var(--tg-viewport-height);">
2
- <div class="text-center">
3
- <h3 class="fs-3"><span class="text-danger">Oops!</span></h3>
4
- <p><%= @message %></p>
5
- <a href="/" class="btn btn-primary">Go Home</a>
6
- </div>
7
- </div>
@@ -1 +0,0 @@
1
- <%= render partial: "error" %>
@@ -1 +0,0 @@
1
- <%= render partial: "error" %>
@@ -1,44 +0,0 @@
1
- <div class="card mb-3" id="order_tab_summary">
2
- <div class="card-header">
3
- <h3 class="card-title mb-0 h6"><%= Spree.t(:check_in_states) %></h3>
4
- </div>
5
- <ul class="list-group list-group-flush">
6
- <li class="list-group-item d-flex justify-content-between align-items-center">
7
- <small><%= Spree.t(:verification_state) %></small>
8
- <%= @check_in.verification_state %>
9
- </li>
10
- <li class="list-group-item d-flex justify-content-between align-items-center">
11
- <small><%= Spree.t(:check_in_type) %></small>
12
- <%= content_tag(:strong, class: "badge #{badge_color_base_on_check_in_type(@check_in.check_in_type)} font-weight-bold uppercase") do %>
13
- <%= @check_in.check_in_type.titleize %>
14
- <% end %>
15
- </li>
16
- <li class="list-group-item d-flex justify-content-between align-items-center">
17
- <small><%= Spree.t(:entry_type) %></small>
18
- <%= content_tag(:strong, class: "badge #{badge_color_base_on_entry_type(@check_in.guest.entry_type)} font-weight-bold uppercase") do %>
19
- <%= SpreeCmCommissioner::CheckIn.entry_types.key(@check_in.guest.entry_type).titleize %>
20
- <% end %>
21
- </li>
22
- <li class="list-group-item d-flex justify-content-between align-items-center">
23
- <small><%= Spree.t(:check_in_method) %></small>
24
- <%= content_tag(:strong, class: "badge #{badge_color_base_on_check_in_method(@check_in.check_in_method)} font-weight-bold uppercase") do %>
25
- <%= @check_in.check_in_method %>
26
- <% end %>
27
- </li>
28
- <li class="list-group-item d-flex justify-content-between align-items-center">
29
- <small><%= Spree.t(:check_in_by) %></small>
30
- <%= @check_in.check_in_by.full_name %>
31
- </li>
32
- <li class="list-group-item d-flex justify-content-between align-items-center">
33
- <small data-hook='admin_order_tab_date_completed_title'><%= Spree.t(:confirmed_at) %></small>
34
- <span class="text-right small font-weight-bold" id='date_complete'>
35
- <%= pretty_time(@check_in.confirmed_at) %>
36
- </span>
37
- </li>
38
- </ul>
39
-
40
- <!-- Button trigger modal -->
41
- <button type="button" class="btn btn-outline-danger m-3" data-toggle="modal" data-target="#uncheckInModal">
42
- Uncheck In
43
- </button>
44
- </div>
@@ -1,37 +0,0 @@
1
- <div class="row">
2
- <div class="col-12">
3
- <div class="card mb-3">
4
- <div class="card-body">
5
- <div class="form-group row">
6
- <% SpreeCmCommissioner::Guest.csv_importable_columns.each do |column| %>
7
- <div class="col-12 col-lg-6">
8
- <%= f.field_container column do %>
9
- <%= f.label column %>
10
- <%= f.text_field column, class: 'form-control', readonly: true %>
11
- <% end %>
12
- </div>
13
- <% end %>
14
-
15
- <div class="col-12 col-lg-6">
16
- <%= f.label :id_card_card_type_eq, Spree.t(:card_type) %>
17
- <%= f.text_field :id_card_card_type_eq, class: 'form-control', value: @guest.id_card&.try(:card_type)&.titleize, readonly: true %>
18
- </div>
19
-
20
- <div class="col-12 col-lg-6">
21
- <%= f.field_container :entry_type do %>
22
- <%= f.label :entry_type %>
23
- <% SpreeCmCommissioner::CheckIn.entry_types.map do |k, v| %>
24
- <div class="radio" data-id="<%= k.to_s %>">
25
- <label data-hook="entry_type_field">
26
- <%= f.radio_button :entry_type, v, class: "entry_types_radios" %>
27
- <%= k.to_s.capitalize %>
28
- </label>
29
- </div>
30
- <% end %>
31
- <% end %>
32
- </div>
33
- </div>
34
- </div>
35
- </div>
36
- </div>
37
- </div>
@@ -1,18 +0,0 @@
1
- <div class="card mb-3">
2
- <div class="card-body">
3
- <h5 class="card-title"><%= Spree.t(:guest_bib_number) %></h5>
4
- <% if @guest.bib_prefix.present? %>
5
- <p class="card-text">Current Guest BIB Number: <span class='font-weight-bold'><%= @guest.formatted_bib_number %></span></p>
6
- <div>
7
- <%= form_with(url: swap_guest_bib_number_event_guest_path, method: :patch) do |f| %>
8
- <%= f.label :bib_number, Spree.t(:swap_bib_number) %>
9
- <%= f.select :target_guest_id, @filtered_guests.select { |guest| guest.bib_number.present? }.map { |guest| [guest.formatted_bib_number, guest.id] }, { include_blank: true }, class: 'form-control fullwidth select2' %>
10
- <%= f.submit "Swap BIB", class: "btn btn-outline-primary mt-3" %>
11
- <% end %>
12
- </div>
13
- <% else %>
14
- <p class="card-text">Current Guest BIB Number: <span class='font-weight-bold'><%= Spree.t(:no_bib_number) %></span></p>
15
- <%= button_link_to Spree.t('generate_bib_number'), generate_guest_bib_number_event_guest_path, method: :post, class: "btn btn-outline-primary", icon: 'add.svg' %>
16
- <% end %>
17
- </div>
18
- </div>
@@ -1,86 +0,0 @@
1
- <% content_for :page_title do %>
2
- <%= Spree.t(:guests) %>
3
- <% end %>
4
-
5
- <%= render partial: 'spree/events/shared/guest_tabs', locals: { current: :edit } %>
6
-
7
- <% content_for(:sidebar) do %>
8
- <%= render partial: 'swap_guest_bib_number', locals: { guests: @filtered_guests } %>
9
-
10
- <% if @guest.check_in.present? %>
11
- <%= render partial: 'check_in_status' %>
12
- <% else %>
13
- <div class="card">
14
- <div class="card-body">
15
- <h5 class="card-title"><%= Spree.t(:check_in_status) %></h5>
16
- <p class="card-text">Click button below to manually check_in guest</p>
17
- <%= link_to 'Check In', check_in_event_guest_path, method: :post, class: 'btn btn-outline-primary' %>
18
- </div>
19
- </div>
20
- <% end %>
21
- <% end %>
22
-
23
- <% content_for(:sidebar) do %>
24
- <div class="card mt-3">
25
- <div class="card-body">
26
- <h5 class="card-title"><%= Spree.t(:send_email) %></h5>
27
- <p class="card-text">Click button to manually send email to guest</p>
28
- <button type="button" class="btn btn-outline-primary" data-toggle="modal" data-target="#emailModal">
29
- Send Email
30
- </button>
31
- </div>
32
- </div>
33
- <% end %>
34
-
35
- <%= form_with(model: @guest, url: { action: :update }) do |f| %>
36
- <fieldset>
37
- <%= render partial: 'form', locals: { f: f } %>
38
- <%= render partial: 'spree/admin/shared/edit_resource_links' %>
39
- </fieldset>
40
- <% end %>
41
-
42
- <!-- Send Email Modal -->
43
- <div class="modal fade" id="emailModal" tabindex="-1" role="dialog" aria-labelledby="emailModalLabel" aria-hidden="true">
44
- <div class="modal-dialog" role="document">
45
- <div class="modal-content">
46
- <div class="modal-header">
47
- <h5 class="modal-title" id="emailModalLabel">Send Email</h5>
48
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
49
- <span aria-hidden="true">&times;</span>
50
- </button>
51
- </div>
52
- <div class="modal-body">
53
- <!-- Form for email input -->
54
- <%= form_with(model: @guest, scope: :guest, url: send_email_event_guest_path(@guest), method: :post, id: "emailForm") do |form| %>
55
- <div class="form-group">
56
- <label for="emailInput">Email address</label>
57
- <%= form.email_field :email, required: true, class: 'form-control', id: "emailInput", aria_describedby: "emailHelp", placeholder: "Enter email" %>
58
- <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
59
- </div>
60
- <%= form.submit "Send", class: "btn btn-primary" %>
61
- <% end %>
62
- </div>
63
- </div>
64
- </div>
65
- </div>
66
-
67
- <!-- Verified Uncheck In Modal -->
68
- <div class="modal fade" id="uncheckInModal" tabindex="-1" role="dialog" aria-labelledby="uncheckInModalLabel" aria-hidden="true">
69
- <div class="modal-dialog" role="document">
70
- <div class="modal-content">
71
- <div class="modal-header">
72
- <h5 class="modal-title" id="uncheckInModalLabel">Uncheck In Confirmation</h5>
73
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
74
- <span aria-hidden="true">&times;</span>
75
- </button>
76
- </div>
77
- <div class="modal-body">
78
- Are you sure you want to uncheck in?
79
- </div>
80
- <div class="modal-footer">
81
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
82
- <%= link_to 'Confirm', uncheck_in_event_guest_path, method: :post, class: 'btn btn-primary' %>
83
- </div>
84
- </div>
85
- </div>
86
- </div>