mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Add resend email button to admin user form
Fixes https://github.com/openfoodfoundation/openfoodnetwork/issues/1589
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
angular.module("admin.users").directive "resendUserEmailConfirmation", ($http) ->
|
||||
scope:
|
||||
email: "@resendUserEmailConfirmation"
|
||||
link: (scope, element, attrs) ->
|
||||
sent = false
|
||||
text = element.text()
|
||||
sending = " " + t "js.admin.resend_user_email_confirmation.sending"
|
||||
done = " " + t "js.admin.resend_user_email_confirmation.done"
|
||||
failed = " " + t "js.admin.resend_user_email_confirmation.failed"
|
||||
|
||||
element.bind "click", ->
|
||||
return if sent
|
||||
element.text(text + sending)
|
||||
$http.post("/user/spree_user/confirmation", {spree_user: {email: scope.email}}).success (data) ->
|
||||
sent = true
|
||||
element.addClass "action--disabled"
|
||||
element.text text + done
|
||||
.error (data) ->
|
||||
element.text text + failed
|
||||
@@ -71,6 +71,14 @@ a {
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
a.action--disabled {
|
||||
cursor: default;
|
||||
|
||||
&:hover {
|
||||
color: #5498da;
|
||||
}
|
||||
}
|
||||
|
||||
form.order_cycle {
|
||||
h2 {
|
||||
margin-top: 2em;
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
%p.alert-box
|
||||
%p.alert-box{"ng-app" => "admin.users"}
|
||||
= t(".confirmation_pending", address: @user.email)
|
||||
%a{"resend-user-email-confirmation" => @user.email}
|
||||
= t(".resend")
|
||||
@@ -2435,6 +2435,10 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
resolve: Resolve
|
||||
new_tag_rule_dialog:
|
||||
select_rule_type: "Select a rule type:"
|
||||
resend_user_email_confirmation:
|
||||
sending: "..."
|
||||
done: "done ✓"
|
||||
failed: "failed ✗"
|
||||
out_of_stock:
|
||||
reduced_stock_available: Reduced stock available
|
||||
out_of_stock_text: >
|
||||
@@ -2588,6 +2592,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
users:
|
||||
email_confirmation:
|
||||
confirmation_pending: "Email confirmation is pending. We've sent a confirmation email to %{address}."
|
||||
resend: "Resend"
|
||||
variants:
|
||||
autocomplete:
|
||||
producer_name: Producer
|
||||
|
||||
Reference in New Issue
Block a user