src/pyams_security/views/userfolder.py
changeset 116 89df87450c0c
parent 115 12c5513ee71a
equal deleted inserted replaced
115:12c5513ee71a 116:89df87450c0c
   129 class UserRegistrationAJAXForm(AJAXAddForm, UserRegistrationForm):
   129 class UserRegistrationAJAXForm(AJAXAddForm, UserRegistrationForm):
   130     """User registration form, AJAX view"""
   130     """User registration form, AJAX view"""
   131 
   131 
   132     def get_ajax_output(self, changes):
   132     def get_ajax_output(self, changes):
   133         translate = self.request.localizer.translate
   133         translate = self.request.localizer.translate
   134         return {'status': 'success',
   134         return {
   135                 'messagebox': {'status': 'success',
   135             'status': 'success',
   136                                'title': translate(_("Your registration is recorded!")),
   136             'messagebox': {
   137                                'icon': 'fa fa-fw fa-user',
   137                 'status': 'success',
   138                                'content': translate(_("Your registration is recorded. You should receive a "
   138                 'title': translate(_("Your registration is recorded!")),
   139                                                       "confirmation email soon which will allow you to "
   139                 'icon': 'fa fa-fw fa-user',
   140                                                       "confirm your inscription.")),
   140                 'content': translate(_("Your registration is recorded. You should receive a "
   141                                'timeout': None}}
   141                                        "confirmation email soon which will allow you to "
       
   142                                        "confirm your inscription.")),
       
   143                 'timeout': None
       
   144             }
       
   145         }
   142 
   146 
   143 
   147 
   144 #
   148 #
   145 # Registration confirmation form
   149 # Registration confirmation form
   146 #
   150 #
   214 @view_config(name='user-confirmation.json', request_type=IPyAMSLayer, renderer='json', xhr=True)
   218 @view_config(name='user-confirmation.json', request_type=IPyAMSLayer, renderer='json', xhr=True)
   215 class UserConfirmationAJAXForm(AJAXAddForm, UserConfirmationForm):
   219 class UserConfirmationAJAXForm(AJAXAddForm, UserConfirmationForm):
   216     """User registration confirmation form, AJAX view"""
   220     """User registration confirmation form, AJAX view"""
   217 
   221 
   218     def get_ajax_output(self, changes):
   222     def get_ajax_output(self, changes):
   219         return {'status': 'redirect',
   223         return {
   220                 'location': 'user-registration-end.html'}
   224             'status': 'redirect',
       
   225             'location': 'user-registration-end.html'
       
   226         }
   221 
   227 
   222 
   228 
   223 @pagelet_config(name='user-registration-end.html', layer=IPyAMSLayer)
   229 @pagelet_config(name='user-registration-end.html', layer=IPyAMSLayer)
   224 @template_config(template='templates/user-registration-end.pt', layer=IPyAMSLayer)
   230 @template_config(template='templates/user-registration-end.pt', layer=IPyAMSLayer)
   225 @implementer(IModalFullPage)
   231 @implementer(IModalFullPage)