From 4d2e578edf483984005fb9c02f6267962232c21e Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 10 Feb 2017 14:59:49 +0100 Subject: [PATCH] Improved translations and added language change support in overview for batch feature. --- .../app/controllers/ticket_overview.coffee | 13 +++++++++++ .../app/views/dashboard/stats.jst.eco | 2 +- .../ticket_overview/batch_overlay.jst.eco | 20 ++++++++++++++++ .../app/views/ticket_overview/index.jst.eco | 23 +------------------ .../views/widget/online_notification.jst.eco | 2 +- 5 files changed, 36 insertions(+), 24 deletions(-) create mode 100644 app/assets/javascripts/app/views/ticket_overview/batch_overlay.jst.eco diff --git a/app/assets/javascripts/app/controllers/ticket_overview.coffee b/app/assets/javascripts/app/controllers/ticket_overview.coffee index 18641ba68..0e6ec3678 100644 --- a/app/assets/javascripts/app/controllers/ticket_overview.coffee +++ b/app/assets/javascripts/app/controllers/ticket_overview.coffee @@ -30,6 +30,10 @@ class App.TicketOverview extends App.Controller @batchSupport = @permissionCheck('ticket.agent') @render() + # rerender view, e. g. on language change + @bind 'ui:rerender', => + @renderBatchOverlay() + startDragItem: (event) => return if !@batchSupport @grabbedItem = $(event.currentTarget) @@ -547,6 +551,8 @@ class App.TicketOverview extends App.Controller keyboardOn: @keyboardOn keyboardOff: @keyboardOff + @renderBatchOverlay(elLocal.filter('.js-batch-overlay')) + @html elLocal @el.find('.main').on('click', => @@ -562,6 +568,13 @@ class App.TicketOverview extends App.Controller App.OverviewListCollection.fetch(@view) @delay(update, 2800, 'overview:fetch') + renderBatchOverlay: (elLocal) => + if elLocal + elLocal.html( App.view('ticket_overview/batch_overlay')() ) + return + @batchOverlay.html( App.view('ticket_overview/batch_overlay')() ) + @refreshElements() + renderOptions: => macros = App.Macro.findAllByAttribute('active', true) groups = App.Group.findAllByAttribute('active', true) diff --git a/app/assets/javascripts/app/views/dashboard/stats.jst.eco b/app/assets/javascripts/app/views/dashboard/stats.jst.eco index d146fd861..5312d1477 100644 --- a/app/assets/javascripts/app/views/dashboard/stats.jst.eco +++ b/app/assets/javascripts/app/views/dashboard/stats.jst.eco @@ -71,7 +71,7 @@
<%- @Icon('reopening', "reopening-icon #{@StatsTicketReopen.state}-color") %>
-
<%- @T('%s% are being reopened', @StatsTicketReopen.percent) %>
+
<%- @T('%s% have been reopened', @StatsTicketReopen.percent) %>
<%- @T('Average: %s%', @StatsTicketReopen.average_per_agent) %>
diff --git a/app/assets/javascripts/app/views/ticket_overview/batch_overlay.jst.eco b/app/assets/javascripts/app/views/ticket_overview/batch_overlay.jst.eco new file mode 100644 index 000000000..f5ded5830 --- /dev/null +++ b/app/assets/javascripts/app/views/ticket_overview/batch_overlay.jst.eco @@ -0,0 +1,20 @@ +
+
+ <%- @T('drag here to cancel') %> +
+
+
<%- @T('run macro') %>
+ <%- @Icon('arrow-up') %> +
+
+ <%- @Icon('arrow-down') %> +
<%- @T('assign tickets') %>
+
+
+
+
+
+
+
+
+
\ 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 6ab46f034..5f4329177 100644 --- a/app/assets/javascripts/app/views/ticket_overview/index.jst.eco +++ b/app/assets/javascripts/app/views/ticket_overview/index.jst.eco @@ -3,25 +3,4 @@
-
-
-
- <%- @T('drag here to cancel') %> -
-
-
<%- @T('run macro') %>
- <%- @Icon('arrow-up') %> -
-
- <%- @Icon('arrow-down') %> -
<%- @T('assign tickets') %>
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file +
\ No newline at end of file diff --git a/app/assets/javascripts/app/views/widget/online_notification.jst.eco b/app/assets/javascripts/app/views/widget/online_notification.jst.eco index c514d65f0..7c1018597 100644 --- a/app/assets/javascripts/app/views/widget/online_notification.jst.eco +++ b/app/assets/javascripts/app/views/widget/online_notification.jst.eco @@ -5,7 +5,7 @@
- <%- @T("No unread notifications for you. :) ") %> + <%- @T("No unread notifications for you. :)") %>