From f4341f5c4bf9ec91b4001fe33193101de12ac8e6 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 12 Jan 2015 12:06:07 +0100 Subject: [PATCH 01/75] Added dropped test. --- test/unit/email_process_test.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/unit/email_process_test.rb b/test/unit/email_process_test.rb index 9bead59fb..4cd6a3072 100644 --- a/test/unit/email_process_test.rb +++ b/test/unit/email_process_test.rb @@ -2050,6 +2050,28 @@ Some Text', }, }, }, + { + :data => 'From: Some Body +To: Bob +Cc: any@example.com +Subject: some subject + +Some Text', + :trusted => false, + :success => true, + :result => { + 0 => { + :group => group2.name, + :priority => '2 normal', + :title => 'some subject', + }, + 1 => { + :sender => 'Customer', + :type => 'email', + :internal => true, + }, + }, + }, ] process(files) PostmasterFilter.destroy_all From b08fe508880005c6a7c66f009df4c07b24a7dde1 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Mon, 12 Jan 2015 14:32:24 +0100 Subject: [PATCH 02/75] fix inconsistent colours --- app/assets/stylesheets/zammad.css.scss | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/zammad.css.scss b/app/assets/stylesheets/zammad.css.scss index b4bc6b83e..a049c4fcf 100644 --- a/app/assets/stylesheets/zammad.css.scss +++ b/app/assets/stylesheets/zammad.css.scss @@ -18,7 +18,7 @@ p { } .u-highlight { - color: hsl(194,90%,45%); + color: #0F94D6; } a { @@ -752,6 +752,16 @@ textarea, border-color: #ececec; } +.pagination > .active > a, +.pagination > .active > span, +.pagination > .active > a:hover, +.pagination > .active > span:hover, +.pagination > .active > a:focus, +.pagination > .active > span:focus { + background: #0F94D6; + border-color: #0F94D6; +} + .pagination-counter { margin-right: 19px; line-height: 28px; @@ -1826,6 +1836,11 @@ footer { padding: 10px 20px; } +.tableOverview-edit { + @extend .u-clickable; + @extend .u-highlighted; +} + .bulkAction { background: white; z-index: 1; From 7b62f6cce1a25d2297fba0103c2a47f30928cebf Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Mon, 12 Jan 2015 15:05:17 +0100 Subject: [PATCH 03/75] fix article actions order order after meta-data (test: click on article) --- .../views/ticket_zoom/article_view.jst.eco | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/app/views/ticket_zoom/article_view.jst.eco b/app/assets/javascripts/app/views/ticket_zoom/article_view.jst.eco index b14ab148a..96fbba45b 100644 --- a/app/assets/javascripts/app/views/ticket_zoom/article_view.jst.eco +++ b/app/assets/javascripts/app/views/ticket_zoom/article_view.jst.eco @@ -59,17 +59,6 @@ <% end %> - <% if article.actions: %> -
-
- <% for action in article.actions: %> - - <%- @T( action.name ) %> - - <% end %> -
-
- <% end %> @@ -90,6 +79,18 @@ + <% if article.actions: %> +
+
+ <% for action in article.actions: %> + + <%- @T( action.name ) %> + + <% end %> +
+
+ <% end %> + <% end %> \ No newline at end of file From ee6e89e3e9d71b73e92350b3c33186c61db78642 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Mon, 12 Jan 2015 15:34:09 +0100 Subject: [PATCH 04/75] fix light phone cutoff --- public/assets/images/sprite.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/assets/images/sprite.svg b/public/assets/images/sprite.svg index 42f527c95..992dec70f 100644 --- a/public/assets/images/sprite.svg +++ b/public/assets/images/sprite.svg @@ -1,6 +1,6 @@ - - + + Slice 2 Created with Sketch. From cb13722b7de40870823575e85607aa7b10d7204a Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Mon, 12 Jan 2015 15:34:28 +0100 Subject: [PATCH 05/75] fix deformed avatar bug in FF --- .../layout_ref/communication_overview.jst.eco | 18 +-- .../views/ticket_zoom/article_view.jst.eco | 6 +- .../app/views/ticket_zoom/edit.jst.eco | 127 +++++++++--------- app/assets/stylesheets/zammad.css.scss | 52 +++---- 4 files changed, 103 insertions(+), 100 deletions(-) diff --git a/app/assets/javascripts/app/views/layout_ref/communication_overview.jst.eco b/app/assets/javascripts/app/views/layout_ref/communication_overview.jst.eco index 3016ce3c7..dd73a13a9 100644 --- a/app/assets/javascripts/app/views/layout_ref/communication_overview.jst.eco +++ b/app/assets/javascripts/app/views/layout_ref/communication_overview.jst.eco @@ -44,7 +44,7 @@
-
+
-
+
NB
Welcome! @@ -98,7 +98,7 @@ The Zammad
-
+
-
- +
+
Hallp HP, du kannst dich nur einmal einloggen. Was machst du genau?
@@ -136,7 +136,7 @@ The
Zammad
-
+
-
+
NB
Ich wollte mir die Lyrics von Maria herunterladen, aber ich schaff es einfach nicht, da raufzukommen. Schick mir bitte mein Passwort. @@ -182,7 +182,7 @@ Grüße, Peter
-
+
-
+
Lieber HP,
diff --git a/app/assets/javascripts/app/views/ticket_zoom/article_view.jst.eco b/app/assets/javascripts/app/views/ticket_zoom/article_view.jst.eco index 96fbba45b..362003e9e 100644 --- a/app/assets/javascripts/app/views/ticket_zoom/article_view.jst.eco +++ b/app/assets/javascripts/app/views/ticket_zoom/article_view.jst.eco @@ -1,5 +1,5 @@ <% for article in @articles: %> -
+
-
+
<% if article.sender.name isnt 'Agent': %> <% position = 'left' %> <% else: %> <% position = 'right' %> <% end %> <%- article.created_by.avatar("40", position) %> -
+
diff --git a/app/assets/javascripts/app/views/ticket_zoom/edit.jst.eco b/app/assets/javascripts/app/views/ticket_zoom/edit.jst.eco index 5d2f7a260..4eef2a887 100644 --- a/app/assets/javascripts/app/views/ticket_zoom/edit.jst.eco +++ b/app/assets/javascripts/app/views/ticket_zoom/edit.jst.eco @@ -2,87 +2,84 @@ -
-
- <%- App.User.fullLocal( @S('id') ).avatar("40", 'right', 'zIndex-5') %> -
-
-
-
-
-
- <% for atricleType in @articleTypes: %> -
-
-
- <% end %> -
-
+
+ <%- App.User.fullLocal( @S('id') ).avatar("40", 'right', 'zIndex-5') %> +
+
+
-
-
"> -
-
-
"> -
+
+
+ <% for atricleType in @articleTypes: %> +
+
+
+ <% end %>
-
+
+
"> +
+
+
"> +
+
+
+
+
-
+
-
-
- -
-
+
+
+
-
-
- -
-
+
+
+
+
+
+
+
-
-
-
<%- @article.body %>
- -
-
-
- <%- @T('Antwort eingeben oder') %> - - <%- @T('Dateien wählen..') %> - - -
-
-
-
- <%- @T(' Uploading ') %> (0%) ... -
-
-
<%- @T('Cancel Upload') %> -
+
+
+
<%- @article.body %>
+ +
+
+
+ <%- @T('Antwort eingeben oder') %> + + <%- @T('Dateien wählen..') %> + + +
+
+
+
+ <%- @T(' Uploading ') %> (0%) ... +
+
+
<%- @T('Cancel Upload') %>
-
+
-
-
- <%- @T('Drop Files here') %> -
+
+
+
+ <%- @T('Drop Files here') %>
-
\ No newline at end of file diff --git a/app/assets/stylesheets/zammad.css.scss b/app/assets/stylesheets/zammad.css.scss index a049c4fcf..3abc78dd9 100644 --- a/app/assets/stylesheets/zammad.css.scss +++ b/app/assets/stylesheets/zammad.css.scss @@ -2970,6 +2970,13 @@ footer { margin-top: 55px; } +.ticket-article, +.ticket-edit { + max-width: 800px; + margin: 0 auto; + padding: 0 21px; +} + .ticket-title { max-width: 800px; padding: 0 81px; @@ -2990,24 +2997,20 @@ footer { display: block; } -.bubble-grid { - max-width: 800px; - margin: 0 auto; - padding: 0 21px; -} - - .bubble-gap { - margin-left: 15px !important; - } - - .customer.ticket-article-item .bubble-gap { - margin-left: 0 !important; - margin-right: 15px !important; - } - .ticket-article-item { padding-bottom: 33px; position: relative; + + .avatar { + position: absolute; + right: 0; + top: 5px; + } + + &.agent .avatar { + right: auto; + left: 0; + } } /* @@ -3019,20 +3022,16 @@ footer { overflow: hidden; position: relative; height: 100%; + margin: 0 55px; } .article-content { position: relative; - margin-right: 55px; + padding: 0 55px; } - .customer.ticket-article-item .article-content { - margin-right: 0; - margin-left: 55px; - } .article-content-meta { - padding: 0 55px; position: absolute; width: 100%; } @@ -3054,7 +3053,7 @@ footer { } .article-meta-key { - width: 13%; + width: 20%; text-transform: uppercase; } @@ -3094,6 +3093,7 @@ footer { box-shadow: 0 0 1px rgba(0,0,0,.06) inset; position: relative; overflow-wrap: break-word; + word-wrap: break-word; } /* email css reset */ @@ -3211,6 +3211,10 @@ footer { vertical-align: top; } +.article-add { + position: relative; +} + .ticket-edit { margin-top: auto; margin-bottom: 36px; @@ -3230,7 +3234,9 @@ footer { } .editControls { - position: relative; + position: absolute; + left: 0; + top: 5px; } .editControls-item { From 8d3da7c77d7905d29a09aafdb2ef115c0d14da63 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Mon, 12 Jan 2015 16:25:39 +0100 Subject: [PATCH 06/75] fix extend typo --- app/assets/stylesheets/zammad.css.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/zammad.css.scss b/app/assets/stylesheets/zammad.css.scss index 3abc78dd9..ccb71dbb5 100644 --- a/app/assets/stylesheets/zammad.css.scss +++ b/app/assets/stylesheets/zammad.css.scss @@ -1838,7 +1838,7 @@ footer { .tableOverview-edit { @extend .u-clickable; - @extend .u-highlighted; + @extend .u-highlight; } .bulkAction { From c67048131cd3f4391daedbd0cda6be0207af3bad Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Mon, 12 Jan 2015 16:38:08 +0100 Subject: [PATCH 07/75] add favicon --- public/favicon.ico | Bin 0 -> 32988 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/public/favicon.ico b/public/favicon.ico index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..cd31b71bfa442980691e9a91c8a1e9b0da6fe6b4 100644 GIT binary patch literal 32988 zcmeHP30PCd7M`foqPA{WTeSj}x1n{V!&JIne1J2Q9Y z%$Y%mg1Vq7QxNzjXgK&Y5JDyw9Ve*4L@Awq}eBh(ARRq?wZbj=Z=;gANR zAqF@SuD|pQ=oxsL0a_}4>*>%}C&Vln_oH(ayXjo~#Q+ZO_Ua(lM2aa;55BYD%8P*u zPxE9vQuFPrat|C#1P;WOsTk9f|`E*Uwc*X6P!ai*oe+m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6sgveTUWlEoj88Ki>B#&pwj^^797H&HB#CP8PwKE2|tfEcK(N@_;=$<6*DPrSCsC ztSQe9;=x{=1!zQ$vB8*}y<;bccA5@NJ&vqI&m3 Date: Mon, 12 Jan 2015 23:13:50 +0100 Subject: [PATCH 08/75] moved mark as seen to ruby function --- .../widget/online_notification.js.coffee | 18 +++++++++++----- .../online_notifications_controller.rb | 8 +++++++ app/models/online_notification.rb | 21 ++++++++----------- config/routes/online_notification.rb | 5 +++-- 4 files changed, 33 insertions(+), 19 deletions(-) diff --git a/app/assets/javascripts/app/controllers/widget/online_notification.js.coffee b/app/assets/javascripts/app/controllers/widget/online_notification.js.coffee index f3a0689eb..a998599f5 100644 --- a/app/assets/javascripts/app/controllers/widget/online_notification.js.coffee +++ b/app/assets/javascripts/app/controllers/widget/online_notification.js.coffee @@ -43,10 +43,18 @@ class App.OnlineNotificationWidget extends App.Controller else @el.find('.logo').append('

' + count.toString() + '
') - markAllAsSeen: (items) => - for item in items - if !item.seen - App.OnlineNotification.seen( 'Ticket', item.id ) + markAllAsSeen: () => + @ajax( + id: 'markAllAsSeen' + type: 'POST' + url: @apiPath + '/online_notifications/markAllAsSeen' + data: JSON.stringify( '' ) + processData: true + success: (data, status, xhr) => + if data.result is 'ok' + else + fail: => + ) stop: => @counterUpdate(0) @@ -81,7 +89,7 @@ class App.OnlineNotificationWidget extends App.Controller # show frontend times $('#markAllAsSeen').bind('click', (e) => e.preventDefault() - @markAllAsSeen(items) + @markAllAsSeen() ); @frontendTimeUpdate() ).on('hide.bs.popover', => diff --git a/app/controllers/online_notifications_controller.rb b/app/controllers/online_notifications_controller.rb index 20a60efb1..4ee59f38c 100644 --- a/app/controllers/online_notifications_controller.rb +++ b/app/controllers/online_notifications_controller.rb @@ -88,4 +88,12 @@ curl http://localhost/api/v1/online_notifications -v -u #{login}:#{password} -H model_update_render(OnlineNotification, params) end + def markAllAsSeen + notifications = OnlineNotification.list(current_user,100) + notifications.each do |notification| + OnlineNotification.seen({:id => notification['id']}) + end + render :json => {data:'all cool'} + end + end diff --git a/app/models/online_notification.rb b/app/models/online_notification.rb index dadbf5588..0b4112d31 100644 --- a/app/models/online_notification.rb +++ b/app/models/online_notification.rb @@ -47,23 +47,20 @@ add a new online notification for this user =begin -add a new online notification for this user +mark online notification as seen - OnlineNotification.add( - :type => 'Assigned to you', - :object => 'Ticket', - :o_id => ticket.id, - :seen => 1, - :created_by_id => 1, - :user_id => 2, + OnlineNotification.seen( + :id => 2, + :user => UserObject, #optional, if passed all + #notfications for the given user are marked as seen ) =end def self.seen(data) - notification = OnlineNotification.find(data[:id]) - notification.seen = true - notification.save + notification = OnlineNotification.find(data[:id]) + notification.seen = true + notification.save end =begin @@ -86,7 +83,7 @@ remove whole online notifications of an object return all online notifications of an user - notifications = OnlineNotification.list( user ) + notifications = OnlineNotification.list( user, limit ) =end diff --git a/config/routes/online_notification.rb b/config/routes/online_notification.rb index 5ecfe3303..66ec56527 100644 --- a/config/routes/online_notification.rb +++ b/config/routes/online_notification.rb @@ -2,7 +2,8 @@ Zammad::Application.routes.draw do api_path = Rails.configuration.api_path # groups - match api_path + '/online_notifications', :to => 'online_notifications#index', :via => :get - match api_path + '/online_notifications/:id', :to => 'online_notifications#update', :via => :put + match api_path + '/online_notifications', :to => 'online_notifications#index', :via => :get + match api_path + '/online_notifications/:id', :to => 'online_notifications#update', :via => :put + match api_path + '/online_notifications/markAllAsSeen', :to => 'online_notifications#markAllAsSeen', :via => :post end \ No newline at end of file From 1fdc9858161cc9c4446afa6175e48eaf3c58a8ec Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 12 Jan 2015 23:15:39 +0100 Subject: [PATCH 09/75] Added signature support to new and zoom ticket. --- .../controllers/agent_ticket_create.js.coffee | 87 ++++++++++++------ .../app/controllers/ticket_zoom.js.coffee | 44 ++++++---- .../app/lib/app_post/utils.js.coffee | 24 +++++ app/controllers/tickets_controller.rb | 17 ---- public/assets/tests/html-utils.js | 88 +++++++++++++++++++ 5 files changed, 200 insertions(+), 60 deletions(-) diff --git a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee index 62262e123..03b5ff425 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee @@ -3,10 +3,10 @@ class App.TicketCreate extends App.Controller '.tabsSidebar' : 'sidebar' events: - 'click .type-tabs .tab': 'changeFormType' - 'submit form': 'submit' - 'click .submit': 'submit' - 'click .cancel': 'cancel' + 'click .type-tabs .tab': 'changeFormType' + 'submit form': 'submit' + 'click .submit': 'submit' + 'click .cancel': 'cancel' constructor: (params) -> super @@ -87,6 +87,9 @@ class App.TicketCreate extends App.Controller # update form @el.find('[name="formSenderType"]').val(type) + # force changing signature + @el.find('[name="group_id"]').trigger('change') + meta: => text = '' if @articleAttributes @@ -167,10 +170,10 @@ class App.TicketCreate extends App.Controller a = App.TicketArticle.find( params.article_id ) # reset owner - t.owner_id = 0 - t.customer_id_autocompletion = a.from - t.subject = a.subject || t.title - t.body = a.body + t.owner_id = 0 + t.customer_id_completion = a.from + t.subject = a.subject || t.title + t.body = a.body # render page @render( options: t ) @@ -191,10 +194,10 @@ class App.TicketCreate extends App.Controller @form_id = App.ControllerForm.formId() @html App.view('agent_ticket_create')( - head: 'New Ticket' - agent: @isRole('Agent') - admin: @isRole('Admin') - form_id: @form_id + head: 'New Ticket' + agent: @isRole('Agent') + admin: @isRole('Admin') + form_id: @form_id ) formChanges = (params, attribute, attributes, classname, form, ui) => @@ -220,6 +223,35 @@ class App.TicketCreate extends App.Controller # replace new option list form.find('[name="' + fieldNameToChange + '"]').closest('.form-group').replaceWith( newElement ) + signatureChanges = (params, attribute, attributes, classname, form, ui) => + if attribute && attribute.name is 'group_id' + signature = undefined + if params['group_id'] + group = App.Group.find( params['group_id'] ) + if group && group.signature_id + signature = App.Signature.find( group.signature_id ) + + # check if signature need to be added + type = @$('[name="formSenderType"]').val() + + if signature isnt undefined && signature.body && type is 'email-out' + signatureFinished = App.Utils.text2html( + App.Utils.replaceTags( signature.body, { user: App.Session.get() } ) + ) + + # get current body + body = @$('[data-name="body"]').html() || '' + if App.Utils.signatureCheck( body, signatureFinished ) + if !App.Utils.lastLineEmpty(body) + body = body + '
' + body = body + "
#{signatureFinished}
" + + @$('[data-name="body"]').html(body) + + # remove old signature + else + @$('[data-name="body"]').find("[data-signature=true]").remove() + new App.ControllerForm( el: @el.find('.ticket-form-top') form_id: @form_id @@ -228,7 +260,8 @@ class App.TicketCreate extends App.Controller events: 'change [name=customer_id]': @localUserInfo handlers: [ - formChanges + formChanges, + signatureChanges, ] filter: @form_meta.filter autofocus: true @@ -236,21 +269,22 @@ class App.TicketCreate extends App.Controller ) new App.ControllerForm( - el: @el.find('.article-form-top') - form_id: @form_id - model: App.TicketArticle - screen: 'create_top' - params: params + el: @el.find('.article-form-top') + form_id: @form_id + model: App.TicketArticle + screen: 'create_top' + params: params ) new App.ControllerForm( - el: @el.find('.ticket-form-middle') - form_id: @form_id - model: App.Ticket - screen: 'create_middle' + el: @el.find('.ticket-form-middle') + form_id: @form_id + model: App.Ticket + screen: 'create_middle' events: 'change [name=customer_id]': @localUserInfo handlers: [ - formChanges + formChanges, + signatureChanges, ] filter: @form_meta.filter params: params @@ -264,7 +298,8 @@ class App.TicketCreate extends App.Controller events: 'change [name=customer_id]': @localUserInfo handlers: [ - formChanges + formChanges, + signatureChanges, ] filter: @form_meta.filter params: params @@ -330,7 +365,7 @@ class App.TicketCreate extends App.Controller if sender.name is 'Customer' params['article'] = { to: (group && group.name) || '' - from: params.customer_id_autocompletion + from: params.customer_id_completion cc: params.cc subject: params.subject body: params.body @@ -342,7 +377,7 @@ class App.TicketCreate extends App.Controller else params['article'] = { from: (group && group.name) || '' - to: params.customer_id_autocompletion + to: params.customer_id_completion cc: params.cc subject: params.subject body: params.body diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee index 85f897f11..8fd4bb0f4 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee @@ -18,10 +18,9 @@ class App.TicketZoom extends App.Controller @navupdate '#' - @form_meta = undefined - @ticket_id = params.ticket_id - @article_id = params.article_id - @signature = undefined + @form_meta = undefined + @ticket_id = params.ticket_id + @article_id = params.article_id @key = 'ticket::' + @ticket_id cache = App.Store.get( @key ) @@ -137,9 +136,6 @@ class App.TicketZoom extends App.Controller # get edit form attributes @form_meta = data.form_meta - # get signature - @signature = data.signature - # load assets App.Collection.loadAssets( data.assets ) @@ -860,14 +856,15 @@ class Edit extends App.Controller if data.ticket.id is @ticket.id #@setArticleType(data.type.name) - # preselect article type - @setArticleType( 'email' ) @open_textarea(null, true) for key, value of data.article if key is 'body' @$('[data-name="' + key + '"]').html(value) else @$('[name="' + key + '"]').val(value) + + # preselect article type + @setArticleType( 'email' ) ) isIE10: -> @@ -905,7 +902,7 @@ class Edit extends App.Controller @$('[data-name="body"]').ce({ mode: 'richtext' multiline: true - maxlength: 2500 + maxlength: 5000 }) html5Upload.initialize( @@ -1075,10 +1072,29 @@ class Edit extends App.Controller # show/hide attributes for articleType in @articleTypes if articleType.name is type - @$(".form-group").addClass('hide') + @$('.form-group').addClass('hide') for name in articleType.attributes @$("[name=#{name}]").closest('.form-group').removeClass('hide') + # check if signature need to be added + body = @$('[data-name="body"]').html() || '' + signature = undefined + if @ticket.group.signature_id + signature = App.Signature.find( @ticket.group.signature_id ) + if signature && signature.body && @type is 'email' + signatureFinished = App.Utils.text2html( + App.Utils.replaceTags( signature.body, { user: App.Session.get(), ticket: @ticket } ) + ) + if App.Utils.signatureCheck( body, signatureFinished ) + if !App.Utils.lastLineEmpty(body) + body = body + '
' + body = body + "
#{signatureFinished}
" + @$('[data-name="body"]').html(body) + + # remove old signature + else + @$('[data-name="body"]').find("[data-signature=true]").remove() + detect_empty_textarea: => if !@textarea.text().trim() @add_textarea_catcher() @@ -1488,12 +1504,6 @@ class ArticleView extends App.Controller # get current body body = @ui.el.find('[data-name="body"]').html() || '' - # check if signature need to be added - if @ui.signature && @ui.signature.body && type.name is 'email' - signature = App.Utils.text2html( @ui.signature.body ) - if App.Utils.signatureCheck( body, signature ) - body = body + signature - # check if quote need to be added selectedText = App.ClipBoard.getSelected() if selectedText diff --git a/app/assets/javascripts/app/lib/app_post/utils.js.coffee b/app/assets/javascripts/app/lib/app_post/utils.js.coffee index 5f576a74f..6690bf4e7 100644 --- a/app/assets/javascripts/app/lib/app_post/utils.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/utils.js.coffee @@ -166,3 +166,27 @@ class App.Utils else true + # textReplaced = App.Utils.replaceTags( template, { user: { firstname: 'Bob', lastname: 'Smith' } } ) + @replaceTags: (template, objects) -> + template = template.replace( /#\{\s{0,2}(.+?)\s{0,2}\}/g, ( index, key ) -> + levels = key.split(/\./) + dataRef = objects + for level in levels + if dataRef[level] + dataRef = dataRef[level] + if typeof dataRef is 'function' + value = dataRef() + else if typeof dataRef is 'string' + value = dataRef + else + value = '' + #console.log( "tag replacement #{key}, #{value} env: ", objects) + value + ) + + # true|false = App.Utils.lastLineEmpty( message ) + @lastLineEmpty: (message) -> + messageCleanup = message.replace(/>\s+<').replace(/(\n|\r|\t)/g, '').trim() + return true if messageCleanup.match(/<(br|\s+?|\/)>$/im) + return true if messageCleanup.match(/<\/div>$/im) + false diff --git a/app/controllers/tickets_controller.rb b/app/controllers/tickets_controller.rb index 696181dbd..b8fc5b27b 100644 --- a/app/controllers/tickets_controller.rb +++ b/app/controllers/tickets_controller.rb @@ -228,22 +228,6 @@ class TicketsController < ApplicationController ticket = Ticket.find( params[:id] ) return if !ticket_permission( ticket ) - # get signature - signature = {} - if ticket.group.signature - signature = ticket.group.signature.attributes - - # replace tags - signature['body'] = NotificationFactory.build( - :locale => current_user.preferences[:locale], - :string => signature['body'], - :objects => { - :ticket => ticket, - :user => current_user, - } - ) - end - # get attributes to update attributes_to_change = Ticket::ScreenOptions.attributes_to_change( :user => current_user, :ticket => ticket ) @@ -292,7 +276,6 @@ class TicketsController < ApplicationController render :json => { :ticket_id => ticket.id, :ticket_article_ids => article_ids, - :signature => signature, :assets => assets, :links => link_list, :tags => tags, diff --git a/public/assets/tests/html-utils.js b/public/assets/tests/html-utils.js index 392e7febb..fff291fe2 100644 --- a/public/assets/tests/html-utils.js +++ b/public/assets/tests/html-utils.js @@ -439,4 +439,92 @@ test( "check signature", function() { }); +// replace tags +test( "check replace tags", function() { + + var message = "
#{user.firstname} #{user.lastname}
" + var result = '
Bob Smith
' + var data = { + user: { + firstname: 'Bob', + lastname: 'Smith', + }, + } + var verify = App.Utils.replaceTags( message, data ) + equal( verify, result ) + + message = "
#{user.firstname} #{user.lastname}
" + result = '
Bob Smith
' + data = { + user: { + firstname: function() { return 'Bob' }, + lastname: function() { return 'Smith' }, + }, + } + verify = App.Utils.replaceTags( message, data ) + equal( verify, result ) + + message = "
#{user.firstname} #{user.lastname}
" + result = '
Bob
' + data = { + user: { + firstname: 'Bob', + }, + } + verify = App.Utils.replaceTags( message, data ) + equal( verify, result ) + +}); + +// check if last line is a empty line +test( "check if last line is a empty line", function() { + + var message = "123" + var result = false + var verify = App.Utils.lastLineEmpty( message ) + equal( verify, result, message ) + + message = "
123
" + result = false + verify = App.Utils.lastLineEmpty( message ) + equal( verify, result, message ) + + message = "

123

" + result = false + verify = App.Utils.lastLineEmpty( message ) + equal( verify, result, message ) + + message = "
" + result = true + verify = App.Utils.lastLineEmpty( message ) + equal( verify, result, message ) + + message = "
" + result = true + verify = App.Utils.lastLineEmpty( message ) + equal( verify, result, message ) + + message = "
" + result = true + verify = App.Utils.lastLineEmpty( message ) + equal( verify, result, message ) + + message = "
\n \n\t" + result = true + verify = App.Utils.lastLineEmpty( message ) + equal( verify, result, message ) + + message = "
\n \n\t" + result = true + verify = App.Utils.lastLineEmpty( message ) + equal( verify, result, message ) + + message = "
\n
\n \n\t" + result = true + verify = App.Utils.lastLineEmpty( message ) + equal( verify, result, message ) + + +}); + } \ No newline at end of file From 83b4360c368d71f3ead08fdffe8c8422f34dfc28 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Tue, 13 Jan 2015 02:19:45 +0100 Subject: [PATCH 10/75] add a delay to article meta toggle to allow double click select its 150ms - maybe we need more. plz test. but the fewer delay we need the better cause it'll feel snappier. --- .../app/controllers/ticket_zoom.js.coffee | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee index 8fd4bb0f4..c4e523d1c 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee @@ -1262,7 +1262,7 @@ class ArticleView extends App.Controller 'click .show_toogle': 'show_toogle' 'click [data-type=reply]': 'reply' 'click [data-type=replyAll]': 'replyAll' - 'click .text-bubble': 'toggle_meta' + 'click .text-bubble': 'toggle_meta_with_delay' 'click .text-bubble a': 'stopPropagation' constructor: -> @@ -1327,7 +1327,17 @@ class ArticleView extends App.Controller stopPropagation: (e) -> e.stopPropagation() - toggle_meta: (e) -> + toggle_meta_with_delay: (e) => + # allow double click select + # by adding a delay to the toggle + + if @lastClick and +new Date - @lastClick < 150 + clearTimeout(@toggleMetaTimeout) + else + @toggleMetaTimeout = setTimeout(@toggle_meta, 150, e) + @lastClick = +new Date + + toggle_meta: (e) => e.preventDefault() animSpeed = 300 From 8237c57effa1b008970796c0b91c7eb4b8168c2b Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Tue, 13 Jan 2015 02:20:46 +0100 Subject: [PATCH 11/75] round big smiley icon edges --- public/assets/images/sprite.svg | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/assets/images/sprite.svg b/public/assets/images/sprite.svg index 992dec70f..654d819c3 100644 --- a/public/assets/images/sprite.svg +++ b/public/assets/images/sprite.svg @@ -48,11 +48,11 @@ - - - - - + + + + + From 4a9a2d8d1038addfa6a508df67b63689a1716d38 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 13 Jan 2015 08:26:45 +0100 Subject: [PATCH 12/75] Improved replacing signature. --- .../app/controllers/agent_ticket_create.js.coffee | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee index 03b5ff425..5347ddd79 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee @@ -242,6 +242,15 @@ class App.TicketCreate extends App.Controller # get current body body = @$('[data-name="body"]').html() || '' if App.Utils.signatureCheck( body, signatureFinished ) + + # if signature has changed, replace it + signature_id = @$('[data-signature=true]').data('signature-id') + if signature_id && signature_id.toString() isnt signature.id.toString() + + # remove old signature + @$('[data-signature="true"]').remove() + body = @$('[data-name="body"]').html() || '' + if !App.Utils.lastLineEmpty(body) body = body + '
' body = body + "
#{signatureFinished}
" @@ -250,7 +259,7 @@ class App.TicketCreate extends App.Controller # remove old signature else - @$('[data-name="body"]').find("[data-signature=true]").remove() + @$('[data-name="body"]').find('[data-signature=true]').remove() new App.ControllerForm( el: @el.find('.ticket-form-top') From 71d8af7a5260c9b062c348a7aed7ebce173502a8 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 13 Jan 2015 15:53:15 +0100 Subject: [PATCH 13/75] Moved from Marshal to JSON session files. --- app/controllers/long_polling_controller.rb | 2 +- lib/sessions.rb | 27 ++++++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/app/controllers/long_polling_controller.rb b/app/controllers/long_polling_controller.rb index 5512175e8..fa5a99b6b 100644 --- a/app/controllers/long_polling_controller.rb +++ b/app/controllers/long_polling_controller.rb @@ -59,7 +59,7 @@ class LongPollingController < ApplicationController user_id = session[:user_id] user = {} if user_id - user = User.find( user_id ) + user = User.find( user_id ).attributes end log 'notice', "send auth login (user_id #{user_id})", client_id Sessions.create( client_id, user, { :type => 'ajax' } ) diff --git a/lib/sessions.rb b/lib/sessions.rb index 7d299ee7e..0962312d9 100644 --- a/lib/sessions.rb +++ b/lib/sessions.rb @@ -37,7 +37,7 @@ returns :user => session, :meta => meta, } - file.write Marshal.dump(data) + file.write data.to_json } # send update to browser @@ -195,7 +195,7 @@ returns path = @path + '/' + client_id.to_s data[:meta][:last_ping] = Time.new.to_i.to_s File.open( path + '/session', 'wb' ) { |file| - file.write Marshal.dump(data) + file.write data.to_json } true end @@ -234,7 +234,11 @@ returns file.flock( File::LOCK_EX ) all = file.read file.flock( File::LOCK_UN ) - data = Marshal.load( all ) + dataJSON = JSON.parse( all ) + if dataJSON + data = self.symbolize_keys(dataJSON) + data[:user] = dataJSON['user'] # for compat. reasons + end } rescue Exception => e puts e.inspect @@ -567,4 +571,19 @@ returns puts "/LOOP #{client_id} - #{try_count}" end -end + def self.symbolize_keys(hash) + hash.inject({}){|result, (key, value)| + new_key = case key + when String then key.to_sym + else key + end + new_value = case value + when Hash then symbolize_keys(value) + else value + end + result[new_key] = new_value + result + } + end + +end \ No newline at end of file From f38149e82338a55a3127556f231d0e40034e7b9d Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 13 Jan 2015 17:03:58 +0100 Subject: [PATCH 14/75] Improved comments. --- script/websocket-server.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script/websocket-server.rb b/script/websocket-server.rb index 7d784c31d..749261950 100755 --- a/script/websocket-server.rb +++ b/script/websocket-server.rb @@ -295,7 +295,7 @@ EventMachine.run { idle_time_in_min = 4 - # web sockets + # close unused web socket sessions @clients.each { |client_id, client| if ( client[:last_ping] + ( 60 * idle_time_in_min ) ) < Time.now log 'notice', "closing idle websocket connection", client_id @@ -312,10 +312,10 @@ EventMachine.run { end } - # close unused sessions + # close unused ajax long polling sessions clients = Sessions.destory_idle_sessions(idle_time_in_min) clients.each { |client_id| - log 'notice', "closing idle connection", client_id + log 'notice', "closing idle long polling connection", client_id } end @@ -327,4 +327,4 @@ EventMachine.run { # puts "#{Time.now}:#{ level }:client(#{ client_id }) #{ data }" end -} +} \ No newline at end of file From c5622e54323a2fa89bfe03579c32a335852e41f5 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 13 Jan 2015 17:04:54 +0100 Subject: [PATCH 15/75] Removed not needed rule. --- app/assets/stylesheets/zammad.css.scss | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/assets/stylesheets/zammad.css.scss b/app/assets/stylesheets/zammad.css.scss index ccb71dbb5..992376e41 100644 --- a/app/assets/stylesheets/zammad.css.scss +++ b/app/assets/stylesheets/zammad.css.scss @@ -2041,10 +2041,6 @@ footer { text-decoration: none; } - .task .modified.priority.icon { - margin-right: 8px; - } - .task.active { background: #389ed9; } @@ -2106,7 +2102,7 @@ footer { .level-3 .modified.priority.icon:after { background-color: #faab00; border-color: #faab00; - } + } .task .closeTask { position: absolute; From a06faaebfbb8100c51f64af7ad8e661ac9e927cf Mon Sep 17 00:00:00 2001 From: Johannes Nickel Date: Tue, 13 Jan 2015 22:10:57 +0100 Subject: [PATCH 16/75] updated json response --- app/controllers/online_notifications_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/online_notifications_controller.rb b/app/controllers/online_notifications_controller.rb index 4ee59f38c..bb8ffac35 100644 --- a/app/controllers/online_notifications_controller.rb +++ b/app/controllers/online_notifications_controller.rb @@ -93,7 +93,7 @@ curl http://localhost/api/v1/online_notifications -v -u #{login}:#{password} -H notifications.each do |notification| OnlineNotification.seen({:id => notification['id']}) end - render :json => {data:'all cool'} + render :json => {data:'ok'} end end From 0e299ccf5b348b60a0fd7548ffd9b25ec5450d7c Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 13 Jan 2015 22:55:20 +0100 Subject: [PATCH 17/75] Improved error handling of 404 or 401 tickets. --- .../app/controllers/ticket_zoom.js.coffee | 34 +++++++++++++------ .../app/lib/app_post/ajax.js.coffee | 15 ++++---- 2 files changed, 31 insertions(+), 18 deletions(-) diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee index c4e523d1c..69b7c70cb 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee @@ -44,14 +44,15 @@ class App.TicketZoom extends App.Controller meta: => meta = - url: @url() - id: @ticket_id - iconClass: "priority" + url: @url() + id: @ticket_id + iconClass: 'priority' + head: @taskTitle if @ticket - @ticket = App.Ticket.fullLocal( @ticket.id ) + @ticket = App.Ticket.fullLocal( @ticket.id ) meta.head = @ticket.title meta.title = '#' + @ticket.number + ' - ' + @ticket.title - meta.class = "level-#{@ticket.level()}" + meta.class = "level-#{@ticket.level()}" meta url: => @@ -66,6 +67,7 @@ class App.TicketZoom extends App.Controller @positionPageHeaderStop() changed: => + return false if !@ticket formCurrent = @formParam( @el.find('.edit') ) ticket = App.Ticket.find(@ticket_id).attributes() modelDiff = @getDiff( ticket, formCurrent ) @@ -114,11 +116,23 @@ class App.TicketZoom extends App.Controller # do not close window if request is aborted return if status is 'abort' - # do not close window on network error but if object is not found - return if status is 'error' && error isnt 'Not Found' - - # remove task - App.TaskManager.remove( @task_key ) + # show error message + if xhr.status is 401 || error is 'Unauthorized' + @taskTitle = '» ' + App.i18n.translateInline('Unauthorized') + ' «' + @html App.view('generic/error/unauthorized')() + else if xhr.status is 404 || error is 'Not Found' + @taskTitle = '» ' + App.i18n.translateInline('Not Found') + ' «' + @html App.view('generic/error/not_found')() + else + @taskTitle = '» ' + App.i18n.translateInline('Error') + ' «' + status = xhr.status + detail = xhr.responseText + if !status && !detail + detail = 'General communication error, maybe internet is not available!' + @html App.view('generic/error/generic')( + status: status + detail: detail + ) ) diff --git a/app/assets/javascripts/app/lib/app_post/ajax.js.coffee b/app/assets/javascripts/app/lib/app_post/ajax.js.coffee index 337139af8..095bda739 100644 --- a/app/assets/javascripts/app/lib/app_post/ajax.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/ajax.js.coffee @@ -62,16 +62,15 @@ class _ajaxSingleton # do not show aborded requests return if status is 0 - # do not show any error message on wrong login - return if status is 401 && !settings.url.match('login') - - # do not show any error message with code 200 + # 200, all is fine return if status is 200 - # show human readable message - if status is 401 - status = 'Access denied.' - detail = '' + # do not show any error message with code 401/404 (handled by controllers) + return if status is 401 + return if status is 404 + + # do not show any error message with code 502 + return if status is 502 # show error message new App.ErrorModal( From 8a885f22abe5f01cdf9431e14a6a344c7e474279 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 13 Jan 2015 23:06:13 +0100 Subject: [PATCH 18/75] Improved error handling of 404 or 401 tickets. --- .../javascripts/app/views/generic/error/generic.jst.eco | 5 +++++ .../javascripts/app/views/generic/error/not_found.jst.eco | 4 ++++ .../javascripts/app/views/generic/error/unauthorized.jst.eco | 4 ++++ 3 files changed, 13 insertions(+) create mode 100644 app/assets/javascripts/app/views/generic/error/generic.jst.eco create mode 100644 app/assets/javascripts/app/views/generic/error/not_found.jst.eco create mode 100644 app/assets/javascripts/app/views/generic/error/unauthorized.jst.eco diff --git a/app/assets/javascripts/app/views/generic/error/generic.jst.eco b/app/assets/javascripts/app/views/generic/error/generic.jst.eco new file mode 100644 index 000000000..2726085f4 --- /dev/null +++ b/app/assets/javascripts/app/views/generic/error/generic.jst.eco @@ -0,0 +1,5 @@ +
+

<%- @T('Error') %>

+

<%- @T('Status Code') %>: <%= @status %>

+

<%= @detail %>

+
\ No newline at end of file diff --git a/app/assets/javascripts/app/views/generic/error/not_found.jst.eco b/app/assets/javascripts/app/views/generic/error/not_found.jst.eco new file mode 100644 index 000000000..8c2fb0c44 --- /dev/null +++ b/app/assets/javascripts/app/views/generic/error/not_found.jst.eco @@ -0,0 +1,4 @@ +
+

<%- @T('Not Found') %>

+

<%- @T('Sorry, unable to find this ressource.') %>

+
\ No newline at end of file diff --git a/app/assets/javascripts/app/views/generic/error/unauthorized.jst.eco b/app/assets/javascripts/app/views/generic/error/unauthorized.jst.eco new file mode 100644 index 000000000..d24fcb524 --- /dev/null +++ b/app/assets/javascripts/app/views/generic/error/unauthorized.jst.eco @@ -0,0 +1,4 @@ +
+

<%- @T('Unauthorized') %>

+

<%- @T('Sorry, you are not allowed to access this ressource.') %>

+
\ No newline at end of file From 884616088bb8a983eda29d822a9efd2157fdcaac Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 14 Jan 2015 08:49:47 +0100 Subject: [PATCH 19/75] Update current task title after ticket loading failed. --- app/assets/javascripts/app/controllers/ticket_zoom.js.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee index 69b7c70cb..e2c3ebe82 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee @@ -133,6 +133,9 @@ class App.TicketZoom extends App.Controller status: status detail: detail ) + + # update current task title + App.Event.trigger 'task:render' ) From dd048bc02efbeb36779e19b7a0530f90c8ed5368 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Wed, 14 Jan 2015 22:00:37 +0100 Subject: [PATCH 20/75] add button type btn--action --- app/assets/stylesheets/zammad.css.scss | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/zammad.css.scss b/app/assets/stylesheets/zammad.css.scss index 992376e41..e3df67ffc 100644 --- a/app/assets/stylesheets/zammad.css.scss +++ b/app/assets/stylesheets/zammad.css.scss @@ -277,6 +277,11 @@ span[data-tooltip]:hover:before { box-shadow: none; } + &.btn--action { + padding: 7px 11px 5px; + @extend label; + } + &.btn--primary { color: white; background: #419ed7; @@ -781,7 +786,7 @@ textarea, } .page-header-title h1 { - margin-top: 13px; + margin-top: 9px; } .page-header-meta { From 2f58fa9b7f27dddaa81ae0be8c367d8dd9d3de91 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Wed, 14 Jan 2015 22:15:50 +0100 Subject: [PATCH 21/75] make popover titles h3 --- app/assets/javascripts/app/lib/bootstrap/popover.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/lib/bootstrap/popover.js b/app/assets/javascripts/app/lib/bootstrap/popover.js index db272bdee..a498e2fee 100644 --- a/app/assets/javascripts/app/lib/bootstrap/popover.js +++ b/app/assets/javascripts/app/lib/bootstrap/popover.js @@ -25,7 +25,7 @@ placement: 'right', trigger: 'click', content: '', - template: '' + template: '' }) From 45d7d582217aa7c2628bc520914829834a5042e1 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Wed, 14 Jan 2015 22:20:40 +0100 Subject: [PATCH 22/75] rename popover company to organisation --- app/assets/stylesheets/zammad.css.scss | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/zammad.css.scss b/app/assets/stylesheets/zammad.css.scss index e3df67ffc..8d00cefc4 100644 --- a/app/assets/stylesheets/zammad.css.scss +++ b/app/assets/stylesheets/zammad.css.scss @@ -2614,7 +2614,11 @@ footer { background: white; } - .popover .person .company { + .popover .priority.icon { + margin-right: 8px; + } + + .popover .person .organisation { color: #a1a4a7; } @@ -2622,8 +2626,8 @@ footer { margin: 8px 0; } - .popover .person .company:before { content: '('; } - .popover .person .company:after { content: ')'; } + .popover .person .organisation:before { content: '('; } + .popover .person .organisation:after { content: ')'; } .popover .column h3 { margin: 8px 0 1px; From a3d2f3a7686b6af660b460ddf5f6bfa933187386 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Wed, 14 Jan 2015 22:23:30 +0100 Subject: [PATCH 23/75] remove popover priority spacing --- app/assets/stylesheets/zammad.css.scss | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/assets/stylesheets/zammad.css.scss b/app/assets/stylesheets/zammad.css.scss index 8d00cefc4..07261ab13 100644 --- a/app/assets/stylesheets/zammad.css.scss +++ b/app/assets/stylesheets/zammad.css.scss @@ -2614,10 +2614,6 @@ footer { background: white; } - .popover .priority.icon { - margin-right: 8px; - } - .popover .person .organisation { color: #a1a4a7; } From 1a67de73cfc7a11eaef9bb5ffabb2fc9cb5cc06f Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Wed, 14 Jan 2015 22:59:56 +0100 Subject: [PATCH 24/75] enhance popover behaviour faster show/hide, no hide when hovering over the popover --- .../_application_controller.js.coffee | 12 ++++++---- .../app/lib/bootstrap/popover-enhance.js | 23 +++++++++++++++++++ app/assets/javascripts/application.js | 1 + 3 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 app/assets/javascripts/app/lib/bootstrap/popover-enhance.js diff --git a/app/assets/javascripts/app/controllers/_application_controller.js.coffee b/app/assets/javascripts/app/controllers/_application_controller.js.coffee index e8599a747..245fb52ed 100644 --- a/app/assets/javascripts/app/controllers/_application_controller.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller.js.coffee @@ -233,7 +233,8 @@ class App.Controller extends Spine.Controller trigger: 'hover' container: 'body' html: true - delay: { show: 400, hide: 800 } + animation: false + delay: 100 placement: position title: -> ticket_id = $(@).data('id') @@ -270,7 +271,8 @@ class App.Controller extends Spine.Controller trigger: 'hover' container: 'body' html: true - delay: { show: 400, hide: 800 } + animation: false + delay: 100 placement: "auto #{position}" title: -> user_id = $(@).data('id') @@ -326,7 +328,8 @@ class App.Controller extends Spine.Controller trigger: 'hover' container: 'body' html: true - delay: { show: 400, hide: 800 } + animation: false + delay: 100 placement: "auto #{position}" title: -> organization_id = $(@).data('id') @@ -379,7 +382,8 @@ class App.Controller extends Spine.Controller trigger: 'hover' container: 'body' html: true - delay: { show: 500, hide: 5200 } + animation: false + delay: 100 placement: "auto #{data.position}" title: -> $(@).find('[title="*"]').val() diff --git a/app/assets/javascripts/app/lib/bootstrap/popover-enhance.js b/app/assets/javascripts/app/lib/bootstrap/popover-enhance.js new file mode 100644 index 000000000..aa751027c --- /dev/null +++ b/app/assets/javascripts/app/lib/bootstrap/popover-enhance.js @@ -0,0 +1,23 @@ +/* from here http://jsfiddle.net/WojtekKruszewski/Zf3m7/22/ */ + +var originalLeave = $.fn.popover.Constructor.prototype.leave; +$.fn.popover.Constructor.prototype.leave = function(obj){ + var self = obj instanceof this.constructor ? + obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) + var container, timeout; + + originalLeave.call(this, obj); + + if(obj.currentTarget) { + container = $('body .popover'); + timeout = self.timeout; + container.one('mouseenter', function(){ + //We entered the actual popover – call off the dogs + clearTimeout(timeout); + //Let's monitor popover content instead + container.one('mouseleave', function(){ + $.fn.popover.Constructor.prototype.leave.call(self, self); + }); + }) + } +}; \ No newline at end of file diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index d2ba680d8..a286bf89f 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -25,6 +25,7 @@ //= require ./app/lib/bootstrap/dropdown.js //= require ./app/lib/bootstrap/tooltip.js //= require ./app/lib/bootstrap/popover.js +//= require ./app/lib/bootstrap/popover-enhance.js //= require ./app/lib/bootstrap/modal.js //= require ./app/lib/bootstrap/tab.js //= require ./app/lib/bootstrap/transition.js From b4ccb3531d93ee23724014d316cdfb9cd13af7f8 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Wed, 14 Jan 2015 23:00:51 +0100 Subject: [PATCH 25/75] rename organisation -> organization because we settled on american english --- .../app/controllers/layout_ref.js.coffee | 32 +++++++-------- .../app/controllers/navigation.js.coffee | 4 +- .../app/controllers/ticket_customer.js.coffee | 2 +- .../app/controllers/ticket_zoom.js.coffee | 2 +- ...user_organization_autocompletion.js.coffee | 40 +++++++++---------- .../app/models/organization.js.coffee | 2 +- .../user_search/item_organization.jst.eco | 4 +- .../item_organization_members.jst.eco | 2 +- .../app/views/layout_ref/content.jst.eco | 26 ++++++------ .../layout_ref/organization_profile.jst.eco | 2 +- .../app/views/layout_ref/user_profile.jst.eco | 6 +-- .../app/views/organization_profile.jst.eco | 2 +- .../app/views/user_profile.jst.eco | 2 +- app/assets/stylesheets/zammad.css.scss | 18 ++++----- .../20140831000001_create_object_manager.rb | 2 +- 15 files changed, 73 insertions(+), 73 deletions(-) diff --git a/app/assets/javascripts/app/controllers/layout_ref.js.coffee b/app/assets/javascripts/app/controllers/layout_ref.js.coffee index acbd2d8f2..61aadbc29 100644 --- a/app/assets/javascripts/app/controllers/layout_ref.js.coffee +++ b/app/assets/javascripts/app/controllers/layout_ref.js.coffee @@ -11,9 +11,9 @@ App.Config.set( 'layout_ref', Index, 'Routes' ) class Content extends App.ControllerContent events: - 'hide.bs.dropdown .js-recipientDropdown': 'hideOrganisationMembers' - 'click .js-organisation': 'showOrganisationMembers' - 'click .js-back': 'hideOrganisationMembers' + 'hide.bs.dropdown .js-recipientDropdown': 'hideOrganizationMembers' + 'click .js-organization': 'showOrganizationMembers' + 'click .js-back': 'hideOrganizationMembers' constructor: -> super @@ -46,21 +46,21 @@ class Content extends App.ControllerContent render: -> @html App.view('layout_ref/content')() - showOrganisationMembers: (e) => + showOrganizationMembers: (e) => e.stopPropagation() listEntry = $(e.currentTarget) - organisationId = listEntry.data('organisation-id') + organizationId = listEntry.data('organization-id') @recipientList = @$('.recipientList') - @organisationList = @$("##{ organisationId }") + @organizationList = @$("##{ organizationId }") - # move organisation-list to the right and slide it in + # move organization-list to the right and slide it in - $.Velocity.hook(@organisationList, 'translateX', '100%') - @organisationList.removeClass('hide') + $.Velocity.hook(@organizationList, 'translateX', '100%') + @organizationList.removeClass('hide') - @organisationList.velocity + @organizationList.velocity properties: translateX: 0 options: @@ -73,12 +73,12 @@ class Content extends App.ControllerContent translateX: '-100%' options: speed: 300 - complete: => @recipientList.height(@organisationList.height()) + complete: => @recipientList.height(@organizationList.height()) - hideOrganisationMembers: (e) => + hideOrganizationMembers: (e) => e && e.stopPropagation() - return if !@organisationList + return if !@organizationList # fade list back in @@ -92,13 +92,13 @@ class Content extends App.ControllerContent @recipientList.height('') - # slide out organisation-list and hide it - @organisationList.velocity + # slide out organization-list and hide it + @organizationList.velocity properties: translateX: '100%' options: speed: 300 - complete: => @organisationList.addClass('hide') + complete: => @organizationList.addClass('hide') App.Config.set( 'layout_ref/content', Content, 'Routes' ) diff --git a/app/assets/javascripts/app/controllers/navigation.js.coffee b/app/assets/javascripts/app/controllers/navigation.js.coffee index f0af2b19c..0d888dce8 100644 --- a/app/assets/javascripts/app/controllers/navigation.js.coffee +++ b/app/assets/javascripts/app/controllers/navigation.js.coffee @@ -173,9 +173,9 @@ class App.Navigation extends App.Controller data = display: "#{organization.displayName()}" id: organization.id - class: "organisation organization-popover" + class: "organization organization-popover" url: organization.uiUrl() - iconClass: "organisation" + iconClass: "organization" area.result.push data @renderResult(result) diff --git a/app/assets/javascripts/app/controllers/ticket_customer.js.coffee b/app/assets/javascripts/app/controllers/ticket_customer.js.coffee index 45ae81ecb..1856adb2b 100644 --- a/app/assets/javascripts/app/controllers/ticket_customer.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_customer.js.coffee @@ -8,7 +8,7 @@ class App.TicketCustomer extends App.ControllerModal @button = true configure_attributes = [ - { name: 'customer_id', display: 'Customer', tag: 'user_autocompletion', null: false, placeholder: 'Enter Person or Organisation/Company', minLengt: 2, disableCreateUser: true }, + { name: 'customer_id', display: 'Customer', tag: 'user_autocompletion', null: false, placeholder: 'Enter Person or Organization/Company', minLengt: 2, disableCreateUser: true }, ] controller = new App.ControllerForm( diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee index e2c3ebe82..cf9d64a5b 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee @@ -907,7 +907,7 @@ class Edit extends App.Controller @setArticleType(@type) configure_attributes = [ - { name: 'customer_id', display: 'Recipients', tag: 'user_autocompletion', null: false, placeholder: 'Enter Person or Organisation/Company', minLengt: 2, disableCreateUser: false }, + { name: 'customer_id', display: 'Recipients', tag: 'user_autocompletion', null: false, placeholder: 'Enter Person or Organization/Company', minLengt: 2, disableCreateUser: false }, ] controller = new App.ControllerForm( diff --git a/app/assets/javascripts/app/lib/app_post/user_organization_autocompletion.js.coffee b/app/assets/javascripts/app/lib/app_post/user_organization_autocompletion.js.coffee index 2a2f0fcc5..a5c9a98b7 100644 --- a/app/assets/javascripts/app/lib/app_post/user_organization_autocompletion.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/user_organization_autocompletion.js.coffee @@ -1,9 +1,9 @@ class App.UserOrganizationAutocompletion extends App.Controller className: 'dropdown js-recipientDropdown zIndex-2' events: - 'hide.bs.dropdown .js-recipientDropdown': 'hideOrganisationMembers' - 'click .js-organisation': 'showOrganisationMembers' - 'click .js-back': 'hideOrganisationMembers' + 'hide.bs.dropdown .js-recipientDropdown': 'hideOrganizationMembers' + 'click .js-organization': 'showOrganizationMembers' + 'click .js-back': 'hideOrganizationMembers' 'click .js-user': 'selectUser' 'click .js-user-new': 'newUser' 'focus input': 'open' @@ -148,9 +148,9 @@ class App.UserOrganizationAutocompletion extends App.Controller e.preventDefault() userId = @$('.recipientList').find('li.is-active').data('user-id') if !userId - organisationId = @$('.recipientList').find('li.is-active').data('organisation-id') - if organisationId - @showOrganisationMembers(undefined, @$('.recipientList').find('li.is-active')) + organizationId = @$('.recipientList').find('li.is-active').data('organization-id') + if organizationId + @showOrganizationMembers(undefined, @$('.recipientList').find('li.is-active')) return if userId is 'new' @newUser() @@ -217,24 +217,24 @@ class App.UserOrganizationAutocompletion extends App.Controller emptyResultList: => @$('.recipientList').empty() - @$('.recipientList-organisationMembers').remove() + @$('.recipientList-organizationMembers').remove() - showOrganisationMembers: (e,listEntry) => + showOrganizationMembers: (e,listEntry) => if e e.stopPropagation() listEntry = $(e.currentTarget) - organisationId = listEntry.data('organisation-id') + organizationId = listEntry.data('organization-id') @recipientList = @$('.recipientList') - @organisationList = @$("##{ organisationId }") + @organizationList = @$("##{ organizationId }") - # move organisation-list to the right and slide it in + # move organization-list to the right and slide it in - $.Velocity.hook(@organisationList, 'translateX', '100%') - @organisationList.removeClass('hide') + $.Velocity.hook(@organizationList, 'translateX', '100%') + @organizationList.removeClass('hide') - @organisationList.velocity + @organizationList.velocity properties: translateX: 0 options: @@ -246,12 +246,12 @@ class App.UserOrganizationAutocompletion extends App.Controller translateX: '-100%' options: speed: 300 - complete: => @recipientList.height(@organisationList.height()) + complete: => @recipientList.height(@organizationList.height()) - hideOrganisationMembers: (e) => + hideOrganizationMembers: (e) => e && e.stopPropagation() - return if !@organisationList + return if !@organizationList # fade list back in @recipientList.velocity @@ -264,13 +264,13 @@ class App.UserOrganizationAutocompletion extends App.Controller @recipientList.height('') - # slide out organisation-list and hide it - @organisationList.velocity + # slide out organization-list and hide it + @organizationList.velocity properties: translateX: '100%' options: speed: 300 - complete: => @organisationList.addClass('hide') + complete: => @organizationList.addClass('hide') newUser: (e) => if e diff --git a/app/assets/javascripts/app/models/organization.js.coffee b/app/assets/javascripts/app/models/organization.js.coffee index 64316e141..9b6761673 100644 --- a/app/assets/javascripts/app/models/organization.js.coffee +++ b/app/assets/javascripts/app/models/organization.js.coffee @@ -18,7 +18,7 @@ class App.Organization extends App.Model '#organization/profile/' + @id icon: (user) -> - "organisation icon" + "organization icon" @_fillUp: (data) -> diff --git a/app/assets/javascripts/app/views/generic/user_search/item_organization.jst.eco b/app/assets/javascripts/app/views/generic/user_search/item_organization.jst.eco index be1c06804..ff30cedfd 100644 --- a/app/assets/javascripts/app/views/generic/user_search/item_organization.jst.eco +++ b/app/assets/javascripts/app/views/generic/user_search/item_organization.jst.eco @@ -1,6 +1,6 @@ -
  • +
  • -
    +
    <%= @organization.displayName() %> diff --git a/app/assets/javascripts/app/views/generic/user_search/item_organization_members.jst.eco b/app/assets/javascripts/app/views/generic/user_search/item_organization_members.jst.eco index c3bf75a00..baa55e3a7 100644 --- a/app/assets/javascripts/app/views/generic/user_search/item_organization_members.jst.eco +++ b/app/assets/javascripts/app/views/generic/user_search/item_organization_members.jst.eco @@ -1,4 +1,4 @@ -
      +
      • diff --git a/app/assets/javascripts/app/views/layout_ref/content.jst.eco b/app/assets/javascripts/app/views/layout_ref/content.jst.eco index b534259fd..321da5435 100644 --- a/app/assets/javascripts/app/views/layout_ref/content.jst.eco +++ b/app/assets/javascripts/app/views/layout_ref/content.jst.eco @@ -80,24 +80,24 @@
      • +
      • -
        +
        Bernecker + Rainer Industrie-Elektronik Ges.m.b.H. @@ -161,9 +161,9 @@
        -
      • +
      • -
        +
        Bertsch Ecopower GmbH @@ -178,7 +178,7 @@
        <%- @T('Create new Customer') %>
        -
        +
      • @@ -222,7 +222,7 @@ Katharina Nussman - Albrecht & Bertschler GmbG
        -
        +
      • diff --git a/app/assets/javascripts/app/views/layout_ref/organization_profile.jst.eco b/app/assets/javascripts/app/views/layout_ref/organization_profile.jst.eco index 8b0a8d1da..a621ad4f5 100644 --- a/app/assets/javascripts/app/views/layout_ref/organization_profile.jst.eco +++ b/app/assets/javascripts/app/views/layout_ref/organization_profile.jst.eco @@ -16,7 +16,7 @@
    -
    +

    Steuerbüro C. Kaik

  • diff --git a/app/assets/javascripts/app/views/layout_ref/user_profile.jst.eco b/app/assets/javascripts/app/views/layout_ref/user_profile.jst.eco index ac595cdc2..62d3f770d 100644 --- a/app/assets/javascripts/app/views/layout_ref/user_profile.jst.eco +++ b/app/assets/javascripts/app/views/layout_ref/user_profile.jst.eco @@ -26,7 +26,7 @@ doreen.kubiak@gmail.com
    - + Steuerbüro C. Kaik
    @@ -56,10 +56,10 @@
    - +
    Tickets von Doreen Kubiak
    -
    Tickets von Steuerbüro C. Kaik
    +
    Tickets von Steuerbüro C. Kaik
    diff --git a/app/assets/javascripts/app/views/organization_profile.jst.eco b/app/assets/javascripts/app/views/organization_profile.jst.eco index df887d366..730a6f911 100644 --- a/app/assets/javascripts/app/views/organization_profile.jst.eco +++ b/app/assets/javascripts/app/views/organization_profile.jst.eco @@ -4,7 +4,7 @@
    -
    +

    <%= @organization.displayName() %>

    diff --git a/app/assets/javascripts/app/views/user_profile.jst.eco b/app/assets/javascripts/app/views/user_profile.jst.eco index f2098d183..c4d2e08b3 100644 --- a/app/assets/javascripts/app/views/user_profile.jst.eco +++ b/app/assets/javascripts/app/views/user_profile.jst.eco @@ -6,7 +6,7 @@ <%- @user.avatar("80") %>

    <%= @user.displayName() %>

    <% if @user.organization: %> - + <% end %>
    diff --git a/app/assets/stylesheets/zammad.css.scss b/app/assets/stylesheets/zammad.css.scss index 07261ab13..0155d6c3d 100644 --- a/app/assets/stylesheets/zammad.css.scss +++ b/app/assets/stylesheets/zammad.css.scss @@ -1294,15 +1294,15 @@ ol.tabs li { @-moz-keyframes fade { from { opacity: 0 } to { opacity: 1 } } @keyframes fade { from { opacity: 0 } to { opacity: 1 } } - .organisation.icon { + .organization.icon { height: 13px; width: 14px; background-position: 0 -118px; } - .icon-switch:hover .organisation.icon, - .task.active .organisation.icon, - .white.organisation.icon { + .icon-switch:hover .organization.icon, + .task.active .organization.icon, + .white.organization.icon { background-position: 0 -132px; } @@ -2614,7 +2614,7 @@ footer { background: white; } - .popover .person .organisation { + .popover .person .organization { color: #a1a4a7; } @@ -2622,8 +2622,8 @@ footer { margin: 8px 0; } - .popover .person .organisation:before { content: '('; } - .popover .person .organisation:after { content: ')'; } + .popover .person .organization:before { content: '('; } + .popover .person .organization:after { content: ')'; } .popover .column h3 { margin: 8px 0 1px; @@ -4073,7 +4073,7 @@ footer { } .recipientList, -.recipientList-organisationMembers { +.recipientList-organizationMembers { list-style: none; padding: 0; } @@ -4143,7 +4143,7 @@ footer { margin-bottom: -2px; } - .recipientList-organisationMembers { + .recipientList-organizationMembers { position: absolute; top: 0; left: 0; diff --git a/db/migrate/20140831000001_create_object_manager.rb b/db/migrate/20140831000001_create_object_manager.rb index 33b26d5b5..fe911334a 100644 --- a/db/migrate/20140831000001_create_object_manager.rb +++ b/db/migrate/20140831000001_create_object_manager.rb @@ -34,7 +34,7 @@ class CreateObjectManager < ActiveRecord::Migration :multiple => false, :null => false, :limit => 200, - :placeholder => 'Enter Person or Organisation/Company', + :placeholder => 'Enter Person or Organization/Company', :minLengt => 2, :translate => false, }, From 4f31a9a120bac8766c2c3d4738098db2bd3a88c3 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 14 Jan 2015 23:07:29 +0100 Subject: [PATCH 26/75] Added new ticket state where pending time need to be shown. --- db/migrate/20140831000001_create_object_manager.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/db/migrate/20140831000001_create_object_manager.rb b/db/migrate/20140831000001_create_object_manager.rb index 33b26d5b5..818924872 100644 --- a/db/migrate/20140831000001_create_object_manager.rb +++ b/db/migrate/20140831000001_create_object_manager.rb @@ -168,7 +168,7 @@ class CreateObjectManager < ActiveRecord::Migration :null => false, :default => 2, :translate => true, - :filter => [1,2,3,4], + :filter => [1,2,3,4,7], }, :editable => false, :active => true, @@ -190,7 +190,7 @@ class CreateObjectManager < ActiveRecord::Migration :Agent => { :nulloption => false, :null => false, - :filter => [2,3,4], + :filter => [2,3,4,7], }, :Customer => { :nulloption => false, @@ -217,10 +217,10 @@ class CreateObjectManager < ActiveRecord::Migration :null => true, :translate => true, :required_if => { - :state_id => [3] + :state_id => [3,7] }, :shown_if => { - :state_id => [3] + :state_id => [3,7] }, }, :editable => false, From 3247fc32c5536edfe2de2b40b2fb8292a2d0d2fb Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 14 Jan 2015 23:12:05 +0100 Subject: [PATCH 27/75] Small visibility improvements. --- .../app/views/popover/ticket.jst.eco | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/app/views/popover/ticket.jst.eco b/app/assets/javascripts/app/views/popover/ticket.jst.eco index b743b0f10..e7a5808b3 100644 --- a/app/assets/javascripts/app/views/popover/ticket.jst.eco +++ b/app/assets/javascripts/app/views/popover/ticket.jst.eco @@ -1,13 +1,20 @@
    -
    + <%- @ticket.iconTitle() %>

    -

    Personen

    +

    <%- @P('Agent') %>

    - <%- @P( @ticket.owner ) %> + <%= @ticket.owner.displayName() %> + <% if @ticket.owner.organization_id: %> + <%= @ticket.owner.organization.displayName() %> + <% end %>
    +

    <%- @P('Customer') %>

    - <%- @P( @ticket.customer ) %> + <%= @ticket.customer.displayName() %> + <% if @ticket.customer.organization_id: %> + <%= @ticket.customer.organization.displayName() %> + <% end %>

    @@ -15,10 +22,6 @@

    #

    <%- @P( @ticket.number ) %>
    -
    -

    <%- @T( 'State' ) %>

    -
    <%- @P( @ticket.state.name ) %>
    -

    <%- @T( 'Priority' ) %>

    <%- @T( @ticket.priority.name ) %>
    From f9f0da8c2789a4336abc759e4161a8e384e5e983 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Wed, 14 Jan 2015 23:39:56 +0100 Subject: [PATCH 28/75] fix helper-message height --- app/assets/stylesheets/zammad.css.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/assets/stylesheets/zammad.css.scss b/app/assets/stylesheets/zammad.css.scss index 0155d6c3d..4f4e66b7d 100644 --- a/app/assets/stylesheets/zammad.css.scss +++ b/app/assets/stylesheets/zammad.css.scss @@ -615,6 +615,12 @@ fieldset > *:not(.form-group) .form-control { .form-group .help-message { cursor: help; opacity: 0.2; + top: -2px; + position: relative; + + .icon { + display: block; + } } .form-group:not(.formGroup--halfSize) { From 62de61f508ae9ab77466a89e6db29b2bbfe77660 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Wed, 14 Jan 2015 23:45:08 +0100 Subject: [PATCH 29/75] add button active states --- app/assets/stylesheets/zammad.css.scss | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/zammad.css.scss b/app/assets/stylesheets/zammad.css.scss index 4f4e66b7d..0548f498c 100644 --- a/app/assets/stylesheets/zammad.css.scss +++ b/app/assets/stylesheets/zammad.css.scss @@ -265,7 +265,7 @@ span[data-tooltip]:hover:before { color: hsl(202,68%,54%); background: white; border-color: rgba(0,0,0,.1); - outline: none; + outline: none !important; &.is-disabled { pointer-events: none; @@ -275,6 +275,7 @@ span[data-tooltip]:hover:before { &:active { box-shadow: none; + background: hsl(0,0%,98%); } &.btn--action { @@ -284,18 +285,26 @@ span[data-tooltip]:hover:before { &.btn--primary { color: white; - background: #419ed7; - border-color: #419ed7; + background: hsl(203,65%,55%); + &:active { + background: hsl(203,65%,45%); + } } &.btn--success { color: white; background: hsl(145,51%,45%); + &:active { + background: hsl(145,51%,35%); + } } &.btn--danger { color: white; background: hsl(0,65%,55%); + &:active { + background: hsl(0,65%,45%); + } } &.btn--subtle { @@ -307,6 +316,10 @@ span[data-tooltip]:hover:before { background: none; @extend .u-clickable; + &:active { + color: rgba(0,0,0,.42); + } + &:hover { color: rgba(0,0,0,.5); } From 1b1771afd5dce5373b95a230b020810b371fd035 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Wed, 14 Jan 2015 23:45:18 +0100 Subject: [PATCH 30/75] format popovers --- .../app/views/popover/organization.jst.eco | 24 ++++++++++--------- .../app/views/popover/user.jst.eco | 15 ++++++------ app/assets/stylesheets/zammad.css.scss | 5 ++++ 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/app/assets/javascripts/app/views/popover/organization.jst.eco b/app/assets/javascripts/app/views/popover/organization.jst.eco index 98fc357ed..fcf74c795 100644 --- a/app/assets/javascripts/app/views/popover/organization.jst.eco +++ b/app/assets/javascripts/app/views/popover/organization.jst.eco @@ -1,18 +1,20 @@ +
    +
    <% for row in @organizationData: %> <% if @organization[row.name]: %> - <% if row.tag is 'richtext': %> -
    <%- @organization[row.name] %>
    - <% else: %> -
    <%- @L( @P( @organization[row.name] ) ) %>
    - <% end %> +
    +

    <%- @T( row.display ) %>

    +
    <%- @L( @P( @organization[row.name] ) ) %>
    +
    <% end %> <% end %> +
    <% if @organization.members: %>
    - <%- @T('Members') %> -
      - <% for user in @organization.members: %> -
    • <%= user.displayName() %>
    • - <% end %> -
    +

    <%- @T('Members') %>

    + <% for user in @organization.members: %> +
    + <%= user.displayName() %> +
    + <% end %> <% end %> \ No newline at end of file diff --git a/app/assets/javascripts/app/views/popover/user.jst.eco b/app/assets/javascripts/app/views/popover/user.jst.eco index 99e8336dd..8fc3f9294 100644 --- a/app/assets/javascripts/app/views/popover/user.jst.eco +++ b/app/assets/javascripts/app/views/popover/user.jst.eco @@ -1,15 +1,14 @@ <% if @user['organization']: %> -
    - <%- @P( @user['organization'] ) %> -
    +
    <% end %> +
    +
    <% for row in @userData: %> <% if @user[row.name]: %> - <% if row.tag is 'richtext': %> -
    <%- @user[row.name] %>
    - <% else: %> -
    <%- @L( @P( @user[row.name] ) ) %>
    - <% end %> +
    +

    <%- @T( row.display ) %>

    +
    <%- @L( @P( @user[row.name] ) ) %>
    +
    <% end %> <% end %> <% if !_.isEmpty(@user['accounts']): %> diff --git a/app/assets/stylesheets/zammad.css.scss b/app/assets/stylesheets/zammad.css.scss index 0548f498c..001a19583 100644 --- a/app/assets/stylesheets/zammad.css.scss +++ b/app/assets/stylesheets/zammad.css.scss @@ -2637,6 +2637,11 @@ footer { color: #a1a4a7; } + .popover .user-organization { + margin-bottom: 8px; + margin-top: -4px; + } + .popover hr { margin: 8px 0; } From 14a57f7a124274e03a54a3eb4f35e8a272f9894f Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 14 Jan 2015 23:52:23 +0100 Subject: [PATCH 31/75] Added iconTextClass to improve ticket popover. --- app/assets/javascripts/app/models/ticket.js.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/assets/javascripts/app/models/ticket.js.coffee b/app/assets/javascripts/app/models/ticket.js.coffee index 9ed81ad64..25fcc3f81 100644 --- a/app/assets/javascripts/app/models/ticket.js.coffee +++ b/app/assets/javascripts/app/models/ticket.js.coffee @@ -44,6 +44,9 @@ class App.Ticket extends App.Model iconTitle: (user) -> App.TicketState.find( @state_id ).displayName() + iconTextClass: (user) -> + "level-#{ @level() }" + iconActivity: (user) -> if @owner_id == user.id return 'important' From 7580bc98c2835c335298dc355080dc7f4d210126 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Thu, 15 Jan 2015 01:04:07 +0100 Subject: [PATCH 32/75] camelCased textBubble --- .../app/controllers/ticket_zoom.js.coffee | 6 +++--- .../views/layout_ref/communication_overview.jst.eco | 6 +++--- .../app/views/layout_ref/communication_reply.jst.eco | 4 ++-- .../app/views/layout_ref/richtext.jst.eco | 12 ++++++------ .../app/views/ticket_zoom/article_view.jst.eco | 2 +- .../javascripts/app/views/ticket_zoom/edit.jst.eco | 4 ++-- app/assets/stylesheets/zammad.css.scss | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee index cf9d64a5b..01bb6618b 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee @@ -788,7 +788,7 @@ class Edit extends App.Controller '.attachmentUpload-progressBar': 'progressBar' '.js-percentage': 'progressText' '.js-cancel': 'cancelContainer' - '.text-bubble': 'textBubble' + '.textBubble': 'textBubble' '.editControls-item': 'editControlItem' #'.editControls': 'editControls' #'.recipient-picker': 'recipientPicker' @@ -1279,8 +1279,8 @@ class ArticleView extends App.Controller 'click .show_toogle': 'show_toogle' 'click [data-type=reply]': 'reply' 'click [data-type=replyAll]': 'replyAll' - 'click .text-bubble': 'toggle_meta_with_delay' - 'click .text-bubble a': 'stopPropagation' + 'click .textBubble': 'toggle_meta_with_delay' + 'click .textBubble a': 'stopPropagation' constructor: -> super diff --git a/app/assets/javascripts/app/views/layout_ref/communication_overview.jst.eco b/app/assets/javascripts/app/views/layout_ref/communication_overview.jst.eco index dd73a13a9..b9a593f07 100644 --- a/app/assets/javascripts/app/views/layout_ref/communication_overview.jst.eco +++ b/app/assets/javascripts/app/views/layout_ref/communication_overview.jst.eco @@ -58,7 +58,7 @@
    NB
    -
    Welcome! +
    Welcome! Thank you for installing Zammad. @@ -112,7 +112,7 @@ The Zammad
    -
    Hallp HP, du kannst dich nur einmal einloggen. Was machst du genau?
    +
    Hallp HP, du kannst dich nur einmal einloggen. Was machst du genau?