From 7a2e2cd1d2e698798b37252f1141fe97f5fe0759 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 5 Oct 2014 20:33:43 +0200 Subject: [PATCH] Small code cleanup. --- .../app/controllers/getting_started.js.coffee | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/app/assets/javascripts/app/controllers/getting_started.js.coffee b/app/assets/javascripts/app/controllers/getting_started.js.coffee index e0d61a29e..39fca2688 100644 --- a/app/assets/javascripts/app/controllers/getting_started.js.coffee +++ b/app/assets/javascripts/app/controllers/getting_started.js.coffee @@ -39,7 +39,7 @@ class Index extends App.ControllerContent ) render: -> - + console.log('RENDER 1') # check authentication, redirect to login if master user already exists if !@master_user && !@authenticate() @navigate '#login' @@ -51,13 +51,13 @@ class Index extends App.ControllerContent new App.ControllerForm( el: @el.find('#form-master') model: App.User - required: 'signup' + screen: 'signup' autofocus: true ) new App.ControllerForm( el: @el.find('#form-agent') model: App.User - required: 'invite_agent' + screen: 'invite_agent' autofocus: true ) @@ -94,8 +94,7 @@ class Index extends App.ControllerContent # save user user.save( - done: (r) => - + done: => if @master_user @master_user = false App.Auth.login( @@ -106,7 +105,7 @@ class Index extends App.ControllerContent success: @relogin # error: @error, ) - + @Config.set('system_init_done', true) App.Event.trigger 'notify', { type: 'success' msg: App.i18n.translateContent( 'Welcome to %s!', @Config.get('product_name') ) @@ -123,13 +122,13 @@ class Index extends App.ControllerContent # rerender page @render() - fail: (data) -> - App.Event.trigger 'notify', { - type: 'error' - msg: App.i18n.translateContent( 'Can\'t create user!' ) - timeout: 2500 - } + fail: (data) -> + App.Event.trigger 'notify', { + type: 'error' + msg: App.i18n.translateContent( 'Can\'t create user!' ) + timeout: 2500 + } # @modalHide() )