rename priority to task-state and add new colors

This commit is contained in:
Felix Niklas 2015-09-29 14:22:13 +02:00
parent e647c1eb94
commit edcd7d925e
16 changed files with 72 additions and 77 deletions

View file

@ -275,7 +275,7 @@ class Table extends App.Controller
header header
callbackIcon = (value, object, attribute, header, refObject) -> callbackIcon = (value, object, attribute, header, refObject) ->
value = ' ' value = ' '
attribute.class = object.icon() attribute.class = object.iconClass()
attribute.link = '' attribute.link = ''
attribute.title = App.i18n.translateInline( object.iconTitle() ) attribute.title = App.i18n.translateInline( object.iconTitle() )
value value

View file

@ -80,8 +80,9 @@ class App.TicketZoom extends App.Controller
@ticket = App.Ticket.fullLocal( @ticket.id ) @ticket = App.Ticket.fullLocal( @ticket.id )
meta.head = @ticket.title meta.head = @ticket.title
meta.title = '#' + @ticket.number + ' - ' + @ticket.title meta.title = '#' + @ticket.number + ' - ' + @ticket.title
meta.class = "level-#{@ticket.level()}" meta.class = "task-state-#{ @ticket.getState() }"
meta.iconClass = 'priority' meta.type = 'task'
meta.iconClass = @ticket.iconClass()
meta meta
url: => url: =>

View file

@ -44,4 +44,4 @@ Mit **Organisationen** können Sie Kunden **gruppieren**. Dies hat u. a. zwei be
id: @id id: @id
class: 'organization organization-popover' class: 'organization organization-popover'
url: @uiUrl() url: @uiUrl()
iconClass: 'organization' icon: 'organization'

View file

@ -28,24 +28,27 @@ class App.Ticket extends App.Model
uiUrl: -> uiUrl: ->
'#ticket/zoom/' + @id '#ticket/zoom/' + @id
level: -> getState: ->
state = App.TicketState.find( @state_id ) type = App.TicketState.find( @state_id )
stateType = App.TicketStateType.find( state.state_type_id ) stateType = App.TicketStateType.find( type.state_type_id )
level = 1 state = 'closed'
if stateType.name is 'new' || stateType.name is 'open' 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' else if stateType.name is 'pending reminder' || stateType.name is 'pending action'
level = 3 state = 'pending'
level state
icon: -> icon: ->
"icon-priority level-#{ @level() }" "task-state"
iconClass: ->
@getState()
iconTitle: -> iconTitle: ->
App.TicketState.find( @state_id ).displayName() App.TicketState.find( @state_id ).displayName()
iconTextClass: -> iconTextClass: ->
"level-#{ @level() }" "task-state-#{ @getState() }-color"
iconActivity: (user) -> iconActivity: (user) ->
if @owner_id == user.id if @owner_id == user.id
@ -54,6 +57,7 @@ class App.Ticket extends App.Model
searchResultAttributes: -> searchResultAttributes: ->
display: "##{@number} - #{@title}" display: "##{@number} - #{@title}"
id: @id id: @id
class: "level-#{@level()} ticket-popover" class: "task-state-#{ @getState() } ticket-popover"
url: @uiUrl() url: @uiUrl()
iconClass: 'priority' icon: 'task-state'
iconClass: @getState()

View file

@ -131,4 +131,4 @@ class App.User extends App.Model
id: @id id: @id
class: 'user user-popover' class: 'user user-popover'
url: @uiUrl() url: @uiUrl()
iconClass: 'user' icon: 'user'

View file

@ -73,7 +73,7 @@
<td <% if item.parentClass: %>class="<%= item.parentClass %>"<% end %> <% if item.title: %>title="<%= item.title %>"<% end %>> <td <% if item.parentClass: %>class="<%= item.parentClass %>"<% end %> <% if item.title: %>title="<%= item.title %>"<% end %>>
<% if item.name is 'icon': %> <% if item.name is 'icon': %>
<%- @Icon('priority', item.class) %> <%- @Icon('task-state', item.class) %>
<% else: %> <% else: %>
<% if item.link: %> <% if item.link: %>
<a href="<%- item.link %>" <% if item.target: %>target="<%= item.target %>"<% end %>> <a href="<%- item.link %>" <% if item.target: %>target="<%= item.target %>"<% end %>>

