[view] add ticket type to icon (closes #2741644)

This ticket remove the older priority icon in favor of one that convey the ticket type too. This icon is generated with CSS and unicode font.

A font able to render the character is added.

authorPierre-Yves David <pierre-yves.david@logilab.fr>
changeset29664a3a95a6
branchdefault
phasepublic
hiddenno
parent revision#57369ae88125 [ms] remove now unused option pyro-ns-id (closes #2582788)
child revision#c22660aa69cc Add hooks to update projects modification_date upon ticket/version/subproject events
files modified by this revision
data/Symbola.ttf
data/cubes.tracker.css
data/priority_important.png
data/priority_minor.png
data/priority_normal.png
views/ticket.py
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@logilab.fr>
# Date 1364208868 -3600
# Mon Mar 25 11:54:28 2013 +0100
# Node ID 29664a3a95a61c017482d44f512466ef88fb1b75
# Parent 57369ae88125d09db89a85a2a1dee5778bf825ec
[view] add ticket type to icon (closes #2741644)

This ticket remove the older priority icon in favor of one that convey the
ticket type too. This icon is generated with CSS and unicode font.

A font able to render the character is added.

diff --git a/data/Symbola.ttf b/data/Symbola.ttf
diff --git a/data/cubes.tracker.css b/data/cubes.tracker.css
@@ -1,28 +1,61 @@
1  span.state{
2      font-size : 56%;
3  }
4 
5  /******************************************************************************/
6 -/* tickets'priority                                                           */
7 +/* tickets's icons (priority and type)                                        */
8  /******************************************************************************/
9 
10 +/* Symbola is the only font capable on rendering all unicode char by the time
11 + * this css is writen */
12 +@font-face {
13 +    font-family: "symbola";
14 +    src: url(/data/Symbola.ttf) format("truetype");
15 +}
16 +
17  td.label {
18      padding-right: 10px;
19  }
20 -td.minor, td.normal, td.important {
21 -    height: 16px;
22 -    padding-left: 18px !important;
23 +
24 +.minor:before {
25 +    background-color: green;
26 +}
27 +.normal:before {
28 +    background-color: blue;
29 +}
30 +.important:before {
31 +    background-color: red;
32  }
33 
34 -.minor {
35 -    padding: 1px 0px 1px 18px;
36 -    background: url("priority_minor.png") 0% 0.2em no-repeat !important;
37 +/* 1F4A3 is Unicode Character 'BOMB' */
38 +.ticket_bug:before
39 +{
40 +    content:"\1F4A3";
41 +    font-size: 75%;
42 +    font-weight: bolder;
43 +    padding: 2px;
44 +    border-radius: 100%;
45 +    color: white;
46 +} 
47 +
48 +/* 1F4A1 is Unicode Character 'ELECTRIC LIGHT BULB' */
49 +.ticket_enhancement:before
50 +{
51 +    content:"\1F4A1";
52 +    font-size: 75%;
53 +    font-weight: bolder;
54 +    padding: 2px;
55 +    border-radius: 100%;
56 +    color: white;
57 +} 
58 +
59 +/* 1F528 is Unicode Character 'HAMMER' */
60 +.ticket_task:before
61 +{
62 +    content:"\1F528";
63 +    font-size: 75%;
64 +    font-weight: bolder;
65 +    padding: 2px;
66 +    border-radius: 100%;
67 +    color: white;
68  }
69 -.normal {
70 -    padding: 1px 0px 1px 18px;
71 -    background: url("priority_normal.png") 0% 0.2em no-repeat !important;
72 -}
73 -.important {
74 -    padding: 1px 0px 1px 18px;
75 -    background: url("priority_important.png") 0% 0.2em no-repeat !important;
76 -}
diff --git a/data/priority_important.png b/data/priority_important.png
diff --git a/data/priority_minor.png b/data/priority_minor.png
diff --git a/data/priority_normal.png b/data/priority_normal.png
diff --git a/views/ticket.py b/views/ticket.py
@@ -90,13 +90,14 @@
77      __select__ = is_instance('Ticket')
78 
79      def cell_call(self, row, col):
80          self._cw.add_css('cubes.tracker.css')
81          entity = self.cw_rset.get_entity(row, col)
82 -        self.w(tags.a(entity.dc_title(), href=entity.absolute_url(),
83 +        self.w(tags.a(entity.dc_title(),
84 +                      href=entity.absolute_url(),
85                        title=uilib.cut(entity.dc_description(), 80),
86 -                      klass=entity.priority))
87 +                      klass="%s ticket_%s" % (entity.priority, entity.type)))
88 
89 
90  class StatusSheetTicketView(EntityView):
91      __regid__ = 'instatussheet'
92      __select__ = is_instance('Ticket')