1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 from zope.interface import implements
18 from twisted.python import components
19 from twisted.web.error import NoResource
20
21 from buildbot.changes.changes import Change
22 from buildbot.status.web.base import HtmlResource, IBox, Box
23
26 self.change = change
27 self.title = "Change #%d" % num
28
29 - def content(self, req, cxt):
30 cxt['c'] = self.change.asDict()
31 template = req.site.buildbot_service.templates.get_template("change.html")
32 data = template.render(cxt)
33 return data
34
35
37
38 - def content(self, req, cxt):
39 cxt['sources'] = self.getStatus(req).getChangeSources()
40 template = req.site.buildbot_service.templates.get_template("change_sources.html")
41 return template.render(**cxt)
42
43
54
56 implements(IBox)
57
59 url = req.childLink("../changes/%d" % self.original.number)
60 template = req.site.buildbot_service.templates.get_template("change_macros.html")
61 text = template.module.box_contents(url=url,
62 who=self.original.getShortAuthor(),
63 title=self.original.comments)
64 return Box([text], class_="Change")
65 components.registerAdapter(ChangeBox, Change, IBox)
66