[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>
changesetd7d06161d868
branchdefault
phasedraft
hiddenyes
parent revision#a7c380494802 [merge] backport stable
child revision<not specified>
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 1363007814 -3600
# Mon Mar 11 14:16:54 2013 +0100
# Node ID d7d06161d868c52acee9bbad23768e6de4ac55e4
# Parent a7c38049480224367a77397f34fab4001d253dd5
[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
@@ -4,25 +4,53 @@
1 
2  /******************************************************************************/
3  /* tickets'priority                                                           */
4  /******************************************************************************/
5 
6 +@font-face {
7 +    font-family: "symbola";
8 +    src: url(/data/Symbola.ttf) format("truetype");
9 +}
10 +
11  td.label {
12      padding-right: 10px;
13  }
14 -td.minor, td.normal, td.important {
15 -    height: 16px;
16 -    padding-left: 18px !important;
17 +
18 +.minor:before {
19 +    background-color: green;
20 +}
21 +.normal:before {
22 +    background-color: blue;
23 +}
24 +.important:before {
25 +    background-color: red;
26  }
27 
28 -.minor {
29 -    padding: 1px 0px 1px 18px;
30 -    background: url("priority_minor.png") 0% 0.2em no-repeat !important;
31 +.ticket_bug:before
32 +{
33 +    content:"\1F4A3";
34 +    font-size: 75%;
35 +    font-weight: bolder;
36 +    padding: 2px;
37 +    border-radius: 100%;
38 +    color: white;
39 +} 
40 +
41 +.ticket_enhancement:before
42 +{
43 +    content:"\1F4A1";
44 +    font-size: 75%;
45 +    font-weight: bolder;
46 +    padding: 2px;
47 +    border-radius: 100%;
48 +    color: white;
49 +} 
50 +
51 +.ticket_task:before
52 +{
53 +    content:"\1F528";
54 +    font-size: 75%;
55 +    font-weight: bolder;
56 +    padding: 2px;
57 +    border-radius: 100%;
58 +    color: white;
59  }
60 -.normal {
61 -    padding: 1px 0px 1px 18px;
62 -    background: url("priority_normal.png") 0% 0.2em no-repeat !important;
63 -}
64 -.important {
65 -    padding: 1px 0px 1px 18px;
66 -    background: url("priority_important.png") 0% 0.2em no-repeat !important;
67 -}
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 @@
68      __select__ = is_instance('Ticket')
69 
70      def cell_call(self, row, col):
71          self._cw.add_css('cubes.tracker.css')
72          entity = self.cw_rset.get_entity(row, col)
73 -        self.w(tags.a(entity.dc_title(), href=entity.absolute_url(),
74 +        self.w(tags.a(entity.dc_title(),
75 +                      href=entity.absolute_url(),
76                        title=uilib.cut(entity.dc_description(), 80),
77 -                      klass=entity.priority))
78 +                      klass="%s ticket_%s" % (entity.priority, entity.type)))
79 
80 
81  class StatusSheetTicketView(EntityView):
82      __regid__ = 'instatussheet'
83      __select__ = is_instance('Ticket')