mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-28 01:53:25 +00:00
Show signup message in modal wihout redirect
This commit is contained in:
committed by
Rob Harrington
parent
0cb7a555d3
commit
97f5022bdd
@@ -9,9 +9,6 @@ Darkswarm.controller "SignupCtrl", ($scope, $http, $window, $location, Redirecti
|
||||
|
||||
$scope.submit = ->
|
||||
$http.post("/user/spree_user", {spree_user: $scope.spree_user}).success (data)->
|
||||
if Redirections.after_login
|
||||
$window.location.href = $window.location.origin + Redirections.after_login
|
||||
else
|
||||
$window.location.href = $window.location.origin + $window.location.pathname # Strips out hash fragments
|
||||
$scope.messages = t('devise.user_registrations.spree_user.signed_up_but_unconfirmed')
|
||||
.error (data) ->
|
||||
$scope.errors = data
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
%tab#sign-up-content{ heading: "{{'label_signup' | t}}", active: 'tabs.signup.active', select: "select(path)"}
|
||||
%form{ ng: { controller: "SignupCtrl", submit: "submit()" } }
|
||||
.row
|
||||
.large-12.columns
|
||||
.alert-box.success{ng: {show: 'messages != null'}}
|
||||
{{ messages }}
|
||||
.row
|
||||
.large-12.columns
|
||||
%label{for: "email"} {{'signup_email' | t}}
|
||||
|
||||
@@ -5,12 +5,12 @@ class UserRegistrationsController < Spree::UserRegistrationsController
|
||||
def create
|
||||
@user = build_resource(params[:spree_user])
|
||||
if resource.save
|
||||
set_flash_message(:success, :signed_up_but_unconfirmed)
|
||||
session[:spree_user_signup] = true
|
||||
associate_user
|
||||
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
set_flash_message(:success, :signed_up_but_unconfirmed)
|
||||
redirect_to after_sign_in_path_for(@user)
|
||||
end
|
||||
format.js do
|
||||
|
||||
Reference in New Issue
Block a user