1
2 from zope.interface import implements
3 from twisted.python import components
4 from twisted.web.error import NoResource
5
6 from buildbot.changes.changes import Change
7 from buildbot.status.web.base import HtmlResource, IBox, Box
8
11 self.change = change
12 self.title = "Change #%d" % num
13
14 - def content(self, req, cxt):
15 cxt['c'] = self.change.asDict()
16 template = req.site.buildbot_service.templates.get_template("change.html")
17 data = template.render(cxt)
18 return data
19
20
22
23 - def content(self, req, cxt):
24 cxt['sources'] = self.getStatus(req).getChangeSources()
25 template = req.site.buildbot_service.templates.get_template("change_sources.html")
26 return template.render(**cxt)
27
28
39
41 implements(IBox)
42
44 url = req.childLink("../changes/%d" % self.original.number)
45 template = req.site.buildbot_service.templates.get_template("change_macros.html")
46 text = template.module.box_contents(url=url,
47 who=self.original.getShortAuthor(),
48 title=self.original.comments)
49 return Box([text], class_="Change")
50 components.registerAdapter(ChangeBox, Change, IBox)
51