View file

@ -372,33 +372,33 @@
<div class="profile-ticketList"> <div class="profile-ticketList">
<label>Bearbeitete Tickets (12)</label> <label>Bearbeitete Tickets (12)</label>
<ol class="tasks tasks--standalone"> <ol class="tasks tasks--standalone">
<li class="task level-1"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<div class="priority icon"></div> <%- @Icon('task-state', 'escalating') %>
</div> </div>
<div class="task-text"> <div class="task-text">
<div class="name">Micro-SIM doesn't work</div> <div class="name">Micro-SIM doesn't work</div>
<div class="time">23 minutes ago</div> <div class="time">23 minutes ago</div>
</div> </div>
<li class="task level-1"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<div class="priority icon"></div> <%- @Icon('task-state', 'open') %>
</div> </div>
<div class="task-text"> <div class="task-text">
<div class="name">Superb Service!</div> <div class="name">Superb Service!</div>
<div class="time">43 minutes ago</div> <div class="time">43 minutes ago</div>
</div> </div>
<li class="task level-1"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<div class="priority icon"></div> <%- @Icon('task-state', 'closed') %>
</div> </div>
<div class="task-text"> <div class="task-text">
<div class="name">Print sheets strip off</div> <div class="name">Print sheets strip off</div>
<div class="time">1 hour ago</div> <div class="time">1 hour ago</div>
</div> </div>
<li class="task level-1"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<div class="priority icon"></div> <%- @Icon('task-state', 'closed') %>
</div> </div>
<div class="task-text"> <div class="task-text">
<div class="name">Block not properly wrought</div> <div class="name">Block not properly wrought</div>

View file

@ -76,7 +76,7 @@
<ol class="tasks tasks--standalone"> <ol class="tasks tasks--standalone">
<li class="task"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<svg class="icon-priority level-2"><use xlink:href="#icon-priority" /></svg> <%- @Icon('task-state', 'open') %>
</div> </div>
<div class="task-text"> <div class="task-text">
<div class="name">Micro-SIM doesn't work</div> <div class="name">Micro-SIM doesn't work</div>
@ -84,7 +84,7 @@
</div> </div>
<li class="task"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<svg class="icon-priority level-2"><use xlink:href="#icon-priority" /></svg> <%- @Icon('task-state', 'pending') %>
</div> </div>
<div class="task-text"> <div class="task-text">
<div class="name">Superb Service here_with_some_extrem_example_sting_witch_can_really_be!</div> <div class="name">Superb Service here_with_some_extrem_example_sting_witch_can_really_be!</div>
@ -92,7 +92,7 @@
</div> </div>
<li class="task"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<svg class="icon-priority level-2"><use xlink:href="#icon-priority" /></svg> <%- @Icon('task-state', 'closed') %>
</div> </div>
<div class="task-text"> <div class="task-text">
<div class="name">Print sheets strip off</div> <div class="name">Print sheets strip off</div>
@ -100,7 +100,7 @@
</div> </div>
<li class="task"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<svg class="icon-priority level-2"><use xlink:href="#icon-priority" /></svg> <%- @Icon('task-state', 'closed') %>
</div> </div>
<div class="task-text"> <div class="task-text">
<div class="name">Block not properly wrought</div> <div class="name">Block not properly wrought</div>
@ -114,7 +114,7 @@
<ol class="tasks tasks--standalone"> <ol class="tasks tasks--standalone">
<li class="task"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<svg class="icon-priority level-1"><use xlink:href="#icon-priority" /></svg> <%- @Icon('task-state', 'pending') %>
</div> </div>
<div class="task-text"> <div class="task-text">
<div class="name">Micro-SIM doesn't work</div> <div class="name">Micro-SIM doesn't work</div>
@ -122,7 +122,7 @@
</div> </div>
<li class="task"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<svg class="icon-priority level-1"><use xlink:href="#icon-priority" /></svg> <%- @Icon('task-state', 'closed') %>
</div> </div>
<div class="task-text"> <div class="task-text">
<div class="name">Superb Service!</div> <div class="name">Superb Service!</div>

View file

@ -326,9 +326,7 @@
<tbody> <tbody>
<tr class="item" data-id="1" data-position="1" style="cursor: pointer;"> <tr class="item" data-id="1" data-position="1" style="cursor: pointer;">
<td> <td>
<svg class="icon-priority level-1"> <%- @Icon('task-state', 'closed') %>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-priority"></use>
</svg>
</td> </td>
<td> <span class="user-popover" data-id="2" data-original-title="" title=""> <td> <span class="user-popover" data-id="2" data-original-title="" title="">
Nicole Braun (Zammad Foundation) Nicole Braun (Zammad Foundation)
@ -347,9 +345,7 @@
</tr> </tr>
<tr class="item" data-id="6" data-position="6" style="cursor: pointer;"> <tr class="item" data-id="6" data-position="6" style="cursor: pointer;">
<td> <td>
<svg class="icon-priority level-2"> <%- @Icon('task-state', 'closed') %>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-priority"></use>
</svg>
</td> </td>
<td> <span class="user-popover" data-id="2" data-original-title="" title=""> <td> <span class="user-popover" data-id="2" data-original-title="" title="">
Nicole Braun (Zammad Foundation) Nicole Braun (Zammad Foundation)

View file

@ -72,9 +72,7 @@
<tbody> <tbody>
<tr class="item" data-id="1" data-position="1" style="cursor: pointer;"> <tr class="item" data-id="1" data-position="1" style="cursor: pointer;">
<td> <td>
<svg class="icon-priority level-1"> <%- @Icon('task-state', 'closed') %>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-priority"></use>
</svg>
</td> </td>
<td> <span class="user-popover" data-id="2" data-original-title="" title=""> <td> <span class="user-popover" data-id="2" data-original-title="" title="">
Nicole Braun (Zammad Foundation) Nicole Braun (Zammad Foundation)
@ -93,9 +91,7 @@
</tr> </tr>
<tr class="item" data-id="3" data-position="3" style="cursor: pointer;"> <tr class="item" data-id="3" data-position="3" style="cursor: pointer;">
<td> <td>
<svg class="icon-priority level-2"> <%- @Icon('task-state', 'closed') %>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-priority"></use>
</svg>
</td> </td>
<td> <span class="user-popover" data-id="4" data-original-title="" title=""> <td> <span class="user-popover" data-id="4" data-original-title="" title="">
Hans Huber Hans Huber
@ -114,9 +110,7 @@
</tr> </tr>
<tr class="item" data-id="4" data-position="4" style="cursor: pointer;"> <tr class="item" data-id="4" data-position="4" style="cursor: pointer;">
<td> <td>
<svg class="icon-priority level-3"> <%- @Icon('task-state', 'closed') %>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-priority"></use>
</svg>
</td> </td>
<td> <span class="user-popover" data-id="2" data-original-title="" title=""> <td> <span class="user-popover" data-id="2" data-original-title="" title="">
Nicole Braun (Zammad Foundation) Nicole Braun (Zammad Foundation)
@ -135,9 +129,7 @@
</tr> </tr>
<tr class="item" data-id="5" data-position="5" style="cursor: pointer;"> <tr class="item" data-id="5" data-position="5" style="cursor: pointer;">
<td> <td>
<svg class="icon-priority level-3"> <%- @Icon('task-state', 'closed') %>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-priority"></use>
</svg>
</td> </td>
<td> <span class="user-popover" data-id="2" data-original-title="" title=""> <td> <span class="user-popover" data-id="2" data-original-title="" title="">
Nicole Braun (Zammad Foundation) Nicole Braun (Zammad Foundation)
@ -156,9 +148,7 @@
</tr> </tr>
<tr class="item" data-id="6" data-position="6" style="cursor: pointer;"> <tr class="item" data-id="6" data-position="6" style="cursor: pointer;">
<td> <td>
<svg class="icon-priority level-2"> <%- @Icon('task-state', 'closed') %>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#icon-priority"></use>
</svg>
</td> </td>
<td> <span class="user-popover" data-id="2" data-original-title="" title=""> <td> <span class="user-popover" data-id="2" data-original-title="" title="">
Nicole Braun (Zammad Foundation) Nicole Braun (Zammad Foundation)

View file

@ -66,33 +66,33 @@
<div class="profile-ticketList"> <div class="profile-ticketList">
<label>Bearbeitete Tickets (12)</label> <label>Bearbeitete Tickets (12)</label>
<ol class="tasks tasks--standalone"> <ol class="tasks tasks--standalone">
<li class="task level-1"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<svg class="icon-priority"><use xlink:href="#icon-priority" /></svg> <%- @Icon('task-state', 'closed') %>
</div> </div>
<div class="task-text"> <div class="task-text">
<div class="name">Micro-SIM doesn't work</div> <div class="name">Micro-SIM doesn't work</div>
<div class="time">23 minutes ago</div> <div class="time">23 minutes ago</div>
</div> </div>
<li class="task level-1"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<svg class="icon-priority"><use xlink:href="#icon-priority" /></svg> <%- @Icon('task-state', 'closed') %>
</div> </div>
<div class="task-text"> <div class="task-text">
<div class="name">Superb Service!</div> <div class="name">Superb Service!</div>
<div class="time">43 minutes ago</div> <div class="time">43 minutes ago</div>
</div> </div>
<li class="task level-1"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<svg class="icon-priority"><use xlink:href="#icon-priority" /></svg> <%- @Icon('task-state', 'closed') %>
</div> </div>
<div class="task-text"> <div class="task-text">
<div class="name">Print sheets strip_off_with_a_lot_of_text_in_the_headline</div> <div class="name">Print sheets strip_off_with_a_lot_of_text_in_the_headline</div>
<div class="time">1 hour ago</div> <div class="time">1 hour ago</div>
</div> </div>
<li class="task level-1"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<svg class="icon-priority"><use xlink:href="#icon-priority" /></svg> <%- @Icon('task-state', 'closed') %>
</div> </div>
<div class="task-text"> <div class="task-text">
<div class="name">Block not properly wrought</div> <div class="name">Block not properly wrought</div>
@ -104,33 +104,33 @@
<div class="profile-ticketList"> <div class="profile-ticketList">
<label>Bearbeitete Tickets (12)</label> <label>Bearbeitete Tickets (12)</label>
<ol class="tasks tasks--standalone"> <ol class="tasks tasks--standalone">
<li class="task level-1"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<svg class="icon-priority"><use xlink:href="#icon-priority" /></svg> <%- @Icon('task-state', 'closed') %>
</div> </div>
<div class="task-text"> <div class="task-text">
<div class="name">Micro-SIM doesn't work</div> <div class="name">Micro-SIM doesn't work</div>
<div class="time">23 minutes ago</div> <div class="time">23 minutes ago</div>
</div> </div>
<li class="task level-1"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<svg class="icon-priority"><use xlink:href="#icon-priority" /></svg> <%- @Icon('task-state', 'closed') %>
</div> </div>
<div class="task-text"> <div class="task-text">
<div class="name">Superb Service!</div> <div class="name">Superb Service!</div>
<div class="time">43 minutes ago</div> <div class="time">43 minutes ago</div>
</div> </div>
<li class="task level-1"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<svg class="icon-priority"><use xlink:href="#icon-priority" /></svg> <%- @Icon('task-state', 'closed') %>
</div> </div>
<div class="task-text"> <div class="task-text">
<div class="name">Print sheets strip off with a lot of text in the headline</div> <div class="name">Print sheets strip off with a lot of text in the headline</div>
<div class="time">1 hour ago</div> <div class="time">1 hour ago</div>
</div> </div>
<li class="task level-1"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<svg class="icon-priority"><use xlink:href="#icon-priority" /></svg> <%- @Icon('task-state', 'closed') %>
</div> </div>
<div class="task-text"> <div class="task-text">
<div class="name">Block not properly wrought</div> <div class="name">Block not properly wrought</div>

View file

@ -6,7 +6,7 @@
<% for item in @links[type]: %> <% for item in @links[type]: %>
<li class="task"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<%- @Icon('priority', item.icon()) %> <%- @Icon('task-state', item.iconClass()) %>
</div> </div>
<div class="task-text"> <div class="task-text">
<a class="name ticket-popover" data-id="<%- item.id %>" href="#ticket/zoom/<%= item.id %>"><%= item.title %></a> <a class="name ticket-popover" data-id="<%- item.id %>" href="#ticket/zoom/<%= item.id %>"><%= item.title %></a>

View file

@ -5,7 +5,7 @@
<li> <li>
<a href="<%- item.url %>" class="nav-tab nav-tab--search <%= item.class %>" data-id="<%= item.id %>"> <a href="<%- item.url %>" class="nav-tab nav-tab--search <%= item.class %>" data-id="<%= item.id %>">
<div class="nav-tab-icon"> <div class="nav-tab-icon">
<%- @Icon(item.iconClass) %> <%- @Icon(item.icon, item.iconClass) %>
</div> </div>
<span class="nav-tab-name flex u-textTruncate"><%= item.display %></span> <span class="nav-tab-name flex u-textTruncate"><%= item.display %></span>
</a> </a>

View file

@ -1,5 +1,5 @@
<div> <div>
<span class="<%- @ticket.icon() %>" title="<%- @ticket.iconTitle() %>"></span> <span class="<%- @ticket.iconTextClass() %>"><%- @ticket.iconTitle() %></span> <%- @Icon(@ticket.icon, @ticket.iconClass) %> <span class="<%- @ticket.iconTextClass() %>"><%- @ticket.iconTitle() %></span>
</div> </div>
<hr> <hr>
<div class="popover-block"> <div class="popover-block">

View file

@ -1,14 +1,18 @@
<% for item in @item_list: %> <% for item in @item_list: %>
<a href="<%- item.data.url %>" title="<%= item.data.title %>" class="nav-tab task <%= item.data.class %><% if item.task.active: %> is-active<% end %><% if item.task.notify: %> is-modified<% end %>" data-key="<%- item.task.key %>"> <a href="<%- item.data.url %>" title="<%= item.data.title %>" class="nav-tab task <%= item.data.class %><% if item.task.active: %> is-active<% end %><% if item.task.notify: %> is-modified<% end %>" data-key="<%- item.task.key %>">
<div class="nav-tab-icon"> <div class="nav-tab-icon">
<% if item.task.notify && item.data.iconClass is 'priority': %> <% if item.data.type is 'task': %>
<%- @Icon('priority-modified-outer-circle', "icon-#{item.data.iconClass}") %> <% if item.task.notify: %>
<%- @Icon('task-state-modified-outer-circle', "icon-#{item.data.iconClass}") %>
<% else: %>
<%- @Icon('task-state', item.data.iconClass) %>
<% end %>
<% if item.task.notify: %>
<%- @Icon('task-state-modified-inner-circle', "modified-inner-circle icon-#{item.data.iconClass}") %>
<% end %>
<% else: %> <% else: %>
<%- @Icon(item.data.iconClass) %> <%- @Icon(item.data.iconClass) %>
<% end %> <% end %>
<% if item.task.notify && item.data.iconClass is 'priority': %>
<%- @Icon('priority-modified-inner-circle', "modified-inner-circle icon-#{item.data.iconClass}") %>
<% end %>
</div> </div>
<div class="nav-tab-name u-textTruncate flex"><%= item.data.head %></div> <div class="nav-tab-name u-textTruncate flex"><%= item.data.head %></div>
<div class="nav-tab-close js-close" title="<%- @Ti('close') %>"> <div class="nav-tab-close js-close" title="<%- @Ti('close') %>">

View file

@ -5,7 +5,7 @@
<% ticket = App.Ticket.fullLocal(ticket_id) %> <% ticket = App.Ticket.fullLocal(ticket_id) %>
<li class="task"> <li class="task">
<div class="icon-holder"> <div class="icon-holder">
<%- @Icon('priority', ticket.icon()) %> <%- @Icon('task-state', ticket.iconClass()) %>
</div> </div>
<div class="task-text"> <div class="task-text">
<a class="name ticket-popover" data-id="<%- ticket_id %>" href="<%- ticket.uiUrl() %>"><%= ticket.title %></a> <a class="name ticket-popover" data-id="<%- ticket_id %>" href="<%- ticket.uiUrl() %>"><%= ticket.title %></a>