kaui 3.0.9 → 4.0.0
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/app/assets/images/kaui/account/authorize.svg +4 -0
- data/app/assets/images/kaui/account/credit.svg +4 -0
- data/app/assets/images/kaui/account/down-arrow.svg +3 -0
- data/app/assets/images/kaui/account/edit.svg +4 -0
- data/app/assets/images/kaui/account/pay-all.svg +5 -0
- data/app/assets/images/kaui/account/plus.svg +3 -0
- data/app/assets/images/kaui/account/purchase.svg +5 -0
- data/app/assets/images/kaui/account/refresh.svg +5 -0
- data/app/assets/images/kaui/arrow.svg +3 -0
- data/app/assets/images/kaui/card.svg +5 -0
- data/app/assets/images/kaui/copy.svg +12 -0
- data/app/assets/images/kaui/dashboard/aviate.svg +6 -0
- data/app/assets/images/kaui/dashboard/custom-field.svg +5 -0
- data/app/assets/images/kaui/dashboard/kaui-doc-img.png +0 -0
- data/app/assets/images/kaui/dashboard/plugins.svg +7 -0
- data/app/assets/images/kaui/dashboard/tags.svg +4 -0
- data/app/assets/images/kaui/dashboard/users.svg +6 -0
- data/app/assets/images/kaui/delete.svg +6 -0
- data/app/assets/images/kaui/dots.svg +5 -0
- data/app/assets/images/kaui/download-csv.svg +5 -0
- data/app/assets/images/kaui/download.svg +4 -0
- data/app/assets/images/kaui/eye-off.svg +9 -0
- data/app/assets/images/kaui/eye.svg +7 -0
- data/app/assets/images/kaui/file-upload.svg +34 -0
- data/app/assets/images/kaui/generate.svg +5 -0
- data/app/assets/images/kaui/header/account.svg +4 -0
- data/app/assets/images/kaui/header/cog_icon.svg +4 -0
- data/app/assets/images/kaui/header/invoice.svg +5 -0
- data/app/assets/images/kaui/header/payment.svg +5 -0
- data/app/assets/images/kaui/header/search_icon.svg +4 -0
- data/app/assets/images/kaui/header/subscription.svg +6 -0
- data/app/assets/images/kaui/logout.svg +4 -0
- data/app/assets/images/kaui/modal/close.svg +3 -0
- data/app/assets/images/kaui/modal/plus.svg +3 -0
- data/app/assets/images/kaui/modal/red-close.svg +10 -0
- data/app/assets/images/kaui/modal/search.svg +4 -0
- data/app/assets/images/kaui/payment/payment.svg +4 -0
- data/app/assets/images/kaui/payment/refund.svg +4 -0
- data/app/assets/images/kaui/plus.svg +3 -0
- data/app/assets/images/kaui/search.svg +4 -0
- data/app/assets/images/kaui/setting/account.svg +10 -0
- data/app/assets/images/kaui/setting/analytics.svg +7 -0
- data/app/assets/images/kaui/setting/custom-field.svg +5 -0
- data/app/assets/images/kaui/setting/e-notifications.svg +6 -0
- data/app/assets/images/kaui/setting/plugins.svg +7 -0
- data/app/assets/images/kaui/setting/plus.svg +3 -0
- data/app/assets/images/kaui/setting/reset.svg +4 -0
- data/app/assets/images/kaui/setting/tag-definitions.svg +5 -0
- data/app/assets/images/kaui/setting/tags.svg +4 -0
- data/app/assets/images/kaui/setting/tenants.svg +6 -0
- data/app/assets/images/kaui/setting/users.svg +6 -0
- data/app/assets/images/kaui/setting.svg +4 -0
- data/app/assets/images/kaui/sidebar/account.svg +4 -0
- data/app/assets/images/kaui/sidebar/audit.svg +5 -0
- data/app/assets/images/kaui/sidebar/custom-fields.svg +5 -0
- data/app/assets/images/kaui/sidebar/invoices.svg +5 -0
- data/app/assets/images/kaui/sidebar/payments.svg +5 -0
- data/app/assets/images/kaui/sidebar/queues.svg +5 -0
- data/app/assets/images/kaui/sidebar/subscriptions.svg +6 -0
- data/app/assets/images/kaui/sidebar/tags.svg +5 -0
- data/app/assets/images/kaui/sidebar/timeline.svg +5 -0
- data/app/assets/images/kaui/sign_in_background.svg +57 -0
- data/app/assets/images/kaui/sort-down.svg +3 -0
- data/app/assets/images/kaui/sort-up.svg +3 -0
- data/app/assets/images/kaui/subscription/add-on.svg +7 -0
- data/app/assets/images/kaui/subscription/cancel.svg +6 -0
- data/app/assets/images/kaui/subscription/change.svg +6 -0
- data/app/assets/images/kaui/subscription/date.svg +6 -0
- data/app/assets/images/kaui/subscription/pause.svg +4 -0
- data/app/assets/images/kaui/timeline/authorize.svg +5 -0
- data/app/assets/images/kaui/timeline/capture.svg +5 -0
- data/app/assets/images/kaui/timeline/chargeback.svg +3 -0
- data/app/assets/images/kaui/timeline/credit.svg +6 -0
- data/app/assets/images/kaui/timeline/invoice.svg +5 -0
- data/app/assets/images/kaui/timeline/purchase.svg +5 -0
- data/app/assets/images/kaui/timeline/refund.svg +4 -0
- data/app/assets/images/kaui/timeline/void.svg +4 -0
- data/app/assets/images/kaui/view-doc.svg +6 -0
- data/app/assets/images/kaui/warning.png +0 -0
- data/app/assets/javascripts/application.js +2 -2
- data/app/assets/javascripts/kaui/kaui_override.js +232 -0
- data/app/assets/javascripts/kaui/multi_functions_bar_utils.js +125 -24
- data/app/assets/stylesheets/application.css +13 -1
- data/app/assets/stylesheets/kaui/account.css +2028 -14
- data/app/assets/stylesheets/kaui/account_timeline.css +183 -0
- data/app/assets/stylesheets/kaui/admin_allowed_users.css +260 -0
- data/app/assets/stylesheets/kaui/audit.css +26 -16
- data/app/assets/stylesheets/kaui/audit_logs.css +443 -0
- data/app/assets/stylesheets/kaui/auth_pages.css +72 -0
- data/app/assets/stylesheets/kaui/breadcrumb.css +38 -0
- data/app/assets/stylesheets/kaui/chargebacks.css +118 -0
- data/app/assets/stylesheets/kaui/clock.css +103 -0
- data/app/assets/stylesheets/kaui/common.css +1744 -401
- data/app/assets/stylesheets/kaui/custom_fields.css +546 -0
- data/app/assets/stylesheets/kaui/dashboard.css +26 -0
- data/app/assets/stylesheets/kaui/datatable.css +114 -56
- data/app/assets/stylesheets/kaui/header.css +221 -114
- data/app/assets/stylesheets/kaui/home.css +89 -62
- data/app/assets/stylesheets/kaui/invoice.css +1061 -27
- data/app/assets/stylesheets/kaui/kaui.css +217 -145
- data/app/assets/stylesheets/kaui/overdue.css +5 -3
- data/app/assets/stylesheets/kaui/payment.css +1102 -13
- data/app/assets/stylesheets/kaui/queues.css +269 -0
- data/app/assets/stylesheets/kaui/refunds.css +185 -0
- data/app/assets/stylesheets/kaui/role_definitions.css +111 -0
- data/app/assets/stylesheets/kaui/sidebar.css +122 -0
- data/app/assets/stylesheets/kaui/subscription.css +677 -0
- data/app/assets/stylesheets/kaui/tag_definitions.css +524 -0
- data/app/assets/stylesheets/kaui/tags.css +592 -121
- data/app/assets/stylesheets/kaui/tenants.css +1478 -0
- data/app/assets/stylesheets/kaui/tooltip.css +9 -5
- data/app/assets/stylesheets/kaui/wallets.css +121 -0
- data/app/controllers/kaui/accounts_controller.rb +3 -2
- data/app/controllers/kaui/admin_tenants_controller.rb +33 -0
- data/app/controllers/kaui/custom_fields_controller.rb +1 -1
- data/app/controllers/kaui/engine_controller.rb +1 -2
- data/app/controllers/kaui/engine_controller_util.rb +5 -7
- data/app/controllers/kaui/home_controller.rb +24 -17
- data/app/controllers/kaui/invoices_controller.rb +4 -15
- data/app/controllers/kaui/payments_controller.rb +1 -1
- data/app/controllers/kaui/sessions_controller.rb +1 -0
- data/app/controllers/kaui/tag_definitions_controller.rb +1 -0
- data/app/helpers/kaui/account_helper.rb +13 -0
- data/app/helpers/kaui/plugin_helper.rb +27 -0
- data/app/views/kaui/account_custom_fields/index.html.erb +95 -29
- data/app/views/kaui/account_emails/_account_emails_table.html.erb +13 -3
- data/app/views/kaui/account_emails/_form.html.erb +23 -6
- data/app/views/kaui/account_emails/new.html.erb +12 -6
- data/app/views/kaui/account_tags/_form_bar.html.erb +10 -1
- data/app/views/kaui/account_tags/index.html.erb +103 -24
- data/app/views/kaui/account_timelines/_multi_functions_bar.html.erb +302 -69
- data/app/views/kaui/account_timelines/show.html.erb +360 -254
- data/app/views/kaui/accounts/_account_details.html.erb +165 -0
- data/app/views/kaui/accounts/_account_filterbar.html.erb +70 -80
- data/app/views/kaui/accounts/_add_parent.html.erb +26 -0
- data/app/views/kaui/accounts/_billing_details.html.erb +196 -0
- data/app/views/kaui/accounts/_close_account_modal.html.erb +62 -40
- data/app/views/kaui/accounts/_form_account.html.erb +157 -0
- data/app/views/kaui/accounts/_functions_bar.html.erb +606 -0
- data/app/views/kaui/accounts/_link_parent_modal.html.erb +1 -1
- data/app/views/kaui/accounts/_link_parent_to_modal.html.erb +62 -0
- data/app/views/kaui/accounts/_multi_functions_bar.html.erb +67 -28
- data/app/views/kaui/accounts/_payment_gateways.html.erb +43 -0
- data/app/views/kaui/accounts/_personal_details.html.erb +67 -0
- data/app/views/kaui/accounts/edit.html.erb +15 -9
- data/app/views/kaui/accounts/index.html.erb +77 -27
- data/app/views/kaui/accounts/new.html.erb +14 -8
- data/app/views/kaui/accounts/show.html.erb +17 -11
- data/app/views/kaui/admin/index.html.erb +44 -19
- data/app/views/kaui/admin_allowed_users/_form.html.erb +123 -31
- data/app/views/kaui/admin_allowed_users/edit.html.erb +15 -9
- data/app/views/kaui/admin_allowed_users/index.html.erb +150 -30
- data/app/views/kaui/admin_allowed_users/new.html.erb +14 -8
- data/app/views/kaui/admin_allowed_users/show.html.erb +137 -32
- data/app/views/kaui/admin_tenants/_add_allowed_user_modal.html.erb +42 -15
- data/app/views/kaui/admin_tenants/_clock.html.erb +72 -0
- data/app/views/kaui/admin_tenants/_form.html.erb +32 -20
- data/app/views/kaui/admin_tenants/_form_catalog_translation.erb +21 -8
- data/app/views/kaui/admin_tenants/_form_invoice_template.erb +25 -9
- data/app/views/kaui/admin_tenants/_form_invoice_translation.erb +36 -20
- data/app/views/kaui/admin_tenants/_form_plugin_config.erb +16 -20
- data/app/views/kaui/admin_tenants/_show_catalog.erb +13 -6
- data/app/views/kaui/admin_tenants/_show_catalog_simple.erb +95 -46
- data/app/views/kaui/admin_tenants/_show_catalog_xml.erb +62 -37
- data/app/views/kaui/admin_tenants/_show_overdue.erb +91 -75
- data/app/views/kaui/admin_tenants/_tenant_details.html.erb +106 -17
- data/app/views/kaui/admin_tenants/_tenants_table.html.erb +67 -6
- data/app/views/kaui/admin_tenants/_useful_links.html.erb +21 -16
- data/app/views/kaui/admin_tenants/index.html.erb +35 -11
- data/app/views/kaui/admin_tenants/index.js.erb +3 -0
- data/app/views/kaui/admin_tenants/new.html.erb +19 -13
- data/app/views/kaui/admin_tenants/new_catalog.html.erb +230 -98
- data/app/views/kaui/admin_tenants/new_overdue_config.html.erb +152 -80
- data/app/views/kaui/admin_tenants/new_plan_currency.html.erb +44 -30
- data/app/views/kaui/admin_tenants/show.html.erb +211 -78
- data/app/views/kaui/admin_tenants/show.js.erb +3 -0
- data/app/views/kaui/audit_logs/_multi_functions_bar.html.erb +298 -101
- data/app/views/kaui/audit_logs/index.html.erb +137 -38
- data/app/views/kaui/bundle_tags/_form_bar.html.erb +11 -4
- data/app/views/kaui/bundles/_bundle_details.html.erb +24 -12
- data/app/views/kaui/bundles/index.html.erb +79 -104
- data/app/views/kaui/bundles/pause_resume.html.erb +73 -38
- data/app/views/kaui/chargebacks/_form.html.erb +35 -18
- data/app/views/kaui/chargebacks/new.html.erb +16 -9
- data/app/views/kaui/charges/_form.html.erb +54 -42
- data/app/views/kaui/charges/new.html.erb +15 -8
- data/app/views/kaui/components/breadcrumb/_breadcrumb.html.erb +146 -0
- data/app/views/kaui/components/button/_button.html.erb +16 -0
- data/app/views/kaui/components/dashboard/_card.html.erb +15 -0
- data/app/views/kaui/components/dashboard/_setting.html.erb +15 -0
- data/app/views/kaui/components/form_input/_form_input.html.erb +4 -0
- data/app/views/kaui/components/form_password/_form_password.html.erb +6 -0
- data/app/views/kaui/components/logo/_logo.html.erb +1 -0
- data/app/views/kaui/components/menu_dropdown/_menu_dropdown.html.erb +59 -0
- data/app/views/kaui/components/search_input/_search_input.html.erb +81 -0
- data/app/views/kaui/credits/_form.html.erb +42 -25
- data/app/views/kaui/credits/new.html.erb +15 -8
- data/app/views/kaui/custom_fields/_form.html.erb +37 -25
- data/app/views/kaui/custom_fields/_list_bar.html.erb +11 -10
- data/app/views/kaui/custom_fields/index.html.erb +121 -27
- data/app/views/kaui/custom_fields/new.html.erb +19 -8
- data/app/views/kaui/errors/500.html.erb +1 -1
- data/app/views/kaui/home/index.html.erb +77 -30
- data/app/views/kaui/invoice_items/_edit_form.html.erb +30 -14
- data/app/views/kaui/invoice_items/edit.html.erb +15 -7
- data/app/views/kaui/invoice_tags/_form_bar.html.erb +13 -3
- data/app/views/kaui/invoices/_invoice_filterbar.html.erb +53 -69
- data/app/views/kaui/invoices/_invoice_table.html.erb +77 -92
- data/app/views/kaui/invoices/_multi_functions_bar.html.erb +351 -140
- data/app/views/kaui/invoices/index.html.erb +89 -27
- data/app/views/kaui/invoices/show.html.erb +392 -80
- data/app/views/kaui/layouts/kaui_account_sidebar.html.erb +42 -0
- data/app/views/kaui/layouts/kaui_application.html.erb +29 -15
- data/app/views/kaui/layouts/kaui_flash.html.erb +82 -31
- data/app/views/kaui/layouts/kaui_navbar.html.erb +109 -82
- data/app/views/kaui/layouts/kaui_setting_sidebar.html.erb +36 -0
- data/app/views/kaui/payment_methods/_form.html.erb +32 -11
- data/app/views/kaui/payment_methods/_new_creditcard_payment_method.html.erb +35 -34
- data/app/views/kaui/payment_methods/_payment_methods_details_table.html.erb +27 -29
- data/app/views/kaui/payment_methods/_payment_methods_table.html.erb +116 -38
- data/app/views/kaui/payment_methods/_plugin_properties.html.erb +19 -9
- data/app/views/kaui/payment_methods/new.html.erb +14 -8
- data/app/views/kaui/payments/_form.html.erb +30 -13
- data/app/views/kaui/payments/_multi_functions_bar.html.erb +351 -141
- data/app/views/kaui/payments/_payment_filterbar.html.erb +63 -79
- data/app/views/kaui/payments/_payment_invoice_table.html.erb +105 -0
- data/app/views/kaui/payments/_payment_table.html.erb +4 -67
- data/app/views/kaui/payments/index.html.erb +90 -26
- data/app/views/kaui/payments/new.html.erb +15 -8
- data/app/views/kaui/payments/show.html.erb +222 -28
- data/app/views/kaui/queues/index.html.erb +329 -111
- data/app/views/kaui/refunds/_form.html.erb +68 -45
- data/app/views/kaui/refunds/new.html.erb +15 -8
- data/app/views/kaui/role_definitions/_form.html.erb +104 -17
- data/app/views/kaui/role_definitions/new.html.erb +15 -8
- data/app/views/kaui/sessions/_form.html.erb +9 -19
- data/app/views/kaui/sessions/new.html.erb +10 -9
- data/app/views/kaui/subscriptions/_cancel_by_date_modal.html.erb +65 -35
- data/app/views/kaui/subscriptions/_edit_form.html.erb +66 -35
- data/app/views/kaui/subscriptions/_form.html.erb +63 -32
- data/app/views/kaui/subscriptions/_subscriptions_table.html.erb +215 -57
- data/app/views/kaui/subscriptions/edit.html.erb +19 -8
- data/app/views/kaui/subscriptions/edit_bcd.erb +46 -16
- data/app/views/kaui/subscriptions/new.html.erb +22 -15
- data/app/views/kaui/tag_definitions/_form.html.erb +51 -30
- data/app/views/kaui/tag_definitions/index.html.erb +151 -40
- data/app/views/kaui/tag_definitions/new.html.erb +15 -8
- data/app/views/kaui/tags/index.html.erb +136 -47
- data/app/views/kaui/tenants/_form.html.erb +8 -5
- data/app/views/kaui/tenants/index.html.erb +15 -9
- data/app/views/kaui/transactions/_control_plugin_names.html.erb +18 -10
- data/app/views/kaui/transactions/_form.html.erb +86 -25
- data/app/views/kaui/transactions/new.html.erb +15 -9
- data/config/routes.rb +1 -0
- data/lib/kaui/engine.rb +11 -0
- data/lib/kaui/version.rb +1 -1
- data/lib/kaui.rb +0 -1
- metadata +120 -2
|
@@ -1,57 +1,128 @@
|
|
|
1
|
-
<div class="
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<div class="dropdown-container">
|
|
2
|
+
<%= render "kaui/components/button/button", {
|
|
3
|
+
label: "Download CSV",
|
|
4
|
+
icon: "kaui/download.svg",
|
|
5
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1 mx-2",
|
|
6
|
+
type: "button",
|
|
7
|
+
html_class: "kaui-button custom-hover",
|
|
8
|
+
html_options: {
|
|
9
|
+
id: "modalDownloadButton"
|
|
10
|
+
}
|
|
11
|
+
} %>
|
|
6
12
|
</div>
|
|
7
13
|
|
|
8
14
|
<div class="modal fade" id="downloadCsvModal" tabindex="-1" role="dialog" aria-labelledby="downloadCsvModalLabel" aria-hidden="true">
|
|
9
15
|
<div class="modal-dialog" role="document">
|
|
10
16
|
<div class="modal-content">
|
|
11
17
|
<div class="modal-header">
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
<h5 class="modal-title d-flex align-items-center gap-3" id="downloadCsvModalLabel">
|
|
19
|
+
<span class="icon-container">
|
|
20
|
+
<%= image_tag("kaui/download-csv.svg") %>
|
|
21
|
+
</span>
|
|
22
|
+
Download
|
|
23
|
+
</h5>
|
|
24
|
+
<button type="button" class="close close-button custom-hover" data-bs-dismiss="modal" aria-label="Close">
|
|
25
|
+
<span aria-hidden="true">
|
|
26
|
+
<%= image_tag("kaui/modal/close.svg", width: 20, height: 20) %>
|
|
27
|
+
</span>
|
|
15
28
|
</button>
|
|
16
29
|
</div>
|
|
17
30
|
<div class="modal-body">
|
|
18
31
|
<form id="downloadCsvForm">
|
|
19
32
|
<div class="row">
|
|
20
|
-
<div class="
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
<div class="d-flex align-items-center">
|
|
34
|
+
<label for="searchFieldSelect" class="field-label col-sm-3">Account Timeline Date</label>
|
|
35
|
+
<div class="fake-select-wrapper col-sm-9">
|
|
36
|
+
<input type="checkbox" id="single-toggle" hidden />
|
|
37
|
+
<div class="d-flex align-items-center position-relative">
|
|
38
|
+
<label for="single-toggle" class="fake-select-display">
|
|
39
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
40
|
+
<path d="M14.5833 12.5V18.3333M17.5 15.4167H11.6666" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
41
|
+
<path d="M13.75 1.6665V4.99984M6.25 1.6665V4.99984" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
42
|
+
<path d="M17.5 10.8335V5.00016C17.5 4.07969 16.7538 3.3335 15.8333 3.3335H4.16667C3.24619 3.3335 2.5 4.07969 2.5 5.00016V16.6668C2.5 17.5873 3.24619 18.3335 4.16667 18.3335H10" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
43
|
+
<path d="M2.5 8.3335H17.5" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
44
|
+
</svg>
|
|
45
|
+
</label>
|
|
46
|
+
<input type="text" class="form-control center-input" id="startDate" placeholder="All Accounts" name="startDate">
|
|
47
|
+
<div id="dash" class="dash">–</div>
|
|
48
|
+
<input type="text" class="form-control right-input" id="endDate" placeholder="" name="endDate">
|
|
49
|
+
<div id="toggle-wrapper" class="position-absolute" style="width: 100%; height: 100%;" onclick="document.getElementById('single-toggle').click()"></div>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<% today = Date.today %>
|
|
53
|
+
|
|
54
|
+
<% start_of_year = Date.new(today.year, 1, 1) %>
|
|
55
|
+
<% end_of_year = Date.new(today.year, 12, 31) %>
|
|
56
|
+
<% this_year_range = "#{start_of_year.strftime('%b %-d, %Y')} – #{end_of_year.strftime('%b %-d, %Y')}" %>
|
|
57
|
+
|
|
58
|
+
<% start_of_month = Date.new(today.year, today.month, 1) %>
|
|
59
|
+
<% end_of_month = Date.new(today.year, today.month, -1) %>
|
|
60
|
+
<% this_month_range = "#{start_of_month.strftime('%b %-d, %Y')} – #{end_of_month.strftime('%b %-d, %Y')}" %>
|
|
61
|
+
|
|
62
|
+
<% start_of_week = today - ((today.wday - 1) % 7) %>
|
|
63
|
+
<% end_of_week = start_of_week + 6 %>
|
|
64
|
+
<% this_week_range = "#{start_of_week.strftime('%b %-d, %Y')} – #{end_of_week.strftime('%b %-d, %Y')}" %>
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
<div class="fake-select-dropdown">
|
|
68
|
+
<label class="fake-select-option">
|
|
69
|
+
<input type="radio" name="download_option" id="allData" />
|
|
70
|
+
<span>All accounts</span>
|
|
71
|
+
</label>
|
|
72
|
+
|
|
73
|
+
<label class="fake-select-option">
|
|
74
|
+
<input type="radio" name="download_option" id="thisWeek" />
|
|
75
|
+
<span>This week <small>(<%= this_week_range %>)</small></span>
|
|
76
|
+
</label>
|
|
77
|
+
|
|
78
|
+
<label class="fake-select-option">
|
|
79
|
+
<input type="radio" name="download_option" id="thisMonth" />
|
|
80
|
+
<span>This month <small>(<%= this_month_range %>)</small></span>
|
|
81
|
+
</label>
|
|
82
|
+
|
|
83
|
+
<label class="fake-select-option">
|
|
84
|
+
<input type="radio" name="download_option" id="thisYear" />
|
|
85
|
+
<span>This year <small>(<%= this_year_range %>)</small></span>
|
|
86
|
+
</label>
|
|
87
|
+
<label class="fake-select-option">
|
|
88
|
+
<input type="radio" name="download_option" id="customDate" />
|
|
89
|
+
<span>Custom date</span>
|
|
90
|
+
</label>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
31
93
|
</div>
|
|
32
94
|
</div>
|
|
33
95
|
<div class="row">
|
|
34
|
-
<div class="
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
96
|
+
<div class="d-flex align-items-center">
|
|
97
|
+
<label for="searchFieldSelect" class="field-label col-sm-3">Include fields</label>
|
|
98
|
+
<div class="col-md-9">
|
|
99
|
+
<div class="chip-select">
|
|
100
|
+
<input type="checkbox" id="dropdown-toggle" hidden />
|
|
101
|
+
|
|
102
|
+
<label for="dropdown-toggle" class="chip-input-box position-relative" style="position: relative; overflow: hidden;">
|
|
103
|
+
<div class="chip-list" id="selected-fields-chips">
|
|
104
|
+
<%# This will be dynamically populated with chips for selected fields %>
|
|
105
|
+
<span class="chip" style="color: #999;">No fields selected</span>
|
|
106
|
+
<svg width="16" height="16" class="position-absolute" style="top: 0.625rem; right: 0.625rem;" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
107
|
+
<path d="M4 6L8 10L12 6" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
108
|
+
</svg>
|
|
109
|
+
</div>
|
|
110
|
+
<div id="" class="position-absolute" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;"></div>
|
|
111
|
+
</label>
|
|
112
|
+
<div class="chip-dropdown">
|
|
113
|
+
<label class="chip-option">
|
|
114
|
+
<input type="checkbox" id="allFields" />
|
|
115
|
+
All fields
|
|
116
|
+
</label>
|
|
117
|
+
<div class="mt-2" id="field-selection">
|
|
118
|
+
<% ['Effective Date', 'Bundles', 'Event Type', 'Details', 'Reason Code/ Comments'].each_with_index do |title, index| %>
|
|
119
|
+
<label class="chip-option d-flex align-items-center gap-2">
|
|
120
|
+
<input type="checkbox" class="field-toggle" data-field-index="<%= index %>" checked />
|
|
121
|
+
<span><%= title %></span>
|
|
122
|
+
</label>
|
|
123
|
+
<% end %>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
55
126
|
</div>
|
|
56
127
|
</div>
|
|
57
128
|
</div>
|
|
@@ -59,30 +130,31 @@
|
|
|
59
130
|
</form>
|
|
60
131
|
</div>
|
|
61
132
|
<div class="modal-footer">
|
|
62
|
-
|
|
63
|
-
|
|
133
|
+
<%= render "kaui/components/button/button", {
|
|
134
|
+
label: 'Close',
|
|
135
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
136
|
+
type: "button",
|
|
137
|
+
html_class: "kaui-button custom-hover mx-2 my-0",
|
|
138
|
+
html_options: {
|
|
139
|
+
data: {
|
|
140
|
+
bs_dismiss: "modal"
|
|
141
|
+
},
|
|
142
|
+
}
|
|
143
|
+
} %>
|
|
144
|
+
<%= render "kaui/components/button/button", {
|
|
145
|
+
label: 'Download CSV',
|
|
146
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
147
|
+
type: "button",
|
|
148
|
+
html_class: "kaui-dropdown custom-hover m-0",
|
|
149
|
+
html_options: {
|
|
150
|
+
id: "downloadButton"
|
|
151
|
+
}
|
|
152
|
+
} %>
|
|
64
153
|
</div>
|
|
65
154
|
</div>
|
|
66
155
|
</div>
|
|
67
156
|
</div>
|
|
68
157
|
|
|
69
|
-
<style>
|
|
70
|
-
.download-button-right {
|
|
71
|
-
float: right;
|
|
72
|
-
margin-left: 10px;
|
|
73
|
-
background-color: white;
|
|
74
|
-
color: black;
|
|
75
|
-
text-transform: none;
|
|
76
|
-
border: 1px solid #ccc;
|
|
77
|
-
padding: 8px 15px;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.functions-container {
|
|
81
|
-
display: flex;
|
|
82
|
-
justify-content: flex-end;
|
|
83
|
-
}
|
|
84
|
-
</style>
|
|
85
|
-
|
|
86
158
|
<%= javascript_tag do %>
|
|
87
159
|
$(document).ready(function() {
|
|
88
160
|
$('.dropdown-menu').on('click', 'input[type="checkbox"], label', function(event) {
|
|
@@ -93,13 +165,20 @@ $(document).ready(function() {
|
|
|
93
165
|
$('#downloadCsvModal').modal('show');
|
|
94
166
|
});
|
|
95
167
|
|
|
96
|
-
|
|
97
|
-
|
|
168
|
+
// Native date inputs are used; no jQuery UI datepicker initialization needed
|
|
169
|
+
|
|
170
|
+
// Open native date picker on input click/focus
|
|
171
|
+
$('#startDate, #endDate').on('click focus', function() {
|
|
172
|
+
if (!this.disabled && typeof this.showPicker === 'function') {
|
|
173
|
+
this.showPicker();
|
|
174
|
+
}
|
|
98
175
|
});
|
|
99
176
|
|
|
100
|
-
|
|
177
|
+
$('#downloadCsvModal').on('show.bs.modal', function (e) {
|
|
101
178
|
$('#allData').prop('checked', true);
|
|
102
179
|
$('#startDate, #endDate').prop('disabled', true);
|
|
180
|
+
$('#toggle-wrapper').show();
|
|
181
|
+
$('#dash').hide();
|
|
103
182
|
$('#startDate').val(null);
|
|
104
183
|
$('#endDate').val(null);
|
|
105
184
|
});
|
|
@@ -107,24 +186,40 @@ $(document).ready(function() {
|
|
|
107
186
|
$('#allData').change(function() {
|
|
108
187
|
$('#startDate').val(null);
|
|
109
188
|
$('#endDate').val(null);
|
|
189
|
+
$('#toggle-wrapper').show();
|
|
190
|
+
$('#dash').hide();
|
|
110
191
|
$('#startDate, #endDate').prop('disabled', true);
|
|
192
|
+
// Change to text inputs to show placeholder
|
|
193
|
+
$('#startDate, #endDate').attr('type', 'text');
|
|
111
194
|
});
|
|
112
195
|
|
|
113
196
|
$('#thisWeek').change(function() {
|
|
114
197
|
if ($(this).is(':checked')) {
|
|
115
198
|
setDateRange("week");
|
|
199
|
+
$('#toggle-wrapper').show();
|
|
200
|
+
$('#dash').show();
|
|
201
|
+
// Change back to date inputs
|
|
202
|
+
$('#startDate, #endDate').attr('type', 'date');
|
|
116
203
|
}
|
|
117
204
|
});
|
|
118
205
|
|
|
119
206
|
$('#thisMonth').change(function() {
|
|
120
207
|
if ($(this).is(':checked')) {
|
|
121
208
|
setDateRange("month");
|
|
209
|
+
$('#toggle-wrapper').show();
|
|
210
|
+
$('#dash').show();
|
|
211
|
+
// Change back to date inputs
|
|
212
|
+
$('#startDate, #endDate').attr('type', 'date');
|
|
122
213
|
}
|
|
123
214
|
});
|
|
124
215
|
|
|
125
216
|
$('#thisYear').change(function() {
|
|
126
217
|
if ($(this).is(':checked')) {
|
|
127
218
|
setDateRange("year");
|
|
219
|
+
$('#toggle-wrapper').show();
|
|
220
|
+
$('#dash').show();
|
|
221
|
+
// Change back to date inputs
|
|
222
|
+
$('#startDate, #endDate').attr('type', 'date');
|
|
128
223
|
}
|
|
129
224
|
});
|
|
130
225
|
|
|
@@ -132,24 +227,162 @@ $(document).ready(function() {
|
|
|
132
227
|
if ($(this).is(':checked')) {
|
|
133
228
|
setDateRange("day");
|
|
134
229
|
$('#startDate, #endDate').prop('disabled', false);
|
|
230
|
+
$('#toggle-wrapper').hide();
|
|
231
|
+
$('#dash').show();
|
|
232
|
+
// Change back to date inputs
|
|
233
|
+
$('#startDate, #endDate').attr('type', 'date');
|
|
135
234
|
}
|
|
136
235
|
});
|
|
137
236
|
|
|
138
237
|
var downloadButton = document.getElementById('downloadButton');
|
|
139
238
|
if (downloadButton) {
|
|
140
|
-
downloadButton.addEventListener('click', function() {
|
|
141
|
-
|
|
239
|
+
downloadButton.addEventListener('click', function(e) {
|
|
240
|
+
e.preventDefault();
|
|
142
241
|
var startDate = $('#startDate').val();
|
|
143
242
|
var endDate = $('#endDate').val();
|
|
144
243
|
var downloadAll = $('#allData').is(':checked');
|
|
145
|
-
var
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
244
|
+
var allFieldsChecked = $('#allFields').is(':checked');
|
|
245
|
+
var eventToFilter = $('#event_types').val() ? $('#event_types').val().toUpperCase() : 'ALL';
|
|
246
|
+
|
|
247
|
+
// Build URL like reference partial
|
|
248
|
+
var url = new URL("<%= download_account_timeline_path %>", window.location.origin);
|
|
249
|
+
var params = new URLSearchParams();
|
|
250
|
+
params.append('account_id', "<%=@account.account_id%>");
|
|
251
|
+
params.append('eventType', eventToFilter);
|
|
252
|
+
|
|
253
|
+
if (!downloadAll) {
|
|
254
|
+
params.append('startDate', startDate);
|
|
255
|
+
params.append('endDate', endDate);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Determine columnsString per reference behavior
|
|
259
|
+
var columns = [];
|
|
260
|
+
if (allFieldsChecked) {
|
|
261
|
+
var thElements = document.querySelectorAll('#accounts-timeline-table th, #timeline-table th');
|
|
262
|
+
columns = Array.from(thElements).map(function(th) { return th.textContent.trim(); });
|
|
149
263
|
} else {
|
|
150
|
-
|
|
264
|
+
$('#field-selection input.field-toggle:checked').each(function() {
|
|
265
|
+
var labelText = $(this).closest('label').find('span').text().trim();
|
|
266
|
+
columns.push(labelText);
|
|
267
|
+
});
|
|
151
268
|
}
|
|
269
|
+
if (columns.length > 0) {
|
|
270
|
+
params.append('columnsString', columns.join(','));
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
url.search = params.toString();
|
|
274
|
+
window.open(url.toString(), '_blank');
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
document.addEventListener('click', function (e) {
|
|
279
|
+
const wrapper = document.querySelector('.chip-select');
|
|
280
|
+
const toggle = document.getElementById('dropdown-toggle');
|
|
281
|
+
|
|
282
|
+
if (wrapper && !wrapper.contains(e.target)) {
|
|
283
|
+
toggle.checked = false; // close dropdown
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
document.addEventListener('click', function (e) {
|
|
288
|
+
const wrapper = document.querySelector('.fake-select-wrapper');
|
|
289
|
+
const toggle = document.getElementById('single-toggle');
|
|
290
|
+
if (!wrapper.contains(e.target)) toggle.checked = false;
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
// Initialize on modal open
|
|
294
|
+
$('#downloadCsvModal').on('show.bs.modal', function () {
|
|
295
|
+
$('#allFields').prop('checked', true);
|
|
296
|
+
updateChipLabel();
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
// Initial binding
|
|
300
|
+
bindAllFieldsToggle();
|
|
301
|
+
bindDropdownAllFieldsToggle();
|
|
302
|
+
|
|
303
|
+
// Toggle behavior - this will be re-bound in updateChipLabel
|
|
304
|
+
function bindAllFieldsToggle() {
|
|
305
|
+
$('#allFields').off('change').on('change', function() {
|
|
306
|
+
var checked = $(this).is(':checked');
|
|
307
|
+
|
|
308
|
+
// When "All fields" is checked, select all individual fields
|
|
309
|
+
// When unchecked, deselect all individual fields
|
|
310
|
+
$('#field-selection input.field-toggle').prop('checked', checked);
|
|
311
|
+
$('#allFieldsDropdown').prop('checked', checked);
|
|
312
|
+
|
|
313
|
+
updateChipLabel();
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// Also bind to the dropdown "All fields" checkbox
|
|
318
|
+
function bindDropdownAllFieldsToggle() {
|
|
319
|
+
$('#allFields').off('change').on('change', function() {
|
|
320
|
+
var checked = $(this).is(':checked');
|
|
321
|
+
|
|
322
|
+
// When "All fields" is checked, select all individual fields
|
|
323
|
+
// When unchecked, deselect all individual fields
|
|
324
|
+
$('#field-selection input.field-toggle').prop('checked', checked);
|
|
325
|
+
|
|
326
|
+
updateChipLabel();
|
|
152
327
|
});
|
|
153
328
|
}
|
|
329
|
+
|
|
330
|
+
// Update chip display based on selected fields
|
|
331
|
+
function updateChipLabel() {
|
|
332
|
+
var allFieldsChecked = $('#allFields').is(':checked');
|
|
333
|
+
var $chipList = $('#selected-fields-chips');
|
|
334
|
+
|
|
335
|
+
if (allFieldsChecked) {
|
|
336
|
+
// Show "All fields" chip
|
|
337
|
+
$chipList.html(`
|
|
338
|
+
<span class="chip">All fields</span>
|
|
339
|
+
<svg width="16" height="16" class="position-absolute" style="top: 0.625rem; right: 0.625rem;" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
340
|
+
<path d="M4 6L8 10L12 6" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
341
|
+
</svg>
|
|
342
|
+
`);
|
|
343
|
+
} else {
|
|
344
|
+
// Show individual field chips
|
|
345
|
+
var selectedFields = [];
|
|
346
|
+
$('#field-selection input.field-toggle:checked').each(function() {
|
|
347
|
+
var labelText = $(this).closest('label').find('span').text().trim();
|
|
348
|
+
selectedFields.push(labelText);
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
if (selectedFields.length === 0) {
|
|
352
|
+
$chipList.html(`
|
|
353
|
+
<span class="chip" style="color: #999;">No fields selected</span>
|
|
354
|
+
<svg width="16" height="16" class="position-absolute" style="top: 0.625rem; right: 0.625rem;" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
355
|
+
<path d="M4 6L8 10L12 6" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
356
|
+
</svg>
|
|
357
|
+
`);
|
|
358
|
+
} else {
|
|
359
|
+
var chipsHtml = selectedFields.map(function(field) {
|
|
360
|
+
return `<span class="chip">${field}</span>`;
|
|
361
|
+
}).join('');
|
|
362
|
+
chipsHtml = chipsHtml + `
|
|
363
|
+
<svg width="16" height="16" class="position-absolute" style="top: 0.625rem; right: 0.625rem;" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
364
|
+
<path d="M4 6L8 10L12 6" stroke="#A4A7AE" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
365
|
+
</svg>
|
|
366
|
+
`;
|
|
367
|
+
$chipList.html(chipsHtml);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
// Update chip label when individual fields change
|
|
373
|
+
$('#field-selection input.field-toggle').on('change', function() {
|
|
374
|
+
// Check if all individual fields are selected
|
|
375
|
+
var totalFields = $('#field-selection input.field-toggle').length;
|
|
376
|
+
var checkedFields = $('#field-selection input.field-toggle:checked').length;
|
|
377
|
+
|
|
378
|
+
// Update "All fields" checkbox based on individual field selections
|
|
379
|
+
if (checkedFields === totalFields) {
|
|
380
|
+
$('#allFields').prop('checked', true);
|
|
381
|
+
} else {
|
|
382
|
+
$('#allFields').prop('checked', false);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
updateChipLabel();
|
|
386
|
+
});
|
|
154
387
|
});
|
|
155
388
|
<% end %>
|