diff --git a/app/assets/javascripts/app/controllers/ticket_overview.coffee b/app/assets/javascripts/app/controllers/ticket_overview.coffee index 266caf90b..a724357e2 100644 --- a/app/assets/javascripts/app/controllers/ticket_overview.coffee +++ b/app/assets/javascripts/app/controllers/ticket_overview.coffee @@ -14,16 +14,66 @@ class App.TicketOverview extends App.Controller '.js-batch-assign': 'batchAssign' '.js-batch-macro': 'batchMacro' - #events: - # 'mousedown .item': 'startDragItem' - # 'mouseenter .js-batch-overlay-entry': 'highlightBatchEntry' - # 'mouseleave .js-batch-overlay-entry': 'unhighlightBatchEntry' + events: + 'mousedown .item': 'startDragItem' + 'mouseenter .js-batch-overlay-entry': 'highlightBatchEntry' + 'mouseleave .js-batch-overlay-entry': 'unhighlightBatchEntry' constructor: -> super @render() - startDragItem: (event) -> + users = [ + App.User.find(2), + App.User.find(2), + App.User.find(2), + ] + groups = App.Group.all() + + @batchAssign.html $(App.view('ticket_overview/batch_overlay_user_group')( + users: users + groups: groups + )) + macros = [ + { + name: 'Close Beispiel für eine besonders' + }, + { + name: 'Close Beispiel für eine besonders' + }, + { + name: 'Close Beispiel für eine besonders' + }, + { + name: 'Close Beispiel für eine besonders' + }, + { + name: 'Close Beispiel für eine besonders' + }, + { + name: 'Close Beispiel für eine besonders' + }, + { + name: 'Close Beispiel für eine besonders' + }, + { + name: 'Close & Tag as Spam' + }, + { + name: 'Close & Reply we\'re on Holidays' + }, + { + name: 'Escalate to 2nd level' + }, + { + name: '1st Close' + }, + ] + @batchMacro.html $(App.view('ticket_overview/batch_overlay_macro')( + macros: macros + )) + + startDragItem: (event) => @grabbedItem = $(event.currentTarget) offset = @grabbedItem.offset() @batchDragger = $(App.view('ticket_overview/batch_dragger')()) @@ -114,11 +164,12 @@ class App.TicketOverview extends App.Controller complete: => # clean scale action = @hoveredBatchEntry.attr('data-action') + id = @hoveredBatchEntry.attr('data-id') items = @el.find('[name="bulk"]:checked') @hoveredBatchEntry.removeAttr('style') @cleanUpDrag(true) - @performBatchAction items, action + @performBatchAction items, action, id @batchDragger.velocity properties: scale: 0 @@ -160,8 +211,8 @@ class App.TicketOverview extends App.Controller easing: 'ease-in-out' duration: 300 - performBatchAction: (items, action) -> - console.log "perform action #{action} on #{items.length} checked items" + performBatchAction: (items, action, id) -> + console.log "perform action #{action} with id #{id} on #{items.length} checked items" showBatchOverlay: -> @batchOverlay.show() diff --git a/app/assets/javascripts/app/views/ticket_overview/batch_overlay_macro.jst.eco b/app/assets/javascripts/app/views/ticket_overview/batch_overlay_macro.jst.eco new file mode 100644 index 000000000..8f490f314 --- /dev/null +++ b/app/assets/javascripts/app/views/ticket_overview/batch_overlay_macro.jst.eco @@ -0,0 +1,7 @@ +
\ No newline at end of file diff --git a/app/assets/javascripts/app/views/ticket_overview/batch_overlay_user_group.jst.eco b/app/assets/javascripts/app/views/ticket_overview/batch_overlay_user_group.jst.eco new file mode 100644 index 000000000..602addf12 --- /dev/null +++ b/app/assets/javascripts/app/views/ticket_overview/batch_overlay_user_group.jst.eco @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/app/assets/javascripts/app/views/ticket_overview/index.jst.eco b/app/assets/javascripts/app/views/ticket_overview/index.jst.eco index 44a7f9b6b..f7151e764 100644 --- a/app/assets/javascripts/app/views/ticket_overview/index.jst.eco +++ b/app/assets/javascripts/app/views/ticket_overview/index.jst.eco @@ -16,202 +16,6 @@ <%- @Icon('arrow-down') %> - - - - + + \ No newline at end of file