From 18cd0a0c93ac8d20b83c3a16d390e78aa8347bf7 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Sun, 16 Nov 2014 22:01:55 +0100 Subject: [PATCH] add bookmark button filled: .filled.bookmark.icon empty: .bookmark.icon We need to store the bookmark settings per user. --- app/assets/images/sprite.svg | 2 +- .../_application_controller_form.js.coffee | 1 + .../app/controllers/ticket_zoom.js.coffee | 5 ++ .../app/views/generic/attribute.jst.eco | 14 ++++- app/assets/stylesheets/zammad.css.scss | 54 ++++++++++++++++--- 5 files changed, 66 insertions(+), 10 deletions(-) diff --git a/app/assets/images/sprite.svg b/app/assets/images/sprite.svg index 64892eabb..42f527c95 100644 --- a/app/assets/images/sprite.svg +++ b/app/assets/images/sprite.svg @@ -157,7 +157,7 @@ - + diff --git a/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee b/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee index bae1c51aa..3f178ab56 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee @@ -1430,6 +1430,7 @@ class App.ControllerForm extends App.Controller App.view('generic/attribute')( attribute: attribute, item: '', + bookmarkable: @bookmarkable ) ) fullItem.find('.controls').prepend( item ) diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee index 4b8a50d8d..b3eaef1cb 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee @@ -4,6 +4,7 @@ class App.TicketZoom extends App.Controller events: 'click .js-submit': 'submit' + 'click .js-bookmark': 'bookmark' constructor: (params) -> super @@ -241,6 +242,7 @@ class App.TicketZoom extends App.Controller ] filter: @form_meta.filter params: defaults + bookmarkable: true ) #console.log('Ichanges', modelDiff, task_state, ticket.attributes()) @markFormDiff( modelDiff ) @@ -617,6 +619,9 @@ class App.TicketZoom extends App.Controller @fetch( ticket.id, true ) ) + bookmark: (e) => + $(e.currentTarget).find('.bookmark.icon').toggleClass('filled') + taskGet: (area) => return {} if !App.TaskManager.get(@task_key) @localTaskData = App.TaskManager.get(@task_key).state || {} diff --git a/app/assets/javascripts/app/views/generic/attribute.jst.eco b/app/assets/javascripts/app/views/generic/attribute.jst.eco index ac9f228a1..984199e70 100644 --- a/app/assets/javascripts/app/views/generic/attribute.jst.eco +++ b/app/assets/javascripts/app/views/generic/attribute.jst.eco @@ -1,7 +1,17 @@
"> -
+
- <%- @item %><% if @attribute.note: %>
<% end %> + <%- @item %> + <% if @bookmarkable: %> +
+
+
+ <% end %> + <% if @attribute.note: %> +
+
+
+ <% end %>
<% if @attribute.remove: %><% end %> diff --git a/app/assets/stylesheets/zammad.css.scss b/app/assets/stylesheets/zammad.css.scss index 30adb6732..2c177426e 100644 --- a/app/assets/stylesheets/zammad.css.scss +++ b/app/assets/stylesheets/zammad.css.scss @@ -548,13 +548,40 @@ fieldset > *:not(.form-group) .form-control { margin-right: 4px; } +.form-group { + margin-bottom: 16px; +} + .form-group + .form-group { margin-top: 0; } -.form-group label { +.formGroup-label { padding: 0 2px; - margin-bottom: 6px; + margin-bottom: 3px; + position: relative; + @extend .horizontal; + @extend .center; + + label { + margin: 0; + } + + .bookmark.icon { + margin-bottom: -1px; + } +} + +.formGroup-bookmark { + @extend .u-clickable; + @extend .horizontal; + @extend .center; + @extend .reverse; + width: 30px; + height: 30px; + position: absolute; + right: 0; + top: -10px; } .form-group .controls .richtext { @@ -1486,6 +1513,16 @@ ol.tabs li { margin-top: -2px; } + .bookmark.icon { + width: 12px; + height: 12px; + background-position: -94px -307px; + } + + .filled.bookmark.icon { + background-position: -107px -307px; + } + .dark.group.icon { width: 23px; height: 24px; @@ -2692,17 +2729,20 @@ footer { .form-group.is-changed:before { content: ""; position: absolute; - top: 0; + top: 23px; left: -16px; - height: 100%; + bottom: 0; width: 3px; - background: repeating-linear-gradient(-45deg, hsl(193,18%,90%), hsl(193,18%,90%) 4px, transparent 4px, transparent 7px) repeat center; - background-size: 9px 9px; + background: repeating-linear-gradient(45deg, hsl(193,18%,90%), hsl(193,18%,90%) 5px, transparent 5px, transparent 9px) repeat center; + background-size: 11px 11px; } .form-inline .form-group.is-changed:before { width: 100%; height: 3px; + top: 0; + left: 0; + bottom: auto; } .form-group.is-changed label { @@ -2717,7 +2757,7 @@ footer { width: 5px; height: 5px; top: 50%; - margin-top: -4px; + margin-top: -3px; border-radius: 100%; background: hsl(198,19%,72%); }