Moved widgets to 3 categories. nav, widget and footer.
This commit is contained in:
parent
775af9315d
commit
cc93ec7e3f
9 changed files with 47 additions and 29 deletions
|
@ -12,4 +12,4 @@ class App.Footer extends App.Controller
|
|||
render: () ->
|
||||
@html App.view('footer')()
|
||||
|
||||
App.Config.set( 'zzzfooter', App.Footer, 'Widgets' )
|
||||
App.Config.set( 'footer', App.Footer, 'Footers' )
|
||||
|
|
|
@ -342,4 +342,4 @@ class App.Navigation extends App.Controller
|
|||
|
||||
@Config.set( 'NavBarRight', NavBarRight )
|
||||
|
||||
App.Config.set( 'navigation', App.Navigation, 'Widgets' )
|
||||
App.Config.set( 'navigation', App.Navigation, 'Navigations' )
|
||||
|
|
|
@ -21,24 +21,31 @@ class App.Run extends App.Controller
|
|||
# check if session already exists/try to get session data from server
|
||||
App.Auth.loginCheck()
|
||||
|
||||
# start navbars
|
||||
@setupWidget( 'Navigations', 'nav', @el.find('nav') )
|
||||
|
||||
# start widgets
|
||||
App.Event.trigger('widget:init')
|
||||
widgets = App.Config.get( 'Widgets' )
|
||||
if widgets
|
||||
sortedKeys = []
|
||||
for key, value of widgets
|
||||
sortedKeys.push key
|
||||
sortedKeys = sortedKeys.sort()
|
||||
for key in sortedKeys
|
||||
@el.append('<div id="' + key + '"></div>')
|
||||
new widgets[key]( el: @el.find("##{key}") )
|
||||
App.Event.trigger('widget:ready')
|
||||
@setupWidget( 'Widgets', 'widget', @el.find('section') )
|
||||
|
||||
# start widgets
|
||||
@setupWidget( 'Footers', 'footer', @el.find('footer') )
|
||||
|
||||
# bind to fill selected text into
|
||||
App.ClipBoard.bind( @el )
|
||||
|
||||
App.Event.trigger('app:ready')
|
||||
|
||||
setupWidget: (config, event, el) ->
|
||||
|
||||
# start widgets
|
||||
App.Event.trigger( event + ':init')
|
||||
widgets = App.Config.get( config )
|
||||
if widgets
|
||||
for key, widget of widgets
|
||||
el.append('<div id="' + key + '"></div>')
|
||||
new widget( el: el.find("##{key}") )
|
||||
App.Event.trigger( event + ':ready')
|
||||
|
||||
class App.Content extends App.Controller
|
||||
className: 'container'
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ class _Singleton extends App.Controller
|
|||
|
||||
# create div for permanent content
|
||||
if !$("#content_permanent")[0]
|
||||
$('#app').append('<div id="content_permanent" class="container"></div>')
|
||||
$('#app section').append('<div id="content_permanent" class="container"></div>')
|
||||
|
||||
# empty static content if task is shown
|
||||
if active
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<footer class="footer">
|
||||
<div>
|
||||
<p class="pull-right"><a href="javascript:window.scrollTo(0,0);"><%- @T('Back to top') %></a></p>
|
||||
<p><%- @T('Designed and built with all the love in the world') %> <a href="http://twitter.com/zammad_org">@zammad_org</a></p>
|
||||
</footer>
|
||||
</div>
|
||||
|
|
|
@ -247,8 +247,7 @@ form {
|
|||
}
|
||||
|
||||
footer {
|
||||
padding-top: 17px;
|
||||
border-top: 1px solid #EEE;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.search-query {
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
<div id="app"></div>
|
||||
<div id="splash"><div class="logo">booting...</div></div>
|
||||
<div id="app">
|
||||
<nav></nav>
|
||||
<section></section>
|
||||
<footer></footer>
|
||||
</div>
|
||||
<div id="splash">
|
||||
<div class="logo">booting...</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
jQuery(function(){
|
||||
new App.Run();
|
||||
|
|
|
@ -14,10 +14,16 @@
|
|||
1.4.1) auth:login
|
||||
1.4.2) auth:logout
|
||||
|
||||
1.5) widget:init
|
||||
1.5.1) widget:ready
|
||||
1.5) nav:init
|
||||
1.5.1) nav:ready
|
||||
|
||||
1.6) app:ready
|
||||
1.6) widget:init
|
||||
1.6.1) widget:ready
|
||||
|
||||
1.7) footer:init
|
||||
1.7.1) footer:ready
|
||||
|
||||
1.8) app:ready
|
||||
|
||||
|
||||
2) Task
|
||||
|
|
|
@ -218,7 +218,7 @@ class AgentTicketActionSimpleTest < TestCase
|
|||
# check ticket
|
||||
{
|
||||
:execute => 'match',
|
||||
:css => '.active',
|
||||
:css => '.content_permanent.active',
|
||||
:value => 'some body 123äöü 222',
|
||||
:match_result => true,
|
||||
},
|
||||
|
@ -226,22 +226,22 @@ class AgentTicketActionSimpleTest < TestCase
|
|||
# update ticket
|
||||
{
|
||||
:execute => 'select',
|
||||
:css => '.active select[name="ticket_article_type_id"]',
|
||||
:css => '.content_permanent.active select[name="ticket_article_type_id"]',
|
||||
:value => 'note',
|
||||
},
|
||||
{
|
||||
:execute => 'check',
|
||||
:css => '.active textarea[name="body"]',
|
||||
:css => '.content_permanent.active textarea[name="body"]',
|
||||
:result => true,
|
||||
},
|
||||
{
|
||||
:execute => 'set',
|
||||
:css => '.active textarea[name="body"]',
|
||||
:css => '.content_permanent.active textarea[name="body"]',
|
||||
:value => 'some body 1234 äöüß 222',
|
||||
},
|
||||
{
|
||||
:execute => 'click',
|
||||
:css => '.active button',
|
||||
:css => '.content_permanent.active button',
|
||||
},
|
||||
{
|
||||
:execute => 'wait',
|
||||
|
@ -249,7 +249,7 @@ class AgentTicketActionSimpleTest < TestCase
|
|||
},
|
||||
{
|
||||
:execute => 'match',
|
||||
:css => '.active .ticket-answer',
|
||||
:css => '.content_permanent.active .ticket-answer',
|
||||
:value => 'some body 1234 äöüß 222',
|
||||
:match_result => true,
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue