From edcd7d925ec7b47d002631efe7341c06eeda48a8 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Tue, 29 Sep 2015 14:22:13 +0200 Subject: [PATCH] rename priority to task-state and add new colors --- .../app/controllers/ticket_overview.coffee | 2 +- .../app/controllers/ticket_zoom.coffee | 5 +-- .../app/models/organization.coffee | 2 +- .../javascripts/app/models/ticket.coffee | 26 ++++++++------- app/assets/javascripts/app/models/user.coffee | 2 +- .../app/views/generic/table.jst.eco | 2 +- .../app/views/layout_ref/local_modal.jst.eco | 16 +++++----- .../layout_ref/organization_profile.jst.eco | 12 +++---- .../views/layout_ref/scheduler_modal.jst.eco | 8 ++--- .../app/views/layout_ref/sla_modal.jst.eco | 20 +++--------- .../app/views/layout_ref/user_profile.jst.eco | 32 +++++++++---------- .../javascripts/app/views/link/info.jst.eco | 2 +- .../app/views/navigation/result.jst.eco | 2 +- .../app/views/popover/ticket.jst.eco | 2 +- .../app/views/task_widget_tasks.jst.eco | 14 +++++--- .../views/widget/ticket_stats_list.jst.eco | 2 +- 16 files changed, 72 insertions(+), 77 deletions(-) diff --git a/app/assets/javascripts/app/controllers/ticket_overview.coffee b/app/assets/javascripts/app/controllers/ticket_overview.coffee index 13d38b69d..8e3ddc051 100644 --- a/app/assets/javascripts/app/controllers/ticket_overview.coffee +++ b/app/assets/javascripts/app/controllers/ticket_overview.coffee @@ -275,7 +275,7 @@ class Table extends App.Controller header callbackIcon = (value, object, attribute, header, refObject) -> value = ' ' - attribute.class = object.icon() + attribute.class = object.iconClass() attribute.link = '' attribute.title = App.i18n.translateInline( object.iconTitle() ) value diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.coffee index 584f3a051..940e956dc 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.coffee @@ -80,8 +80,9 @@ class App.TicketZoom extends App.Controller @ticket = App.Ticket.fullLocal( @ticket.id ) meta.head = @ticket.title meta.title = '#' + @ticket.number + ' - ' + @ticket.title - meta.class = "level-#{@ticket.level()}" - meta.iconClass = 'priority' + meta.class = "task-state-#{ @ticket.getState() }" + meta.type = 'task' + meta.iconClass = @ticket.iconClass() meta url: => diff --git a/app/assets/javascripts/app/models/organization.coffee b/app/assets/javascripts/app/models/organization.coffee index b14c7ce35..129cd6160 100644 --- a/app/assets/javascripts/app/models/organization.coffee +++ b/app/assets/javascripts/app/models/organization.coffee @@ -44,4 +44,4 @@ Mit **Organisationen** können Sie Kunden **gruppieren**. Dies hat u. a. zwei be id: @id class: 'organization organization-popover' url: @uiUrl() - iconClass: 'organization' + icon: 'organization' diff --git a/app/assets/javascripts/app/models/ticket.coffee b/app/assets/javascripts/app/models/ticket.coffee index 985868aef..c6765c26f 100644 --- a/app/assets/javascripts/app/models/ticket.coffee +++ b/app/assets/javascripts/app/models/ticket.coffee @@ -28,24 +28,27 @@ class App.Ticket extends App.Model uiUrl: -> '#ticket/zoom/' + @id - level: -> - state = App.TicketState.find( @state_id ) - stateType = App.TicketStateType.find( state.state_type_id ) - level = 1 + getState: -> + type = App.TicketState.find( @state_id ) + stateType = App.TicketStateType.find( type.state_type_id ) + state = 'closed' if stateType.name is 'new' || stateType.name is 'open' - level = 2 + state = 'open' else if stateType.name is 'pending reminder' || stateType.name is 'pending action' - level = 3 - level + state = 'pending' + state icon: -> - "icon-priority level-#{ @level() }" + "task-state" + + iconClass: -> + @getState() iconTitle: -> App.TicketState.find( @state_id ).displayName() iconTextClass: -> - "level-#{ @level() }" + "task-state-#{ @getState() }-color" iconActivity: (user) -> if @owner_id == user.id @@ -54,6 +57,7 @@ class App.Ticket extends App.Model searchResultAttributes: -> display: "##{@number} - #{@title}" id: @id - class: "level-#{@level()} ticket-popover" + class: "task-state-#{ @getState() } ticket-popover" url: @uiUrl() - iconClass: 'priority' + icon: 'task-state' + iconClass: @getState() diff --git a/app/assets/javascripts/app/models/user.coffee b/app/assets/javascripts/app/models/user.coffee index 67bf21035..db84ee9ee 100644 --- a/app/assets/javascripts/app/models/user.coffee +++ b/app/assets/javascripts/app/models/user.coffee @@ -131,4 +131,4 @@ class App.User extends App.Model id: @id class: 'user user-popover' url: @uiUrl() - iconClass: 'user' + icon: 'user' diff --git a/app/assets/javascripts/app/views/generic/table.jst.eco b/app/assets/javascripts/app/views/generic/table.jst.eco index 503c5bae1..a42ecb081 100644 --- a/app/assets/javascripts/app/views/generic/table.jst.eco +++ b/app/assets/javascripts/app/views/generic/table.jst.eco @@ -73,7 +73,7 @@ class="<%= item.parentClass %>"<% end %> <% if item.title: %>title="<%= item.title %>"<% end %>> <% if item.name is 'icon': %> - <%- @Icon('priority', item.class) %> + <%- @Icon('task-state', item.class) %> <% else: %> <% if item.link: %> target="<%= item.target %>"<% end %>> diff --git a/app/assets/javascripts/app/views/layout_ref/local_modal.jst.eco b/app/assets/javascripts/app/views/layout_ref/local_modal.jst.eco index f46bc2614..2c2eb283a 100644 --- a/app/assets/javascripts/app/views/layout_ref/local_modal.jst.eco +++ b/app/assets/javascripts/app/views/layout_ref/local_modal.jst.eco @@ -372,33 +372,33 @@
    -
  1. +
  2. -
    + <%- @Icon('task-state', 'escalating') %>
    Micro-SIM doesn't work
    23 minutes ago
    -
  3. +
  4. -
    + <%- @Icon('task-state', 'open') %>
    Superb Service!
    43 minutes ago
    -
  5. +
  6. -
    + <%- @Icon('task-state', 'closed') %>
    Print sheets strip off
    1 hour ago
    -
  7. +
  8. -
    + <%- @Icon('task-state', 'closed') %>
    Block not properly wrought
    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 811d9f00d..64be90851 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 @@ -76,7 +76,7 @@
    1. - + <%- @Icon('task-state', 'open') %>
      Micro-SIM doesn't work
      @@ -84,7 +84,7 @@
    2. - + <%- @Icon('task-state', 'pending') %>
      Superb Service here_with_some_extrem_example_sting_witch_can_really_be!
      @@ -92,7 +92,7 @@
    3. - + <%- @Icon('task-state', 'closed') %>
      Print sheets strip off
      @@ -100,7 +100,7 @@
    4. - + <%- @Icon('task-state', 'closed') %>
      Block not properly wrought
      @@ -114,7 +114,7 @@
      1. - + <%- @Icon('task-state', 'pending') %>
        Micro-SIM doesn't work
        @@ -122,7 +122,7 @@
      2. - + <%- @Icon('task-state', 'closed') %>
        Superb Service!
        diff --git a/app/assets/javascripts/app/views/layout_ref/scheduler_modal.jst.eco b/app/assets/javascripts/app/views/layout_ref/scheduler_modal.jst.eco index 6e48092e8..4d2e2b098 100644 --- a/app/assets/javascripts/app/views/layout_ref/scheduler_modal.jst.eco +++ b/app/assets/javascripts/app/views/layout_ref/scheduler_modal.jst.eco @@ -326,9 +326,7 @@ - - - + <%- @Icon('task-state', 'closed') %> Nicole Braun (Zammad Foundation) @@ -347,9 +345,7 @@ - - - + <%- @Icon('task-state', 'closed') %> Nicole Braun (Zammad Foundation) diff --git a/app/assets/javascripts/app/views/layout_ref/sla_modal.jst.eco b/app/assets/javascripts/app/views/layout_ref/sla_modal.jst.eco index b12b1afe1..a55b2d385 100644 --- a/app/assets/javascripts/app/views/layout_ref/sla_modal.jst.eco +++ b/app/assets/javascripts/app/views/layout_ref/sla_modal.jst.eco @@ -72,9 +72,7 @@ - - - + <%- @Icon('task-state', 'closed') %> Nicole Braun (Zammad Foundation) @@ -93,9 +91,7 @@ - - - + <%- @Icon('task-state', 'closed') %> Hans Huber @@ -114,9 +110,7 @@ - - - + <%- @Icon('task-state', 'closed') %> Nicole Braun (Zammad Foundation) @@ -135,9 +129,7 @@ - - - + <%- @Icon('task-state', 'closed') %> Nicole Braun (Zammad Foundation) @@ -156,9 +148,7 @@ - - - + <%- @Icon('task-state', 'closed') %> Nicole Braun (Zammad Foundation) 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 2338e6fb9..367c14402 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 @@ -66,33 +66,33 @@
          -
        1. +
        2. - + <%- @Icon('task-state', 'closed') %>
          Micro-SIM doesn't work
          23 minutes ago
          -
        3. +
        4. - + <%- @Icon('task-state', 'closed') %>
          Superb Service!
          43 minutes ago
          -
        5. +
        6. - + <%- @Icon('task-state', 'closed') %>
          Print sheets strip_off_with_a_lot_of_text_in_the_headline
          1 hour ago
          -
        7. +
        8. - + <%- @Icon('task-state', 'closed') %>
          Block not properly wrought
          @@ -104,33 +104,33 @@
            -
          1. +
          2. - + <%- @Icon('task-state', 'closed') %>
            Micro-SIM doesn't work
            23 minutes ago
            -
          3. +
          4. - + <%- @Icon('task-state', 'closed') %>
            Superb Service!
            43 minutes ago
            -
          5. +
          6. - + <%- @Icon('task-state', 'closed') %>
            Print sheets strip off with a lot of text in the headline
            1 hour ago
            -
          7. +
          8. - + <%- @Icon('task-state', 'closed') %>
            Block not properly wrought
            diff --git a/app/assets/javascripts/app/views/link/info.jst.eco b/app/assets/javascripts/app/views/link/info.jst.eco index 7390174da..a8b0e212f 100644 --- a/app/assets/javascripts/app/views/link/info.jst.eco +++ b/app/assets/javascripts/app/views/link/info.jst.eco @@ -6,7 +6,7 @@ <% for item in @links[type]: %>
          9. - <%- @Icon('priority', item.icon()) %> + <%- @Icon('task-state', item.iconClass()) %>
            <%= item.title %> diff --git a/app/assets/javascripts/app/views/navigation/result.jst.eco b/app/assets/javascripts/app/views/navigation/result.jst.eco index 4d44f4335..af4749fc0 100644 --- a/app/assets/javascripts/app/views/navigation/result.jst.eco +++ b/app/assets/javascripts/app/views/navigation/result.jst.eco @@ -5,7 +5,7 @@
          10. <%= item.display %> diff --git a/app/assets/javascripts/app/views/popover/ticket.jst.eco b/app/assets/javascripts/app/views/popover/ticket.jst.eco index 0e5d3aea2..70bf11e75 100644 --- a/app/assets/javascripts/app/views/popover/ticket.jst.eco +++ b/app/assets/javascripts/app/views/popover/ticket.jst.eco @@ -1,5 +1,5 @@
            - <%- @ticket.iconTitle() %> + <%- @Icon(@ticket.icon, @ticket.iconClass) %> <%- @ticket.iconTitle() %>

            diff --git a/app/assets/javascripts/app/views/task_widget_tasks.jst.eco b/app/assets/javascripts/app/views/task_widget_tasks.jst.eco index 5a4461224..b3f081079 100644 --- a/app/assets/javascripts/app/views/task_widget_tasks.jst.eco +++ b/app/assets/javascripts/app/views/task_widget_tasks.jst.eco @@ -1,14 +1,18 @@ <% for item in @item_list: %>
          11. - <%- @Icon('priority', ticket.icon()) %> + <%- @Icon('task-state', ticket.iconClass()) %>