Improved getting_started feature.

This commit is contained in:
Martin Edenhofer 2012-04-11 08:34:56 +02:00
parent ecea57baba
commit 870df3af0f
3 changed files with 21 additions and 21 deletions

View file

@ -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

View file

@ -1,8 +1,17 @@
<div class="hero-unit">
<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">

View file

@ -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
end
end