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.
- checksums.yaml +4 -4
- data/.github/workflows/test_and_build_gem.yml +1 -1
- data/Gemfile.lock +1 -1
- data/app/controllers/concerns/spree/api/v2/product_list_includes_decorator.rb +37 -0
- data/app/controllers/spree/api/v2/storefront/active_homepage_events_controller.rb +6 -1
- data/app/controllers/spree/api/v2/storefront/homepage_sections_controller.rb +41 -4
- data/app/controllers/spree/api/v2/storefront/invite_guests_controller.rb +11 -2
- data/app/controllers/spree/api/v2/storefront/products_controller_decorator.rb +27 -0
- data/app/controllers/spree/api/v2/storefront/taxons_controller_decorator.rb +92 -0
- data/app/controllers/spree_cm_commissioner/application_controller_decorator.rb +0 -2
- data/app/jobs/spree_cm_commissioner/line_items/sync_event_date_job.rb +10 -0
- data/app/models/concerns/spree_cm_commissioner/line_item_durationable.rb +30 -23
- data/app/models/concerns/spree_cm_commissioner/variant_options_concern.rb +47 -6
- data/app/models/spree/stock/quantifier_decorator.rb +26 -0
- data/app/models/spree_cm_commissioner/export.rb +1 -3
- data/app/models/spree_cm_commissioner/guest.rb +3 -3
- data/app/models/spree_cm_commissioner/taxon_decorator.rb +27 -1
- data/app/serializers/spree/v2/storefront/product_serializer_decorator.rb +36 -7
- data/app/services/spree_cm_commissioner/line_items/sync_event_date.rb +22 -0
- data/app/services/spree_cm_commissioner/trips/create_single_leg.rb +14 -19
- data/app/services/spree_cm_commissioner/trips/update_single_leg.rb +2 -4
- data/app/services/spree_cm_commissioner/trips/variants/create.rb +6 -6
- data/config/routes.rb +0 -27
- data/lib/spree_cm_commissioner/transit/route_stop_collection.rb +0 -28
- data/lib/spree_cm_commissioner/transit/trip_form.rb +0 -24
- data/lib/spree_cm_commissioner/transit/trip_stop_form.rb +1 -5
- data/lib/spree_cm_commissioner/version.rb +1 -1
- data/lib/spree_cm_commissioner.rb +0 -1
- metadata +8 -33
- data/app/controllers/concerns/spree_cm_commissioner/events/role_authorization.rb +0 -36
- data/app/controllers/spree/events/base_controller.rb +0 -35
- data/app/controllers/spree/events/check_ins_controller.rb +0 -23
- data/app/controllers/spree/events/data_exports_controller.rb +0 -41
- data/app/controllers/spree/events/errors_controller.rb +0 -19
- data/app/controllers/spree/events/guests_controller.rb +0 -139
- data/app/controllers/spree/events/state_changes_controller.rb +0 -11
- data/app/errors/spree_cm_commissioner/unauthorized_event_error.rb +0 -4
- data/app/interactors/spree_cm_commissioner/event_line_items_date_syncer.rb +0 -19
- data/app/jobs/spree_cm_commissioner/event_line_items_date_syncer_job.rb +0 -8
- data/app/jobs/spree_cm_commissioner/export_csv_job.rb +0 -7
- data/app/models/spree_cm_commissioner/exports/export_guest_csv.rb +0 -33
- data/app/services/spree_cm_commissioner/exports/export_guest_csv_service.rb +0 -48
- data/app/views/spree/events/check_ins/index.html.erb +0 -59
- data/app/views/spree/events/data_exports/index.html.erb +0 -54
- data/app/views/spree/events/errors/_error.html.erb +0 -7
- data/app/views/spree/events/errors/forbidden.html.erb +0 -1
- data/app/views/spree/events/errors/resource_not_found.html.erb +0 -1
- data/app/views/spree/events/guests/_check_in_status.html.erb +0 -44
- data/app/views/spree/events/guests/_form.html.erb +0 -37
- data/app/views/spree/events/guests/_swap_guest_bib_number.html.erb +0 -18
- data/app/views/spree/events/guests/edit.html.erb +0 -86
- data/app/views/spree/events/guests/index.html.erb +0 -102
- data/app/views/spree/events/shared/_event_switcher.html.erb +0 -39
- data/app/views/spree/events/shared/_filters.html.erb +0 -50
- data/app/views/spree/events/shared/_guest_tabs.html.erb +0 -19
- data/app/views/spree/events/shared/_header.html.erb +0 -10
- data/app/views/spree/events/shared/_main_menu.html.erb +0 -22
- data/app/views/spree/events/state_changes/index.html.erb +0 -48
- data/lib/spree_cm_commissioner/test_helper/factories/export_guest_csv_factory.rb +0 -9
- data/lib/spree_cm_commissioner/transit/service_calendar_form.rb +0 -51
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
<% content_for :page_title do %>
|
|
2
|
-
<%= Spree.t(:register_guests) %>
|
|
3
|
-
<% end %>
|
|
4
|
-
|
|
5
|
-
<% content_for :page_actions do%>
|
|
6
|
-
<%= link_to 'Generate CSV', generate_guest_csv_event_guests_path, method: :post, class: 'btn btn-outline-primary' %>
|
|
7
|
-
<% end %>
|
|
8
|
-
|
|
9
|
-
<% content_for :table_filter do %>
|
|
10
|
-
<%= render partial: 'spree/events/shared/filters' %>
|
|
11
|
-
<% end %>
|
|
12
|
-
|
|
13
|
-
<% if @collection.any? %>
|
|
14
|
-
<div class="table-responsive border rounded bg-white">
|
|
15
|
-
<table class="table" id="listing_products">
|
|
16
|
-
<thead class="text-muted">
|
|
17
|
-
<tr data-hook="admin_products_index_headers">
|
|
18
|
-
<th scope="col" class="text-left"><%= Spree.t(:full_name) %></th>
|
|
19
|
-
<th scope="col" class="text-left"><%= Spree.t(:date_of_birth) %></th>
|
|
20
|
-
<th scope="col" class="text-left"><%= Spree.t(:gender) %></th>
|
|
21
|
-
<th scope="col" class="text-left"><%= Spree.t(:occupation) %></th>
|
|
22
|
-
<th scope="col" class="text-left"><%= Spree.t(:id_card_type) %></th>
|
|
23
|
-
<th scope="col" class="text-left"><%= Spree.t(:id_card_image) %></th>
|
|
24
|
-
<th scope="col" class="text-left"><%= Spree.t(:entry_type) %></th>
|
|
25
|
-
<th scope="col" class="text-left"><%= Spree.t(:bib_number) %></th>
|
|
26
|
-
<th scope="col" class="text-left"><%= Spree.t(:check_in_at) %></th>
|
|
27
|
-
<th scope="col" class="text-left"><%= Spree.t(:action) %></th>
|
|
28
|
-
</tr>
|
|
29
|
-
</thead>
|
|
30
|
-
<tbody>
|
|
31
|
-
<% @collection.each do |guest| %>
|
|
32
|
-
<tr id="<%= spree_dom_id guest %>" data-hook="event_guests_index_rows">
|
|
33
|
-
<td class="text-left">
|
|
34
|
-
<%= guest.full_name %>
|
|
35
|
-
</td>
|
|
36
|
-
<td class="text-left">
|
|
37
|
-
<%= guest.dob&.strftime("%d %b %Y") %>
|
|
38
|
-
</td>
|
|
39
|
-
<td class="text-left">
|
|
40
|
-
<%= content_tag(:strong, class: "badge #{badge_color_based_on_gender(guest.gender)} font-weight-bold") do %>
|
|
41
|
-
<%= guest.gender %>
|
|
42
|
-
<% end %>
|
|
43
|
-
</td>
|
|
44
|
-
<td class="text-left">
|
|
45
|
-
<%= guest.other_occupation&.titleize || guest.occupation&.name %>
|
|
46
|
-
</td>
|
|
47
|
-
<td class="text-left">
|
|
48
|
-
<%= content_tag(:strong, class: "badge #{badge_color_base_on_id_card_status(guest.id_card&.card_type)} font-weight-bold") do %>
|
|
49
|
-
<%= guest.id_card&.card_type&.titleize %>
|
|
50
|
-
<% end %>
|
|
51
|
-
</td>
|
|
52
|
-
<td class="d-flex flex-row gap-5">
|
|
53
|
-
<% if guest&.id_card&.front_image %>
|
|
54
|
-
<div class="admin-product-image-container small-img">
|
|
55
|
-
<% if guest&.id_card&.front_image&.attachment %>
|
|
56
|
-
<%= link_to main_app.rails_blob_url(guest.id_card.front_image.attachment), target: "_blank" do %>
|
|
57
|
-
<%= image_tag main_app.rails_blob_url(guest.id_card.front_image.attachment) %>
|
|
58
|
-
<% end %>
|
|
59
|
-
<% end %>
|
|
60
|
-
</div>
|
|
61
|
-
<% end %>
|
|
62
|
-
<% if guest&.id_card&.back_image %>
|
|
63
|
-
<div class="admin-product-image-container small-img">
|
|
64
|
-
<% if guest&.id_card&.back_image&.attachment %>
|
|
65
|
-
<%= link_to main_app.rails_blob_url(guest.id_card.back_image.attachment), target: "_blank" do %>
|
|
66
|
-
<%= image_tag main_app.rails_blob_url(guest.id_card.back_image.attachment) %>
|
|
67
|
-
<% end %>
|
|
68
|
-
<% end %>
|
|
69
|
-
</div>
|
|
70
|
-
<% end %>
|
|
71
|
-
</td>
|
|
72
|
-
<td class="text-left">
|
|
73
|
-
<%= content_tag(:strong, class: "badge #{badge_color_base_on_entry_type(guest.entry_type)} font-weight-bold uppercase") do %>
|
|
74
|
-
<%= SpreeCmCommissioner::CheckIn.entry_types.key(guest.entry_type).titleize %>
|
|
75
|
-
<% end %>
|
|
76
|
-
</td>
|
|
77
|
-
<td class="text-left">
|
|
78
|
-
<% if guest.bib_number.present? %>
|
|
79
|
-
<%= guest.formatted_bib_number %>
|
|
80
|
-
<% else %>
|
|
81
|
-
<span>No BIB Number</span>
|
|
82
|
-
<% end %>
|
|
83
|
-
</td>
|
|
84
|
-
<td class="text-left">
|
|
85
|
-
<%= guest.created_at&.strftime('%d %b %Y %I:%M:%S %p') %>
|
|
86
|
-
</td>
|
|
87
|
-
<td class="text-left">
|
|
88
|
-
<%= guest.check_in&.created_at&.strftime('%d %b %Y %I:%M:%S %p') %>
|
|
89
|
-
</td>
|
|
90
|
-
<td class="text-left">
|
|
91
|
-
<%= link_to_edit guest, url: edit_event_guest_url(current_event.slug, guest), no_text: true, class: 'edit' %>
|
|
92
|
-
</td>
|
|
93
|
-
<% end %>
|
|
94
|
-
</tbody>
|
|
95
|
-
</table>
|
|
96
|
-
</div>
|
|
97
|
-
<%= render partial: 'spree/admin/shared/index_table_options', locals: { collection: @collection } %>
|
|
98
|
-
<% else %>
|
|
99
|
-
<div class="text-left no-objects-found m-5">
|
|
100
|
-
<%= Spree.t(:no_resource_found, resource: plural_resource_name(SpreeCmCommissioner::Guest)) %>
|
|
101
|
-
</div>
|
|
102
|
-
<% end %>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<div>
|
|
2
|
-
<span class="d-none d-lg-inline text-light">
|
|
3
|
-
<% if current_event&.category_icon %>
|
|
4
|
-
<img src="<%= main_app.rails_blob_url(current_event.category_icon.attachment) %>" alt="vendor's logo" style="width: 40px; padding: 2px" class="rounded-circle">
|
|
5
|
-
<% else %>
|
|
6
|
-
<%= svg_icon name: "building.svg", width: '25', height: '25' %>
|
|
7
|
-
<% end %>
|
|
8
|
-
</span>
|
|
9
|
-
<a class="px-0 py-1 ml-1 btn text-light" id="eventSelectorDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
10
|
-
<span class="d-sm-none"><%= svg_icon name: "store.svg", width: '18', height: '18' %></span>
|
|
11
|
-
<% if !current_event.nil? %>
|
|
12
|
-
<span class="d-none d-sm-inline">
|
|
13
|
-
<%= current_event.name %>
|
|
14
|
-
</span>
|
|
15
|
-
<% if spree_current_user.events.count > 1 %>
|
|
16
|
-
<%= svg_icon name: "chevron-down.svg", width: '12', height: '12', classes: 'ml-1 mb-0' %>
|
|
17
|
-
<% end %>
|
|
18
|
-
<% end %>
|
|
19
|
-
</a>
|
|
20
|
-
|
|
21
|
-
<% if spree_current_user.events.count > 1 %>
|
|
22
|
-
<div class="dropdown-menu dropdown-menu-left overflow-hidden ml-2" aria-labelledby="eventSelectorDropdown">
|
|
23
|
-
<% spree_current_user.events.each do |taxon| %>
|
|
24
|
-
<button type="button" class="py-3 px-4 dropdown-item rounded" data-slug="<%= taxon.slug %>" onclick="switchEvents(this)"><%= taxon.name %></button>
|
|
25
|
-
<% end %>
|
|
26
|
-
</div>
|
|
27
|
-
<% end %>
|
|
28
|
-
</div>
|
|
29
|
-
|
|
30
|
-
<script>
|
|
31
|
-
function switchEvents(button) {
|
|
32
|
-
var slug = button.getAttribute("data-slug");
|
|
33
|
-
var eventName = button.textContent.trim();
|
|
34
|
-
|
|
35
|
-
document.getElementById("eventSelectorDropdown").textContent = eventName;
|
|
36
|
-
|
|
37
|
-
window.location.href = "/events/" + slug + "/guests";
|
|
38
|
-
}
|
|
39
|
-
</script>
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
<% content_for :table_filter do %>
|
|
2
|
-
<div data-hook="admin_customers_index_search">
|
|
3
|
-
<%= search_form_for [:events_guests, @search], url: spree.event_guests_path do |f| %>
|
|
4
|
-
<div class="row">
|
|
5
|
-
<div class="col-12 col-lg-6">
|
|
6
|
-
<div class="form-group">
|
|
7
|
-
<%= f.label :first_name_cont, Spree.t(:first_name) %>
|
|
8
|
-
<%= f.search_field :first_name_cont, class: 'form-control js-quick-search-target js-filterable', placeholder: Spree.t(:first_name) %>
|
|
9
|
-
</div>
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
<div class="date-range-filter col-12 col-lg-6">
|
|
13
|
-
<div class="form-group">
|
|
14
|
-
<%= f.label :last_name_cont, Spree.t(:last_name) %>
|
|
15
|
-
<%= f.search_field :last_name_cont, class: "form-control js-filterable", placeholder: Spree.t(:last_name) %>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
<div class="row">
|
|
20
|
-
<div class="col-12 col-lg-6">
|
|
21
|
-
<div class="form-group">
|
|
22
|
-
<%= f.label :gender_eq, Spree.t(:gender) %>
|
|
23
|
-
<%= f.select :gender_eq, options_for_select(SpreeCmCommissioner::Guest.genders.map { |k, v| [Spree.t("spree.genders.#{k}"), v] }), { include_blank: Spree.t('match_choices.none') }, class: "form-control js-filterable" %>
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
<div class="col-12 col-lg-6">
|
|
28
|
-
<div class="form-group">
|
|
29
|
-
<%= f.label :occupation_id_eq, Spree.t(:occupation) %>
|
|
30
|
-
<%= f.select :occupation_id_eq,
|
|
31
|
-
options_from_collection_for_select(Spree::Taxon.where(kind: Spree::Taxon.kinds[:occupation]).order(:position), :id, :name),
|
|
32
|
-
{ include_blank: Spree.t('match_choices.none') },
|
|
33
|
-
class: 'select2 form-control' %>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
<div class="row">
|
|
38
|
-
<div class="col-12 col-lg-6">
|
|
39
|
-
<div class="form-group">
|
|
40
|
-
<%= f.label :id_card_card_type_eq, Spree.t(:id_card_type) %>
|
|
41
|
-
<%= f.select :id_card_card_type_eq, options_for_select(SpreeCmCommissioner::IdCard.card_types.map { |k, v| [Spree.t("spree.card_type.#{k}"), v] }), { include_blank: Spree.t('match_choices.none') }, class: "form-control js-filterable" %>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
<div data-hook="admin_customers_index_search_buttons" class="form-actions">
|
|
46
|
-
<%= button Spree.t(:search), 'search.svg' %>
|
|
47
|
-
</div>
|
|
48
|
-
<% end %>
|
|
49
|
-
</div>
|
|
50
|
-
<% end %>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<% content_for :page_tabs do %>
|
|
2
|
-
<% if can? :update, @guest %>
|
|
3
|
-
<li class="nav-item" data-hook='admin_guest_tabs_edit'>
|
|
4
|
-
<%= link_to_with_icon 'edit.svg',
|
|
5
|
-
Spree.t('edit'),
|
|
6
|
-
edit_event_guest_path(@event.slug, @guest),
|
|
7
|
-
class: "#{'active' if current == :edit} nav-link" %>
|
|
8
|
-
</li>
|
|
9
|
-
<% end %>
|
|
10
|
-
|
|
11
|
-
<% if can? :index, Spree::StateChange %>
|
|
12
|
-
<li class="nav-item" data-hook='admin_guest_tabs_state_changes'>
|
|
13
|
-
<%= link_to_with_icon 'calendar3.svg',
|
|
14
|
-
Spree::StateChange.human_attribute_name(:state_changes),
|
|
15
|
-
event_guest_state_changes_path(@event.slug, @guest),
|
|
16
|
-
class: "#{'active' if current == :state_changes} nav-link" %>
|
|
17
|
-
</li>
|
|
18
|
-
<% end %>
|
|
19
|
-
<% end %>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<header class="header logged-in">
|
|
2
|
-
<nav class="navbar fixed-top navbar-dark flex-nowrap bg-primary p-0">
|
|
3
|
-
<div class="col-auto text-center text-lg-left px-0 px-lg-2 align-items-center dropdown">
|
|
4
|
-
<%= render partial: 'spree/events/shared/event_switcher' %>
|
|
5
|
-
</div>
|
|
6
|
-
<div class="col text-right p-0">
|
|
7
|
-
<%= render partial: 'spree/admin/shared/account_nav' %>
|
|
8
|
-
</div>
|
|
9
|
-
</nav>
|
|
10
|
-
</header>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<nav class="pb-3 pt-lg-3 px-1 h6">
|
|
2
|
-
<div class="text-right d-lg-none pl-3 py-2 border-bottom d-flex align-items-center">
|
|
3
|
-
<div class="d-flex flex-grow-1 text-primary"></div>
|
|
4
|
-
<button
|
|
5
|
-
id="sidebar-close"
|
|
6
|
-
class="btn btn-link d-flex"
|
|
7
|
-
type="button"
|
|
8
|
-
aria-expanded="false"
|
|
9
|
-
aria-label="Toggle navigation">
|
|
10
|
-
<%= svg_icon name: "cancel.svg", width: '20', height: '20', classes: 'p-0 m-0' %>
|
|
11
|
-
</button>
|
|
12
|
-
</div>
|
|
13
|
-
<ul class="nav nav-sidebar mb-3">
|
|
14
|
-
<%= tab :guests, url: event_guests_path, icon: 'people.svg' %>
|
|
15
|
-
</ul>
|
|
16
|
-
<ul class="nav nav-sidebar mb-3">
|
|
17
|
-
<%= tab :check_ins, url: event_check_ins_path, icon: 'card-checklist.svg' %>
|
|
18
|
-
</ul>
|
|
19
|
-
<ul class="nav nav-sidebar mb-3">
|
|
20
|
-
<%= tab :data_exports, url: event_data_exports_path, icon: 'cloud-download.svg' %>
|
|
21
|
-
</ul>
|
|
22
|
-
</nav>
|
|
@@ -1,48 +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: :state_changes } %>
|
|
6
|
-
|
|
7
|
-
<% if @state_changes.any? %>
|
|
8
|
-
<div class="table-responsive border rounded bg-white">
|
|
9
|
-
<table class="table" id="listing_order_state_changes" data-hook>
|
|
10
|
-
<thead class="text-muted">
|
|
11
|
-
<tr data-hook="admin_orders_state_changes_headers">
|
|
12
|
-
<th><%= Spree::StateChange.human_attribute_name(:type) %></th>
|
|
13
|
-
<th><%= Spree::StateChange.human_attribute_name(:state_from) %></th>
|
|
14
|
-
<th><%= Spree::StateChange.human_attribute_name(:state_to) %></th>
|
|
15
|
-
<th><%= Spree::StateChange.human_attribute_name(:by_user) %></th>
|
|
16
|
-
<th><%= Spree::StateChange.human_attribute_name(:timestamp) %></th>
|
|
17
|
-
</tr>
|
|
18
|
-
</thead>
|
|
19
|
-
|
|
20
|
-
<tbody>
|
|
21
|
-
<% @state_changes.each do |state_change| %>
|
|
22
|
-
<% scope = state_change.name == 'guest' ? "#{ state_change.name }_state" : "#{ state_change.name }_states" -%>
|
|
23
|
-
<tr>
|
|
24
|
-
<td><%= Spree.t("state_machine_states.#{state_change.name}") %></td>
|
|
25
|
-
<td><%= state_change.previous_state %></td>
|
|
26
|
-
<td><%= state_change.next_state %></td>
|
|
27
|
-
<td>
|
|
28
|
-
<% if state_change.user %>
|
|
29
|
-
<% user_login = state_change.user.try(:login) || state_change.user.try(:email) %>
|
|
30
|
-
<%= link_to user_login, spree.admin_user_path(state_change.user) %>
|
|
31
|
-
<% end %>
|
|
32
|
-
</td>
|
|
33
|
-
<td>
|
|
34
|
-
<%= pretty_time(state_change.created_at) %>
|
|
35
|
-
<% if state_change.created_at != state_change.updated_at %>
|
|
36
|
-
<small><%= Spree::StateChange.human_attribute_name(:updated) %>: <%= pretty_time(state_change.updated_at) %></small>
|
|
37
|
-
<% end %>
|
|
38
|
-
</td>
|
|
39
|
-
</tr>
|
|
40
|
-
<% end %>
|
|
41
|
-
</tbody>
|
|
42
|
-
</table>
|
|
43
|
-
</div>
|
|
44
|
-
<% else %>
|
|
45
|
-
<div class="text-center no-objects-found m-5">
|
|
46
|
-
<%= Spree.t(:no_state_changes) %>
|
|
47
|
-
</div>
|
|
48
|
-
<% end %>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
FactoryBot.define do
|
|
2
|
-
factory :export_guest_csv, class: SpreeCmCommissioner::Exports::ExportGuestCsv do |f|
|
|
3
|
-
f.name { 'guest-csv'}
|
|
4
|
-
f.file_name { 'guest-csv.csv' }
|
|
5
|
-
f.file_path { 'tmp/guest-csv.csv' }
|
|
6
|
-
f.export_type { 'SpreeCmCommissioner::Exports::ExportGuestCsv' }
|
|
7
|
-
f.status { 0 }
|
|
8
|
-
end
|
|
9
|
-
end
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
module SpreeCmCommissioner::Transit
|
|
2
|
-
class ServiceCalendarForm
|
|
3
|
-
include ActiveModel::Model
|
|
4
|
-
|
|
5
|
-
attr_accessor :name,
|
|
6
|
-
:start_date,
|
|
7
|
-
:end_date,
|
|
8
|
-
:monday,
|
|
9
|
-
:tuesday,
|
|
10
|
-
:wednesday,
|
|
11
|
-
:thursday,
|
|
12
|
-
:friday,
|
|
13
|
-
:saturday,
|
|
14
|
-
:sunday,
|
|
15
|
-
:exception_rules
|
|
16
|
-
|
|
17
|
-
def initialize(attrs = {})
|
|
18
|
-
super
|
|
19
|
-
@exception_rules ||= []
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def weekdays
|
|
23
|
-
{
|
|
24
|
-
'monday' => monday,
|
|
25
|
-
'tuesday' => tuesday,
|
|
26
|
-
'wednesday' => wednesday,
|
|
27
|
-
'thursday' => thursday,
|
|
28
|
-
'friday' => friday,
|
|
29
|
-
'saturday' => saturday,
|
|
30
|
-
'sunday' => sunday
|
|
31
|
-
}
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def weekdays=(hash)
|
|
35
|
-
hash = hash.transform_keys(&:to_s)
|
|
36
|
-
@monday = cast_bool(hash['monday'])
|
|
37
|
-
@tuesday = cast_bool(hash['tuesday'])
|
|
38
|
-
@wednesday = cast_bool(hash['wednesday'])
|
|
39
|
-
@thursday = cast_bool(hash['thursday'])
|
|
40
|
-
@friday = cast_bool(hash['friday'])
|
|
41
|
-
@saturday = cast_bool(hash['saturday'])
|
|
42
|
-
@sunday = cast_bool(hash['sunday'])
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
private
|
|
46
|
-
|
|
47
|
-
def cast_bool(val)
|
|
48
|
-
ActiveModel::Type::Boolean.new.cast(val)
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|