Improved getting_started feature.
This commit is contained in:
parent
ecea57baba
commit
870df3af0f
3 changed files with 21 additions and 21 deletions
|
@ -10,9 +10,6 @@ class Index extends App.Controller
|
|||
constructor: ->
|
||||
super
|
||||
|
||||
# check authentication
|
||||
# return if !@authenticate()
|
||||
|
||||
# set title
|
||||
@title 'Get Started'
|
||||
@navupdate '#get_started'
|
||||
|
@ -41,14 +38,16 @@ class Index extends App.Controller
|
|||
# load group collection
|
||||
@loadCollection( type: 'Group', data: data.groups )
|
||||
|
||||
# load role collection
|
||||
@loadCollection( type: 'Role', data: data.roles )
|
||||
|
||||
# render page
|
||||
@render()
|
||||
)
|
||||
|
||||
render: ->
|
||||
|
||||
# check authentication, redirect to login if master user already exists
|
||||
if !@master_user && !@authenticate()
|
||||
@navigate '#login'
|
||||
|
||||
@html App.view('getting_started')(
|
||||
form_agent: @formGen( model: App.User, required: 'invite_agent' ),
|
||||
form_master: @formGen( model: App.User, required: 'signup' ),
|
||||
|
@ -91,7 +90,6 @@ class Index extends App.Controller
|
|||
# send email
|
||||
|
||||
# clear form
|
||||
# @fetch()
|
||||
auth = new App.Auth
|
||||
auth.login(
|
||||
data: {
|
||||
|
@ -110,6 +108,7 @@ class Index extends App.Controller
|
|||
@log 'login:success', data
|
||||
|
||||
if @master_user
|
||||
|
||||
# login check
|
||||
auth = new App.Auth
|
||||
auth.loginCheck()
|
||||
|
@ -127,5 +126,4 @@ class Index extends App.Controller
|
|||
# @navigate '#getting_started'
|
||||
# @fetch()
|
||||
|
||||
|
||||
Config.Routes['getting_started'] = Index
|
||||
|
|
|
@ -1,8 +1,17 @@
|
|||
<div class="hero-unit">
|
||||
<h1>Getting started!<small></small></h1>
|
||||
|
||||
<h1>Getting started!<small></small></h1>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
<ol>
|
||||
<li>Create Admin</li>
|
||||
<li>Invite Agents</li>
|
||||
<li>Configure Channels</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<% if @master_user: %>
|
||||
<div class="span6 master_user">
|
||||
|
|
|
@ -11,18 +11,11 @@ class GettingStartedController < ApplicationController
|
|||
|
||||
# get all groups
|
||||
@groups = Group.where( :active => true )
|
||||
@roles = Role.where( :active => true )
|
||||
|
||||
# return result
|
||||
respond_to do |format|
|
||||
format.json {
|
||||
render :json => {
|
||||
:master_user => master_user,
|
||||
:groups => @groups,
|
||||
:roles => @roles,
|
||||
}
|
||||
}
|
||||
end
|
||||
render :json => {
|
||||
:master_user => master_user,
|
||||
:groups => @groups,
|
||||
}
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in a new issue