Added new sidebars.
This commit is contained in:
parent
6f37a85f8b
commit
3131f945c4
4 changed files with 136 additions and 35 deletions
|
@ -1,4 +1,7 @@
|
|||
class App.OrganizationZoom extends App.Controller
|
||||
elements:
|
||||
'.tabsSidebar' : 'sidebar'
|
||||
|
||||
constructor: (params) ->
|
||||
super
|
||||
|
||||
|
@ -67,10 +70,9 @@ class App.OrganizationZoom extends App.Controller
|
|||
ui: @
|
||||
)
|
||||
|
||||
new Widgets(
|
||||
el: @el.find('.widgets')
|
||||
new Sidebar(
|
||||
el: @sidebar
|
||||
organization: organization
|
||||
ui: @
|
||||
)
|
||||
|
||||
class Overviews extends App.Controller
|
||||
|
@ -122,16 +124,48 @@ class Overviews extends App.Controller
|
|||
@el.find( '#sortable-sidebar' ).sortable( dndOptions )
|
||||
|
||||
|
||||
class Widgets extends App.Controller
|
||||
class Sidebar extends App.Controller
|
||||
constructor: ->
|
||||
super
|
||||
|
||||
# render ui
|
||||
@render()
|
||||
|
||||
render: ->
|
||||
|
||||
new App.WidgetOrganization(
|
||||
el: @el
|
||||
organization_id: @organization.id
|
||||
items = []
|
||||
|
||||
editOrganization = (e, el) =>
|
||||
new App.ControllerGenericEdit(
|
||||
id: @organization.id
|
||||
genericObject: 'Organization'
|
||||
pageData:
|
||||
title: 'Organizations'
|
||||
object: 'Organization'
|
||||
objects: 'Organizations'
|
||||
)
|
||||
showOrganization = (el) =>
|
||||
new App.WidgetOrganization(
|
||||
el: el
|
||||
organization_id: @organization.id
|
||||
)
|
||||
items.push {
|
||||
head: 'Organization'
|
||||
name: 'organization'
|
||||
icon: 'group'
|
||||
actions: [
|
||||
{
|
||||
name: 'Edit Organization'
|
||||
class: 'glyphicon glyphicon-edit'
|
||||
callback: editOrganization
|
||||
},
|
||||
]
|
||||
callback: showOrganization
|
||||
}
|
||||
|
||||
new App.Sidebar(
|
||||
el: @el
|
||||
items: items
|
||||
)
|
||||
|
||||
class ActionRow extends App.Controller
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
class App.UserZoom extends App.Controller
|
||||
elements:
|
||||
'.tabsSidebar' : 'sidebar'
|
||||
|
||||
constructor: (params) ->
|
||||
super
|
||||
|
||||
# check authentication
|
||||
return if !@authenticate()
|
||||
|
||||
|
||||
@navupdate '#'
|
||||
|
||||
App.User.full( @user_id, @render )
|
||||
|
@ -67,10 +69,10 @@ class App.UserZoom extends App.Controller
|
|||
ui: @
|
||||
)
|
||||
|
||||
new Widgets(
|
||||
el: @el.find('.widgets')
|
||||
user: user
|
||||
ui: @
|
||||
new Sidebar(
|
||||
el: @sidebar
|
||||
user: user
|
||||
textModule: @textModule
|
||||
)
|
||||
|
||||
class Overviews extends App.Controller
|
||||
|
@ -141,16 +143,79 @@ class Overviews extends App.Controller
|
|||
@el.find( '#sortable' ).sortable( dndOptions )
|
||||
@el.find( '#sortable-sidebar' ).sortable( dndOptions )
|
||||
|
||||
class Widgets extends App.Controller
|
||||
class Sidebar extends App.Controller
|
||||
constructor: ->
|
||||
super
|
||||
|
||||
# render ui
|
||||
@render()
|
||||
|
||||
render: ->
|
||||
|
||||
new App.WidgetUser(
|
||||
el: @el
|
||||
user_id: @user.id
|
||||
items = []
|
||||
|
||||
showCustomer = (el) =>
|
||||
new App.WidgetUser(
|
||||
el: el
|
||||
user_id: @user.id
|
||||
)
|
||||
|
||||
editCustomer = (e, el) =>
|
||||
new App.ControllerGenericEdit(
|
||||
id: @user.id
|
||||
genericObject: 'User'
|
||||
screen: 'edit'
|
||||
pageData:
|
||||
title: 'Users'
|
||||
object: 'User'
|
||||
objects: 'Users'
|
||||
)
|
||||
items.push {
|
||||
head: 'Customer'
|
||||
name: 'customer'
|
||||
icon: 'person'
|
||||
actions: [
|
||||
{
|
||||
name: 'Edit Customer'
|
||||
class: 'glyphicon glyphicon-edit'
|
||||
callback: editCustomer
|
||||
},
|
||||
]
|
||||
callback: showCustomer
|
||||
}
|
||||
|
||||
if @user.organization_id
|
||||
editOrganization = (e, el) =>
|
||||
new App.ControllerGenericEdit(
|
||||
id: @user.organization_id
|
||||
genericObject: 'Organization'
|
||||
pageData:
|
||||
title: 'Organizations'
|
||||
object: 'Organization'
|
||||
objects: 'Organizations'
|
||||
)
|
||||
showOrganization = (el) =>
|
||||
new App.WidgetOrganization(
|
||||
el: el
|
||||
organization_id: @user.organization_id
|
||||
)
|
||||
items.push {
|
||||
head: 'Organization'
|
||||
name: 'organization'
|
||||
icon: 'group'
|
||||
actions: [
|
||||
{
|
||||
name: 'Edit Organization'
|
||||
class: 'glyphicon glyphicon-edit'
|
||||
callback: editOrganization
|
||||
},
|
||||
]
|
||||
callback: showOrganization
|
||||
}
|
||||
|
||||
new App.Sidebar(
|
||||
el: @el
|
||||
items: items
|
||||
)
|
||||
|
||||
class ActionRow extends App.Controller
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
<div class="sidebar">
|
||||
<div class="widgets"></div>
|
||||
<div class="action"></div>
|
||||
</div>
|
||||
<div class="main flex">
|
||||
<div class="main flex tabsSidebarSpace">
|
||||
<div class="organizationZoom">
|
||||
<div class="page-header">
|
||||
<h1><%- @T( @head ) %></h1>
|
||||
</div>
|
||||
|
||||
<div class="main-overviews" id="sortable"></div>
|
||||
|
||||
<div class="page-header">
|
||||
<h1></h1>
|
||||
</div>
|
||||
|
||||
<div class="main-overviews" id="sortable"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tabsSidebar vertical"></div>
|
|
@ -1,13 +1,16 @@
|
|||
<div class="sidebar">
|
||||
<div class="widgets"></div>
|
||||
<div class="action"></div>
|
||||
</div>
|
||||
<div class="main flex">
|
||||
<div class="main flex tabsSidebarSpace">
|
||||
<div class="userZoom">
|
||||
<div class="page-header">
|
||||
<h1><%- @T( @head ) %></h1>
|
||||
</div>
|
||||
|
||||
<div class="main-overviews" id="sortable"></div>
|
||||
|
||||
<div class="page-header">
|
||||
<h1></h1>
|
||||
</div>
|
||||
|
||||
<div class="main-overviews" id="sortable"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tabsSidebar vertical"></div>
|
||||
|
||||
<!--
|
||||
<div class="action"></div>
|
||||
-->
|
Loading…
Reference in a new issue