[merge] backport stable

authorAurelien Campeas <aurelien.campeas@logilab.fr>
changeseta7c380494802
branchdefault
phasepublic
hiddenno
parent revision#d80e9915458f Added tag cubicweb-tracker-debian-version-1.11.0-1 for changeset c326af037b99, #4aa657955120 Added tag cubicweb-tracker-debian-version-1.11.1-1 for changeset 86d34418c47f
child revision#d7d06161d868 [view] add ticket type to icon (closes #2741644), #a2092403f5e5 Add hooks to update projects modification_date upon ticket/version/subproject events, #57369ae88125 [ms] remove now unused option pyro-ns-id (closes #2582788), #3155321b7fac Define a custom projects list view (closes #2723082)
files modified by this revision
.hgtags
__pkginfo__.py
debian/changelog
testutils.py
views/ticket.py
views/version.py
# HG changeset patch
# User Aurelien Campeas <aurelien.campeas@logilab.fr>
# Date 1358963866 -3600
# Wed Jan 23 18:57:46 2013 +0100
# Node ID a7c38049480224367a77397f34fab4001d253dd5
# Parent d80e9915458f56b833d740f697a3c405ba87eeff
# Parent 4aa657955120f1ba4800ef4e6e725180745af314
[merge] backport stable

diff --git a/.hgtags b/.hgtags
@@ -40,5 +40,7 @@
1  eb32350656103079077f237fd088df691be7cf2d cubicweb-tracker-debian-version-1.10.1-1
2  7790effff06d26ea86dff36cb6d4156d858c2d5d cubicweb-tracker-version-1.10.2
3  0a8928fb83f78a4ceeda8209b46462fa9942695c cubicweb-tracker-debian-version-1.10.2-1
4  7d65a71b31f23110b740b501790073645202b11c cubicweb-tracker-version-1.11.0
5  c326af037b99e1d6641871f98238cedad078b7c5 cubicweb-tracker-debian-version-1.11.0-1
6 +0cd4c29135c91607955c15e6905d72ccb38a23c3 cubicweb-tracker-version-1.11.1
7 +86d34418c47f6a5a57be7d508db892adac943eca cubicweb-tracker-debian-version-1.11.1-1
diff --git a/__pkginfo__.py b/__pkginfo__.py
@@ -5,11 +5,11 @@
8  http://www.logilab.fr/ -- mailto:contact@logilab.fr
9  """
10  modname = 'tracker'
11  distname = 'cubicweb-tracker'
12 
13 -numversion = (1, 11, 0)
14 +numversion = (1, 11, 1)
15  version = '.'.join(str(num) for num in numversion)
16 
17  license = 'LGPL'
18  author = 'LOGILAB S.A. (Paris, FRANCE)'
19  author_email = 'contact@logilab.fr'
diff --git a/debian/changelog b/debian/changelog
@@ -1,5 +1,11 @@
20 +cubicweb-tracker (1.11.1-1) unstable; urgency=low
21 +
22 +  * new upstream release
23 +
24 + -- David Douard <david.douard@logilab.fr>  Fri, 16 Nov 2012 11:35:34 +0100
25 +
26  cubicweb-tracker (1.11.0-1) unstable; urgency=low
27 
28    * new upstream release
29 
30   -- David Douard <david.douard@logilab.fr>  Mon, 18 Jun 2012 18:19:04 +0200
diff --git a/testutils.py b/testutils.py
@@ -68,10 +68,15 @@
31  class TrackerBaseTC(TrackerTCMixIn, CubicWebTC):
32      def setup_database(self):
33          self.cubicweb = self.request().create_entity('Project', name=u'cubicweb',
34                                          description=u"cubicweb c'est beau")
35 
36 +    def tearDown(self):
37 +        CubicWebTC.tearDown(self)
38 +        for sessionid in list(self.repo._sessions):
39 +            self.repo.close(sessionid)
40 +
41 
42  class SecurityTC(TrackerTCMixIn, CubicWebTC):
43      repo_config = BaseApptestConfiguration('data')
44      def setUp(self):
45          """
@@ -90,10 +95,15 @@
46          self.cubicweb = security_tc_init_project(self, self.session, 'cubicweb', user_prefix='prj1')
47          self.project2 = security_tc_init_project(self, self.session, 'project2', user_prefix='prj2')
48          self.commit()
49          self.maxeid = self.execute('Any MAX(X)')[0][0]
50 
51 +    def tearDown(self):
52 +        CubicWebTC.tearDown(self)
53 +        for sessionid in list(self.repo._sessions):
54 +            self.repo.close(sessionid)
55 +
56      def mylogin(self, user, **kwargs):
57          if not user in self.__cnxs:
58              if user == 'narval':
59                  kwargs['password'] = 'narval0'
60              self.__cnxs[user] = self.login(user, autoclose=False, **kwargs)
@@ -240,10 +250,12 @@
61 
62      def tearDown(self):
63          for source in self.repo.sources[1:]:
64              self.repo.remove_source(source.uri)
65          CubicWebTC.tearDown(self)
66 +        for sessionid in list(self.repo._sessions):
67 +            self.repo.close(sessionid)
68 
69      def extid2eid(self, extid, etype):
70          return self.repo.extid2eid(self.extern, str(extid), etype, self.session)
71 
72      def fire_transition(self, eid, trname):
diff --git a/views/ticket.py b/views/ticket.py
@@ -36,13 +36,13 @@
73      """primary view for tickets
74      """
75      __select__ = primary.PrimaryView.__select__ & is_instance('Ticket')
76 
77      def render_entity_title(self, entity):
78 -        self.w(u'<h1><span class="%s %s">%s %s</span><span class="state"> [%s]</span></h1>'
79 -               % (entity.priority, entity.type,
80 -                  xml_escape(entity.project.name),
81 +        self._cw.add_css('cubes.tracker.css')
82 +        self.w(u'<h1>%s %s<span class="state"> [%s]</span></h1>'
83 +               % (xml_escape(entity.project.name),
84                    xml_escape(entity.dc_title()),
85                    xml_escape(self._cw._(entity.cw_adapt_to('IWorkflowable').state))))
86 
87 
88  # pluggable sections ###########################################################
diff --git a/views/version.py b/views/version.py
@@ -1,9 +1,9 @@
89  """views for Version entities
90 
91  :organization: Logilab
92 -:copyright: 2006-2011 LOGILAB S.A. (Paris, FRANCE), license is LGPL.
93 +:copyright: 2006-2012 LOGILAB S.A. (Paris, FRANCE), license is LGPL.
94  :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
95  """
96  __docformat__ = "restructuredtext en"
97  _ = unicode
98 
@@ -12,11 +12,11 @@
99  from logilab.mtconverter import xml_escape
100 
101  from cubicweb import tags
102  from cubicweb.schema import display_name
103  from cubicweb.predicates import is_instance, score_entity
104 -from cubicweb.view import StartupView, EntityAdapter
105 +from cubicweb.view import EntityView, StartupView, EntityAdapter
106  from cubicweb.web import uicfg, component, action
107  from cubicweb.web.views import (baseviews, tabs, tableview,
108                                  xmlrss, navigation, ibreadcrumbs)
109 
110  from cubes.iprogress import views as iprogress
@@ -210,14 +210,21 @@
111          entity = self.cw_rset.get_entity(row, col)
112          if entity.version_of:
113              project = entity.version_of[0]
114              self.w(tags.a(project.name, href=project.absolute_url()))
115          self.w(u'&nbsp;-&nbsp;')
116 -        self.w(u'<a href="%s">' % xml_escape(entity.absolute_url()))
117 -        self.wdata(entity.num)
118 -        self.wdata(u' [%s]' % self._cw._(entity.cw_adapt_to('IWorkflowable').state))
119 -        self.w(u'</a>')
120 +        entity.view('tracker.link_with_status', w=self.w)
121 +
122 +
123 +class VersionStatusView(EntityView):
124 +    __select__ = is_instance('Version')
125 +    __regid__ = 'tracker.link_with_status'
126 +
127 +    def entity_call(self, entity):
128 +        self.w(tags.a(entity.num, href=entity.absolute_url()))
129 +        state = self._cw._(entity.cw_adapt_to('IWorkflowable').state)
130 +        self.w(u' [%s]' % xml_escape(state))
131 
132 
133  # other views ##################################################################
134 
135  def depends_on_cell(w, entity):