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
|
@@ -2,37 +2,54 @@
|
|
|
2
2
|
<%= f.hidden_field :payment_id %>
|
|
3
3
|
<%= f.hidden_field :currency %>
|
|
4
4
|
|
|
5
|
-
<div class="form-group">
|
|
6
|
-
<%= f.label :amount, 'Amount', :class => 'col-sm-
|
|
7
|
-
<div class="col-sm-
|
|
5
|
+
<div class="form-group d-flex pb-3">
|
|
6
|
+
<%= f.label :amount, 'Amount', :class => 'col-sm-3 control-label' %>
|
|
7
|
+
<div class="col-sm-9 d-flex currency-group">
|
|
8
8
|
<%= f.number_field :amount, :step => :any, :id => 'chargeback_amount', :class => 'form-control' %>
|
|
9
|
-
<
|
|
9
|
+
<div class="currency"><%= @chargeback.currency %></div>
|
|
10
10
|
</div>
|
|
11
11
|
</div>
|
|
12
|
-
<div class="form-group">
|
|
13
|
-
<%= label_tag :reason, 'Reason', :class => 'col-sm-
|
|
14
|
-
<div class="col-sm-
|
|
12
|
+
<div class="form-group d-flex pb-3">
|
|
13
|
+
<%= label_tag :reason, 'Reason', :class => 'col-sm-3 control-label' %>
|
|
14
|
+
<div class="col-sm-9">
|
|
15
15
|
<%= select_tag :reason, options_for_select(Kaui.chargeback_reason_codes), :class => 'form-control' %>
|
|
16
16
|
</div>
|
|
17
17
|
</div>
|
|
18
|
-
<div class="form-group">
|
|
19
|
-
|
|
18
|
+
<div class="form-group d-flex pb-3">
|
|
19
|
+
<%= label_tag :cancel_all_subs, '', :class => 'col-sm-3 control-label' %>
|
|
20
|
+
<div class="col-sm-9">
|
|
20
21
|
<div class="checkbox">
|
|
21
22
|
<%= label_tag :cancel_all_subs do %>
|
|
22
|
-
<%= check_box_tag :cancel_all_subs %>Cancel
|
|
23
|
+
<%= check_box_tag :cancel_all_subs %>Cancel Account Subscriptions
|
|
23
24
|
<% end %>
|
|
24
25
|
</div>
|
|
25
26
|
</div>
|
|
26
27
|
</div>
|
|
27
|
-
<div class="form-group">
|
|
28
|
-
<%= label_tag :comment, 'Comment', :class => 'col-sm-
|
|
29
|
-
<div class="col-sm-
|
|
28
|
+
<div class="form-group d-flex pb-3 border-bottom mb-3">
|
|
29
|
+
<%= label_tag :comment, 'Comment', :class => 'col-sm-3 control-label' %>
|
|
30
|
+
<div class="col-sm-9">
|
|
30
31
|
<%= text_area_tag :comment, nil, :rows => 3, :class => 'form-control' %>
|
|
31
32
|
</div>
|
|
32
33
|
</div>
|
|
33
|
-
<div class="form-group">
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
<div class="form-group d-flex justify-content-end pb-3">
|
|
35
|
+
<%= render "kaui/components/button/button", {
|
|
36
|
+
label: 'Close',
|
|
37
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
38
|
+
type: "button",
|
|
39
|
+
html_class: "kaui-button custom-hover mx-2",
|
|
40
|
+
html_options: {
|
|
41
|
+
id: "closeButton",
|
|
42
|
+
onclick: "window.history.back();"
|
|
43
|
+
}
|
|
44
|
+
} %>
|
|
45
|
+
<%= render "kaui/components/button/button", {
|
|
46
|
+
label: 'Save Payment',
|
|
47
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
48
|
+
type: "submit",
|
|
49
|
+
html_class: "kaui-dropdown custom-hover",
|
|
50
|
+
html_options: {
|
|
51
|
+
id: "saveButton"
|
|
52
|
+
}
|
|
53
|
+
} %>
|
|
37
54
|
</div>
|
|
38
|
-
<% end %>
|
|
55
|
+
<% end %>
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
<div class="register">
|
|
2
|
-
<div class="
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<div class="register process-chargeback-modal">
|
|
2
|
+
<div class="">
|
|
3
|
+
<div class="mx-auto" style="max-width: 37.5rem;">
|
|
4
|
+
<h5 class="add-account-title border-bottom">
|
|
5
|
+
<span class="icon-container">
|
|
6
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7
|
+
<path d="M16.6667 3.33301H3.33341C2.41294 3.33301 1.66675 4.0792 1.66675 4.99967V14.9997C1.66675 15.9202 2.41294 16.6663 3.33341 16.6663H16.6667C17.5872 16.6663 18.3334 15.9202 18.3334 14.9997V4.99967C18.3334 4.0792 17.5872 3.33301 16.6667 3.33301Z" stroke="#414651" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
8
|
+
<path d="M8.33325 13.333H9.58325M12.0833 13.333H14.9999" stroke="#414651" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
|
9
|
+
<path d="M1.66675 7.5H18.3334" stroke="#414651" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="round"/>
|
|
10
|
+
</svg>
|
|
11
|
+
</span>
|
|
12
|
+
Process chargeback
|
|
13
|
+
</h5>
|
|
14
|
+
<%= render 'form' %>
|
|
15
|
+
</div>
|
|
7
16
|
</div>
|
|
8
|
-
|
|
9
|
-
</div>
|
|
10
|
-
</div>
|
|
17
|
+
</div>
|
|
@@ -1,52 +1,64 @@
|
|
|
1
1
|
<%= form_for @charge, :url => {:action => :create}, :html => {:class => 'form-horizontal'} do |f| %>
|
|
2
|
-
|
|
2
|
+
<%= f.hidden_field :invoice_id %>
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
<% if @invoice.nil? %>
|
|
5
|
+
<div class="form-group d-flex pb-3">
|
|
6
|
+
<div class="col-sm-3"></div>
|
|
7
|
+
<div class="col-sm-offset-2 ">
|
|
8
|
+
<div class="checkbox">
|
|
9
|
+
<%= label_tag :auto_commit do %>
|
|
10
|
+
<%= check_box_tag :auto_commit, '1', true %>Auto-commit?
|
|
11
|
+
<% end %>
|
|
12
12
|
</div>
|
|
13
13
|
</div>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
</div>
|
|
15
|
+
<% end %>
|
|
16
|
+
|
|
17
|
+
<div class="form-group d-flex pb-3">
|
|
18
|
+
<%= f.label :amount, 'Amount', class: 'col-sm-3 control-label' %>
|
|
19
|
+
<div class="input-group">
|
|
20
|
+
<%= f.number_field :amount, step: :any, id: 'charge_amount', class: 'form-control amount-input', placeholder: '$ 0.00' %>
|
|
21
|
+
<div class="input-group-append">
|
|
19
22
|
<% if @invoice.present? %>
|
|
20
|
-
|
|
23
|
+
<span class="input-group-text"><%= @invoice.currency %></span>
|
|
24
|
+
<%= f.hidden_field :currency %>
|
|
25
|
+
<% else %>
|
|
26
|
+
<%= f.select :currency, currencies, {}, class: 'form-control' %>
|
|
21
27
|
<% end %>
|
|
22
28
|
</div>
|
|
23
29
|
</div>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
<% else %>
|
|
32
|
-
<!--https://github.com/killbill/killbill/issues/388-->
|
|
33
|
-
<%= f.hidden_field :currency %>
|
|
34
|
-
<% end %>
|
|
35
|
-
<div class="form-group">
|
|
36
|
-
<%= f.label :description, 'Description', :class => 'col-sm-2 control-label' %>
|
|
37
|
-
<div class="col-sm-10">
|
|
38
|
-
<%= f.text_area :description, :rows => 3, :class => 'form-control' %>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
<div class="form-group">
|
|
42
|
-
<%= label_tag :comment, 'Comment', :class => 'col-sm-2 control-label' %>
|
|
43
|
-
<div class="col-sm-10">
|
|
44
|
-
<%= text_area_tag :comment, nil, :rows => 3, :class => 'form-control' %>
|
|
45
|
-
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<div class="form-group d-flex pb-3">
|
|
32
|
+
<%= f.label :description, 'Description', :class => 'col-sm-3 control-label' %>
|
|
33
|
+
<div class="input-group">
|
|
34
|
+
<%= f.text_area :description, :rows => 3, :class => 'form-control' %>
|
|
46
35
|
</div>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
</div>
|
|
37
|
+
<div class="form-group d-flex pb-3 border-bottom mb-3">
|
|
38
|
+
<%= label_tag :comment, 'Comment', :class => 'col-sm-3 control-label' %>
|
|
39
|
+
<div class="input-group">
|
|
40
|
+
<%= text_area_tag :comment, nil, :rows => 3, :class => 'form-control' %>
|
|
51
41
|
</div>
|
|
52
|
-
|
|
42
|
+
</div>
|
|
43
|
+
<div class="form-group d-flex justify-content-end pb-3">
|
|
44
|
+
<%= render "kaui/components/button/button", {
|
|
45
|
+
label: 'Close',
|
|
46
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
47
|
+
type: "button",
|
|
48
|
+
html_class: "kaui-button custom-hover mx-2",
|
|
49
|
+
html_options: {
|
|
50
|
+
id: "closeButton",
|
|
51
|
+
onclick: "window.history.back();"
|
|
52
|
+
}
|
|
53
|
+
} %>
|
|
54
|
+
<%= render "kaui/components/button/button", {
|
|
55
|
+
label: 'Save Charge',
|
|
56
|
+
variant: "outline-secondary d-inline-flex align-items-center gap-1",
|
|
57
|
+
type: "submit",
|
|
58
|
+
html_class: "kaui-dropdown custom-hover",
|
|
59
|
+
html_options: {
|
|
60
|
+
id: "saveButton"
|
|
61
|
+
}
|
|
62
|
+
} %>
|
|
63
|
+
</div>
|
|
64
|
+
<% end %>
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
<div class="register">
|
|
2
|
-
<div class="
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<div class="register add-new-charge-modal">
|
|
2
|
+
<div class="">
|
|
3
|
+
<div class="mx-auto" style="max-width: 37.5rem;">
|
|
4
|
+
<h5 class="add-account-title border-bottom">
|
|
5
|
+
<span class="icon-container">
|
|
6
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7
|
+
<path d="M9.58325 9.1665H7.08325" stroke="#414651" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
8
|
+
<path d="M12.0833 5.8335H7.08325" stroke="#414651" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
9
|
+
<path d="M16.6666 17.9165V3.33317C16.6666 2.4127 15.9204 1.6665 14.9999 1.6665H4.99992C4.07944 1.6665 3.33325 2.4127 3.33325 3.33317V17.9165L6.66659 16.2498L9.99992 18.3332L13.3333 16.2498L16.6666 17.9165Z" stroke="#414651" stroke-width="1.5" stroke-linejoin="round"/>
|
|
10
|
+
</svg>
|
|
11
|
+
</span>
|
|
12
|
+
Add new charge
|
|
13
|
+
</h5>
|
|
14
|
+
<%= render 'form' %>
|
|
15
|
+
</div>
|
|
7
16
|
</div>
|
|
8
|
-
|
|
9
|
-
</div>
|
|
10
17
|
</div>
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<%# Accept optional breadcrumbs array (e.g., passed via locals) %>
|
|
2
|
+
<% custom_breadcrumbs = local_assigns[:breadcrumbs] %>
|
|
3
|
+
|
|
4
|
+
<%# Improved dynamic root detection %>
|
|
5
|
+
<%
|
|
6
|
+
# Try to determine root path dynamically
|
|
7
|
+
if request.path.start_with?('/kaui')
|
|
8
|
+
dynamic_root = '/kaui'
|
|
9
|
+
else
|
|
10
|
+
dynamic_root = '/'
|
|
11
|
+
end
|
|
12
|
+
%>
|
|
13
|
+
|
|
14
|
+
<% if custom_breadcrumbs.present? %>
|
|
15
|
+
<nav class="breadcrumb-nav" aria-label="Breadcrumb">
|
|
16
|
+
<span class="breadcrumb-home">
|
|
17
|
+
<%= link_to '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1.33331 6.99994L7.16705 2.33295C7.65398 1.94338 8.34598 1.94338 8.83291 2.33295L14.6666 6.99994" stroke="#A4A7AE" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/><path d="M2.66669 6V13C2.66669 13.7364 3.26364 14.3333 4.00002 14.3333H12C12.7364 14.3333 13.3334 13.7364 13.3334 13V6" stroke="#A4A7AE" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/><path d="M8 11.6667V12.3334" stroke="#A4A7AE" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/></svg>'.html_safe,
|
|
18
|
+
dynamic_root, class: "breadcrumb-home" %>
|
|
19
|
+
</span>
|
|
20
|
+
<span class="breadcrumb-separator">/</span>
|
|
21
|
+
<% custom_breadcrumbs.each_with_index do |item, index| %>
|
|
22
|
+
<% is_last = index == custom_breadcrumbs.size - 1 %>
|
|
23
|
+
|
|
24
|
+
<% if index > 0 %>
|
|
25
|
+
<span class="breadcrumb-separator">/</span>
|
|
26
|
+
<% end %>
|
|
27
|
+
|
|
28
|
+
<% if is_last %>
|
|
29
|
+
<span class="breadcrumb-current"><%= item[:label] %></span>
|
|
30
|
+
<% else %>
|
|
31
|
+
<% href = item[:href] == "/" ? dynamic_root : item[:href] %>
|
|
32
|
+
<%= link_to item[:label], href, class: "breadcrumb-link" %>
|
|
33
|
+
<% end %>
|
|
34
|
+
<% end %>
|
|
35
|
+
</nav>
|
|
36
|
+
<% else %>
|
|
37
|
+
<% full_path = request.fullpath.gsub(/\?.*/, '') %>
|
|
38
|
+
<% segments = full_path.split("/").reject(&:blank?) %>
|
|
39
|
+
|
|
40
|
+
<% if params[:account_id].present? && full_path.starts_with?("/kaui/queues") %>
|
|
41
|
+
<% segments = ["kaui", "accounts", params[:account_id], "queues"] %>
|
|
42
|
+
<% end %>
|
|
43
|
+
|
|
44
|
+
<% segment_label_map = {
|
|
45
|
+
'accounts' => 'Account',
|
|
46
|
+
'bundles' => 'Subscriptions',
|
|
47
|
+
'invoices' => 'Invoices',
|
|
48
|
+
'payments' => 'Payments',
|
|
49
|
+
'timelines' => 'Timeline',
|
|
50
|
+
'account_tags' => 'Tags',
|
|
51
|
+
'custom_fields' => 'Custom Fields',
|
|
52
|
+
'queues' => 'Queues',
|
|
53
|
+
'logs' => 'Audit',
|
|
54
|
+
'payment_methods' => 'Payment Methods',
|
|
55
|
+
'subscriptions' => 'Subscriptions',
|
|
56
|
+
'credits' => 'Credits',
|
|
57
|
+
'refunds' => 'Refunds',
|
|
58
|
+
'chargebacks' => 'Chargebacks',
|
|
59
|
+
'transactions' => 'Transactions',
|
|
60
|
+
'admin' => 'Admin',
|
|
61
|
+
'tenants' => 'Tenants',
|
|
62
|
+
'home' => 'Dashboard'
|
|
63
|
+
} %>
|
|
64
|
+
|
|
65
|
+
<nav class="breadcrumb-nav" aria-label="Breadcrumb">
|
|
66
|
+
<%# Always show home icon first %>
|
|
67
|
+
<% if segments.empty? || (segments.size == 1 && segments.first == "kaui") %>
|
|
68
|
+
<%# Home is the current/last page %>
|
|
69
|
+
<span class="breadcrumb-home">
|
|
70
|
+
<%= raw <<~SVG
|
|
71
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
72
|
+
<path d="M1.33331 6.99994L7.16705 2.33295C7.65398 1.94338 8.34598 1.94338 8.83291 2.33295L14.6666 6.99994" stroke="#A4A7AE" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
73
|
+
<path d="M2.66669 6V13C2.66669 13.7364 3.26364 14.3333 4.00002 14.3333H12C12.7364 14.3333 13.3334 13.7364 13.3334 13V6" stroke="#A4A7AE" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
74
|
+
<path d="M8 11.6667V12.3334" stroke="#A4A7AE" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
75
|
+
</svg>
|
|
76
|
+
SVG
|
|
77
|
+
%>
|
|
78
|
+
</span>
|
|
79
|
+
<% else %>
|
|
80
|
+
<%# Home is a link %>
|
|
81
|
+
<%= link_to dynamic_root, class: "breadcrumb-home-link" do %>
|
|
82
|
+
<%= raw <<~SVG
|
|
83
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
84
|
+
<path d="M1.33331 6.99994L7.16705 2.33295C7.65398 1.94338 8.34598 1.94338 8.83291 2.33295L14.6666 6.99994" stroke="#A4A7AE" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
85
|
+
<path d="M2.66669 6V13C2.66669 13.7364 3.26364 14.3333 4.00002 14.3333H12C12.7364 14.3333 13.3334 13.7364 13.3334 13V6" stroke="#A4A7AE" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
86
|
+
<path d="M8 11.6667V12.3334" stroke="#A4A7AE" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
87
|
+
</svg>
|
|
88
|
+
SVG
|
|
89
|
+
%>
|
|
90
|
+
<% end %>
|
|
91
|
+
<% end %>
|
|
92
|
+
|
|
93
|
+
<%# Process remaining segments (excluding root "kaui" segment) %>
|
|
94
|
+
<% sanitized_segments = segments.map { |segment| CGI.escapeHTML(segment) } %>
|
|
95
|
+
<%
|
|
96
|
+
# Skip the first segment if it's "kaui" since we already handled home
|
|
97
|
+
display_segments = sanitized_segments.first == "kaui" ? sanitized_segments[1..-1] : sanitized_segments
|
|
98
|
+
%>
|
|
99
|
+
|
|
100
|
+
<% display_segments.each_with_index do |segment, index| %>
|
|
101
|
+
<% is_last = index == display_segments.size - 1 %>
|
|
102
|
+
<%
|
|
103
|
+
# Reconstruct path for this segment
|
|
104
|
+
if sanitized_segments.first == "kaui"
|
|
105
|
+
segment_path = "/" + (["kaui"] + display_segments[0..index]).join("/")
|
|
106
|
+
else
|
|
107
|
+
segment_path = "/" + display_segments[0..index].join("/")
|
|
108
|
+
end
|
|
109
|
+
%>
|
|
110
|
+
|
|
111
|
+
<span class="breadcrumb-separator">/</span>
|
|
112
|
+
|
|
113
|
+
<% if segment.match?(/\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\z/i)
|
|
114
|
+
if defined?(@account) && @account&.account_id == segment
|
|
115
|
+
label = @account.name.present? ? @account.name : "Account #{@account.account_id[0..7]}..."
|
|
116
|
+
elsif defined?(@payment) && @payment&.payment_id == segment
|
|
117
|
+
label = @payment.payment_number.present? ? "Payment #{@payment.payment_number}" : "Payment #{@payment.payment_id[0..7]}..."
|
|
118
|
+
elsif defined?(@invoice) && @invoice&.invoice_id == segment
|
|
119
|
+
label = @invoice.invoice_number.present? ? "Invoice #{@invoice.invoice_number}" : "Invoice #{@invoice.invoice_id[0..7]}..."
|
|
120
|
+
elsif defined?(@bundle) && @bundle&.bundle_id == segment
|
|
121
|
+
label = @bundle.external_key.present? ? "Bundle #{@bundle.external_key}" : "Bundle #{@bundle.bundle_id[0..7]}..."
|
|
122
|
+
elsif defined?(@subscription) && @subscription&.subscription_id == segment
|
|
123
|
+
label = @subscription.external_key.present? ? "Subscription #{@subscription.external_key}" : "Subscription #{@subscription.subscription_id[0..7]}..."
|
|
124
|
+
# Additional checks for common patterns using params
|
|
125
|
+
elsif segment == params[:account_id] && defined?(@account)
|
|
126
|
+
label = @account.name.present? ? @account.name : "Account #{@account.account_id[0..7]}..."
|
|
127
|
+
elsif segment == params[:payment_id] && defined?(@payment)
|
|
128
|
+
label = @payment.payment_number.present? ? "Payment #{@payment.payment_number}" : "Payment #{@payment.payment_id[0..7]}..."
|
|
129
|
+
elsif segment == params[:invoice_id] && defined?(@invoice)
|
|
130
|
+
label = @invoice.invoice_number.present? ? "Invoice #{@invoice.invoice_number}" : "Invoice #{@invoice.invoice_id[0..7]}..."
|
|
131
|
+
else
|
|
132
|
+
label = segment[0..7] + "..."
|
|
133
|
+
end
|
|
134
|
+
elsif segment_label_map[segment] %>
|
|
135
|
+
<% label = segment_label_map[segment] %>
|
|
136
|
+
<% else %>
|
|
137
|
+
<% label = segment.titleize %>
|
|
138
|
+
<% end %>
|
|
139
|
+
<% if is_last %>
|
|
140
|
+
<span class="breadcrumb-current"><%= label %></span>
|
|
141
|
+
<% else %>
|
|
142
|
+
<%= link_to label, CGI.escapeHTML(segment_path), class: "breadcrumb-link" %>
|
|
143
|
+
<% end %>
|
|
144
|
+
<% end %>
|
|
145
|
+
</nav>
|
|
146
|
+
<% end %>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<% variant ||= "btn-primary" %>
|
|
2
|
+
<% type ||= "button" %>
|
|
3
|
+
<% label ||= "Submit" %>
|
|
4
|
+
<% icon ||= nil %>
|
|
5
|
+
<% trailing_icon ||= nil %>
|
|
6
|
+
<% html_class ||= "" %>
|
|
7
|
+
<% html_options ||= {} %>
|
|
8
|
+
|
|
9
|
+
<% icon_html = icon.present? ? image_tag(icon, class: "me-1", size: "16x16") : "" %>
|
|
10
|
+
<% trailing_icon_html = trailing_icon.present? ? image_tag(trailing_icon, class: "ms-1", size: "16x16") : "" %>
|
|
11
|
+
|
|
12
|
+
<%= tag.button raw("#{icon_html}#{label}#{trailing_icon_html}"),
|
|
13
|
+
type: type,
|
|
14
|
+
class: "btn #{variant} #{html_class}",
|
|
15
|
+
**html_options
|
|
16
|
+
%>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<div class="col-md-4">
|
|
2
|
+
<div class="dashboard-card border rounded-4 d-flex flex-column justify-content-between h-100">
|
|
3
|
+
<div class="d-flex px-4 py-3 align-items-center gap-3">
|
|
4
|
+
<div class="flex items-center justify-content-center dashboard-card-icon border rounded-3">
|
|
5
|
+
<%= image_tag "#{icon}", height: 24 %>
|
|
6
|
+
</div>
|
|
7
|
+
<div>
|
|
8
|
+
<h6 class="mb-0 fw-600 text-black-900"><%= title %></h6>
|
|
9
|
+
<p class="text-muted fw-normal text-tertiary small mb-0"><%= count %></p>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="w-full dashboard-card-divider"></div>
|
|
13
|
+
<%= link_to "View All", path, class: "text-primary fw-medium small px-4 py-3 text-decoration-none text-end" %>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<div class="col mb-3">
|
|
2
|
+
<%= link_to path, class: "text-decoration-none text-reset custom-hover" do %>
|
|
3
|
+
<div class="d-flex gap-3">
|
|
4
|
+
<div class="flex-shrink-0">
|
|
5
|
+
<div class="flex items-center justify-content-center setting-card-icon border rounded-3">
|
|
6
|
+
<%= image_tag "#{icon}", height: 20 %>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
<div>
|
|
10
|
+
<h6 class="mb-0 fw-600 text-black-900"><%= title %></h6>
|
|
11
|
+
<p class="text-muted fw-normal text-tertiary small mb-0 mt-1"><%= desc %></p>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<% end %>
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<div class="mb-3">
|
|
2
|
+
<div class="d-flex justify-content-between align-items-center">
|
|
3
|
+
<%= f.label field, label, class: "form-label text-gray-700 fs-7" %>
|
|
4
|
+
</div>
|
|
5
|
+
<%= f.password_field field, class: "form-control text-gray-700 fs-7", placeholder: placeholder %>
|
|
6
|
+
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= link_to image_tag('kaui/logo.svg', :alt => 'Kill Bill Logo'), kaui_engine.home_path %>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<% variant ||= "btn-primary" %>
|
|
2
|
+
<% type ||= "button" %>
|
|
3
|
+
<% label ||= "Submit" %>
|
|
4
|
+
<% icon ||= nil %>
|
|
5
|
+
<% html_class ||= "" %>
|
|
6
|
+
<% html_options ||= {} %>
|
|
7
|
+
<% dropdown_id ||= "menuDropdown" %>
|
|
8
|
+
|
|
9
|
+
<% icon_html = icon.present? ? image_tag(icon, class: "me-1", size: "16x16") : "" %>
|
|
10
|
+
|
|
11
|
+
<div class="dropdown dropdown-menu-end position-relative" id="<%= dropdown_id %>_wrapper">
|
|
12
|
+
<%= tag.button raw("#{icon_html}#{label}"),
|
|
13
|
+
type: type,
|
|
14
|
+
class: "btn kaui-dropdown custom-hover #{variant} #{html_class}",
|
|
15
|
+
id: "#{dropdown_id}_button",
|
|
16
|
+
aria: { expanded: "false" } %>
|
|
17
|
+
|
|
18
|
+
<ul class="dropdown-menu header-menu shadow border-0 rounded-3"
|
|
19
|
+
id="<%= dropdown_id %>_menu"
|
|
20
|
+
style="min-width: 6.25rem; display: none;">
|
|
21
|
+
<% menu_items&.each do |item| %>
|
|
22
|
+
<li>
|
|
23
|
+
<%= link_to item[:path], class: "dropdown-item d-flex align-items-center gap-2" do %>
|
|
24
|
+
<%= image_tag(item[:icon], alt: "#{item[:label]} Icon", size: "16x16") if item[:icon].present? %>
|
|
25
|
+
<span class="text-black-700 fs-6 text-normal" style="font-weight: 500; font-size: 0.875rem !important; line-height: 1.25rem;"><%= item[:label] %></span>
|
|
26
|
+
<% end %>
|
|
27
|
+
</li>
|
|
28
|
+
<% end %>
|
|
29
|
+
</ul>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<%= javascript_tag do %>
|
|
33
|
+
document.addEventListener('DOMContentLoaded', function () {
|
|
34
|
+
const button = document.getElementById('<%= dropdown_id %>_button');
|
|
35
|
+
const menu = document.getElementById('<%= dropdown_id %>_menu');
|
|
36
|
+
const wrapper = document.getElementById('<%= dropdown_id %>_wrapper');
|
|
37
|
+
|
|
38
|
+
button.addEventListener('click', function (e) {
|
|
39
|
+
e.stopPropagation();
|
|
40
|
+
const isShown = menu.style.display === 'block';
|
|
41
|
+
|
|
42
|
+
// Close all other open dropdowns first (including other dots menus)
|
|
43
|
+
document.querySelectorAll('.dropdown-menu').forEach(function (m) {
|
|
44
|
+
if (m !== menu) {
|
|
45
|
+
m.style.display = 'none';
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// Toggle this one
|
|
50
|
+
menu.style.display = isShown ? 'none' : 'block';
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
document.addEventListener('click', function (e) {
|
|
54
|
+
if (!wrapper.contains(e.target)) {
|
|
55
|
+
menu.style.display = 'none';
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
<% end %>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<div class="position-relative mx-auto search-container">
|
|
2
|
+
<%= form_tag kaui_engine.search_path, method: :get, id: "searchform", role: "search", class: "d-flex align-items-center m-0" do %>
|
|
3
|
+
<div class="input-group border overflow-hidden search-box">
|
|
4
|
+
<span class="input-group-text bg-white border-0 ps-3">
|
|
5
|
+
<%= link_to image_tag('kaui/header/search_icon.svg', :alt => 'Search Icon'), kaui_engine.home_path %>
|
|
6
|
+
</span>
|
|
7
|
+
|
|
8
|
+
<%= text_field_tag :q, params[:q], class: "form-control border-0", placeholder: "What are you looking for?", autocomplete: "off", id: "search-box" %>
|
|
9
|
+
|
|
10
|
+
<span class="input-group-text bg-white border-0 pe-3 text-muted">⌘K</span>
|
|
11
|
+
</div>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<!-- Autocomplete dropdown -->
|
|
15
|
+
<div id="search-suggestions" class="autocomplete-box position-absolute bg-white rounded-4 shadow mt-1 p-3 w-100 d-none border">
|
|
16
|
+
<div class="mb-2 fw-semibold text-muted">Jump to…</div>
|
|
17
|
+
<div class="d-flex flex-wrap gap-2 mb-3">
|
|
18
|
+
|
|
19
|
+
<div class="d-flex header-tag custom-hover align-items-center gap-2 border-secondary px-2 border-2 rounded-4 ">
|
|
20
|
+
<%= link_to image_tag('kaui/header/account.svg', :alt => 'Account Icon'), kaui_engine.home_path %>
|
|
21
|
+
<%= link_to "All Accounts", kaui_engine.accounts_path, class: "text-decoration-none text-black-700" %>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="d-flex header-tag custom-hover align-items-center gap-2 border-secondary px-2 border-2 rounded-4 ">
|
|
24
|
+
<%= link_to image_tag('kaui/header/invoice.svg', :alt => 'Account Icon'), kaui_engine.home_path %>
|
|
25
|
+
<%= link_to "All Invoices", kaui_engine.invoices_path, class: "text-decoration-none text-black-700" %>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="d-flex header-tag custom-hover align-items-center gap-2 border-secondary px-2 border-2 rounded-4 ">
|
|
28
|
+
<%= link_to image_tag('kaui/header/payment.svg', :alt => 'Account Icon'), kaui_engine.home_path %>
|
|
29
|
+
<%= link_to "All Payments", kaui_engine.payments_path, class: "text-decoration-none text-black-700" %>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div class="mb-1 fw-semibold text-muted mb-2">Suggested search queries</div>
|
|
34
|
+
<div class="mb-3">
|
|
35
|
+
<div class="inline-block me-2 my-4">
|
|
36
|
+
<span class="me-2 header-tag custom-hover text-black-900 fw-500 align-items-center gap-2 border-secondary px-2 py-2 border-2 rounded-4 ">account:</span>
|
|
37
|
+
<span>account: Flavio Ruggiero</span>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="inline-block me-2 my-4">
|
|
40
|
+
<span class="me-2 header-tag custom-hover text-black-900 fw-500 align-items-center gap-2 border-secondary px-2 py-2 border-2 rounded-4 ">invoice:</span>
|
|
41
|
+
<span>invoice: af58a92c-bdc4-...</span>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="inline-block me-2 my-4">
|
|
44
|
+
<span class="me-2 header-tag custom-hover text-black-900 fw-500 align-items-center gap-2 border-secondary px-2 py-2 border-2 rounded-4 ">payment:</span>
|
|
45
|
+
<span>payment: 3c4c0263-b06f-...</span>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<div class="fw-semibold text-muted mb-2">Other search queries</div>
|
|
50
|
+
<div class="d-flex flex-wrap gap-2">
|
|
51
|
+
<% %w[custom\ field: subscription: tag:].each do |term| %>
|
|
52
|
+
<span class="badge text-dark border border-secondary rounded-3 px-3 py-2 custom-hover"><%= term %></span>
|
|
53
|
+
<% end %>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<script>
|
|
59
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
60
|
+
const input = document.getElementById("search-box");
|
|
61
|
+
const dropdown = document.getElementById("search-suggestions");
|
|
62
|
+
|
|
63
|
+
input.addEventListener("input", () => {
|
|
64
|
+
dropdown.classList.remove("d-none");
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
document.addEventListener("click", (e) => {
|
|
68
|
+
if (!dropdown.contains(e.target) && e.target !== input) {
|
|
69
|
+
dropdown.classList.add("d-none");
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// Optional: shortcut CMD+K
|
|
74
|
+
document.addEventListener("keydown", (e) => {
|
|
75
|
+
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k") {
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
input.focus();
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
</script>
|