Improve notify producer button

Add icon
Better confirmation message
Adds tooltip
Adds small icon and change text if already notified
This commit is contained in:
Sebastian Castro
2021-12-08 17:58:52 +01:00
parent d18b482b4c
commit b76defc602
3 changed files with 26 additions and 2 deletions

View File

@@ -44,4 +44,20 @@ input[type="submit"], input[type="button"], button, .button {
box-shadow: none;
}
}
.badge {
position: absolute;
top: 0;
right: 0;
transform: translateY(-50%);
font-size: 10px;
text-transform: capitalize;
padding: 0px 5px;
border-radius: 3px;
&:before { padding: 0 }
&.danger { background-color: $warning-red; }
&.success { background-color: $spree-green; }
}
}

View File

@@ -2,7 +2,13 @@
- content_for :page_actions do
- if can? :notify_producers, @order_cycle
%li
= button_to t(:notify_producers), main_app.notify_producers_admin_order_cycle_path, :id => 'admin_notify_producers', :confirm => t(:are_you_sure)
- processed = @order_cycle.processed_at.present?
- url = main_app.notify_producers_admin_order_cycle_path
- confirm_msg = "#{t('.notify_producers_tip')} #{t(:are_you_sure)}"
%a.button.icon-email.with-tip{ href: url, data: { method: 'post', confirm: confirm_msg }, 'data-powertip': t('.notify_producers_tip') }
= processed ? t('.re_notify_producers') : t(:notify_producers)
- if processed
.badge.icon-ok.success
- content_for :page_title do
= t :edit_order_cycle

View File

@@ -1038,6 +1038,8 @@ en:
back_to_list: "Back To List"
save_and_back_to_list: "Save and Back to List"
choose_products_from: "Choose Products From:"
re_notify_producers: Re notify producers
notify_producers_tip: This will send an email to each producer with the list of their orders.
incoming:
incoming: "Incoming"
supplier: "Supplier"
@@ -2405,7 +2407,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
new_order_cycle: "New Order Cycle"
new_order_cycle_tooltip: "Open shop for a certain time period"
select_a_coordinator_for_your_order_cycle: "Select a coordinator for your order cycle"
notify_producers: 'Notify producers'
notify_producers: 'Notify producers'
edit_order_cycle: "Edit Order Cycle"
roles: "Roles"
update: "Update"