Moved to new namespaces.

This commit is contained in:
Martin Edenhofer 2013-09-18 20:45:07 +02:00
parent e6a0380fa8
commit a5a3a8070b
11 changed files with 85 additions and 63 deletions

View file

@ -37,7 +37,7 @@ class App.TicketCustomer extends App.ControllerModal
@modalHide()
# reload zoom view
@zoom.render()
@ui.render()
# load user if not already exists
App.User.retrieve( params['customer_id'], callback )

View file

@ -525,6 +525,17 @@ class Navbar extends App.Controller
else
@render( [] )
# init fetch via ajax, all other updates on time via websockets
@ajax(
id: 'ticket_overviews',
type: 'GET',
url: @apiPath + '/ticket_overviews',
processData: true,
success: (data) =>
App.Store.write( 'navupdate_ticket_overview', data )
@render(data)
)
render: (dataOrig) ->
data = _.clone(dataOrig)

View file

@ -140,6 +140,7 @@ class App.TicketZoom extends App.Controller
@frontendTimeUpdate()
@TicketTitle()
@TicketWidgets()
@TicketAction()
@ArticleView()
@ -195,15 +196,24 @@ class App.TicketZoom extends App.Controller
ui: @
)
TicketAction: =>
TicketWidgets: =>
# show ticket action row
new TicketAction(
new TicketWidgets(
ticket: @ticket
task_key: @task_key
el: @el.find('.ticket-action')
el: @el.find('.ticket-widgets')
ui: @
)
TicketAction: =>
# start action controller
if !@isRole('Customer')
new TicketActionRow(
el: @el.find('.ticket-action')
ticket: @ticket
ui: @
)
class TicketTitle extends App.Controller
events:
'blur .ticket-title-update': 'update'
@ -213,7 +223,7 @@ class TicketTitle extends App.Controller
@render()
render: ->
@html App.view('ticket_zoom/ticket_title')(
@html App.view('ticket_zoom/title')(
ticket: @ticket
)
@ -247,7 +257,7 @@ class TicketInfo extends App.ControllerDrox
render: ->
@html @template(
file: 'ticket_zoom/ticket_info'
file: 'ticket_zoom/info'
header: '#' + @ticket.number
params:
ticket: @ticket
@ -261,14 +271,14 @@ class TicketInfo extends App.ControllerDrox
object: @ticket
)
class TicketAction extends App.Controller
class TicketWidgets extends App.Controller
constructor: ->
super
@render()
render: ->
@html App.view('ticket_zoom/ticket_action')()
@html App.view('ticket_zoom/widgets')()
# show ticket info
new TicketInfo(
@ -284,15 +294,6 @@ class TicketAction extends App.Controller
ticket: @ticket
)
# start action controller
###
if !@isRole('Customer')
new TicketActionRow(
el: @el.find('.action_info')
ticket: @ticket
zoom: @ui
)
###
# start link info controller
if !@isRole('Customer')
new App.LinkInfo(
@ -301,8 +302,6 @@ class TicketAction extends App.Controller
object: @ticket
)
class Edit extends App.Controller
events:
'click .submit': 'update'
@ -789,7 +788,7 @@ class TicketActionRow extends App.Controller
@render()
render: ->
@html App.view('ticket_action')()
@html App.view('ticket_zoom/actions')()
history_dialog: (e) ->
e.preventDefault()
@ -797,11 +796,11 @@ class TicketActionRow extends App.Controller
merge_dialog: (e) ->
e.preventDefault()
new App.TicketMerge( ticket_id: @ticket.id, task_key: @zoom.task_key )
new App.TicketMerge( ticket_id: @ticket.id, task_key: @ui.task_key )
customer_dialog: (e) ->
e.preventDefault()
new App.TicketCustomer( ticket_id: @ticket.id, zoom: @zoom )
new App.TicketCustomer( ticket_id: @ticket.id, ui: @ui )
class TicketZoomRouter extends App.ControllerPermanent
constructor: (params) ->

View file

@ -1,4 +1,4 @@
<div class="content-one">
<div class="content-one ticket-create">
<div class="page-header clearfix">
<div class="page-header-title">
<h1 class="pull-left"><%- @T( 'New Ticket' ) %></h1>

View file

@ -1,6 +1,7 @@
<div class="content-two">
<div class="sidebar">
<div class="ticket-action panel-group"></div>
<div class="ticket-widgets"></div>
<div class="ticket-action"></div>
</div>
<div class="main">

View file

@ -1,5 +1,4 @@
<br>
<div class="btn-group">
<div class="btn-group dropup">
<button type="button" class="btn btn-default dropdown-toggle action" data-toggle="dropdown"><%- @T('Action') %> <span class="caret"></span>
</button>
<ul class="dropdown-menu">
@ -7,15 +6,4 @@
<li><a href="#" data-type="merge"><%- @T( 'Merge' ) %></a></li>
<li><a href="#" data-type="customer"><%- @T( 'Change Customer' ) %></a></li>
</ul>
</div>
<br>
<!--
<div class="">
<h3><%- @T( 'Actions' ) %></h3>
<ul>
<li><a href="#" data-type="history"><%- @T( 'History' ) %></a></li>
<li><a href="#" data-type="merge"><%- @T( 'Merge' ) %></a></li>
<li><a href="#" data-type="customer"><%- @T( 'Change Customer' ) %></a></li>
</ul>
</div>
-->
</div>

View file

@ -1,23 +1,21 @@
<div class="">
<!--
<div class="avatar thumbnails">
<img class="thumbnail user-data" data-id="<%= @S('id') %>" src="<%- @S('image') %>" alt="">
</div>
-->
<div class="well edit-ticket <% if @formChanged: %>form-changed<% end %>">
<div class="edit-title">
<h4><%- @T('Edit') %>
<small class="reset-message<% if !@formChanged: %> hide<% end %>">
<a href="#" data-type="reset"><%- @T('Discard your unsaved changes.') %></a> <href="#" class="glyphicon glyphicon-repeat" data-type="reset"></a>
</small>
</h4>
<div class="article clearfix">
<div class="avatar thumbnails">
<img class="thumbnail user-data" data-id="<%= @S('id') %>" src="<%- @S('image') %>" alt="">
</div>
<div class="well edit-ticket article-message <% if @formChanged: %>form-changed<% end %>">
<div class="edit-title article-content">
<h4><%- @T('Edit') %>
<small class="reset-message<% if !@formChanged: %> hide<% end %>">
<a href="#" data-type="reset"><%- @T('Discard your unsaved changes.') %></a> <href="#" class="glyphicon glyphicon-repeat" data-type="reset"></a>
</small>
</h4>
</div>
<div class="edit-content">
<form class="form-stacked ticket-update">
<div class="form-ticket-update"></div>
<div class="form-article-update"></div>
<button type="submit" class="btn btn-primary submit"><%- @T( 'Submit' ) %></button>
</form>
<div>
</div>
<div class="edit-content">
<form class="form-stacked ticket-update">
<div class="form-ticket-update"></div>
<div class="form-article-update"></div>
<button type="submit" class="btn btn-primary submit"><%- @T( 'Submit' ) %></button>
</form>
<div>
</div>
</div>

View file

@ -1,4 +1,3 @@
<div class="ticket_info"></div>
<div class="customer_info"></div>
<div class="action_info"></div>
<div class="link_info"></div>

View file

@ -602,7 +602,8 @@ form.form-inline input[type="password"] {
font-size: 12px;
}
.edit-content {
margin-top: 20px;
margin-left: 68px;
margin-right: 22px;
}
.delete {
@ -660,7 +661,32 @@ footer {
}
.ticket-action {
padding-left: 2px;
padding: 6px 8px 6px;
position: fixed;
bottom: 0px;
background-color: #fff;
width: 100%;
left: 0px;
border-top: 1px solid #eeeeee;
width: 200px;
margin-left: 4px;
}
@media (min-width: 800px) {
.ticket-action {
width: 240px;
}
}
@media (min-width: 1024px) {
.ticket-action {
width: 260px;
}
}
@media (min-width: 1200px) {
.ticket-action {
width: 280px;
}
}
.ticket-answer .avatar {
@ -677,7 +703,7 @@ footer {
width: 100%;
}
.ticket-update .span2 {
width: 160px;
width: 152px;
margin-right: 4px;
}
.ticket-update .medium {