diff --git a/runbot/__manifest__.py b/runbot/__manifest__.py index cf78cbc2..122e6199 100644 --- a/runbot/__manifest__.py +++ b/runbot/__manifest__.py @@ -22,6 +22,7 @@ 'templates/dashboard.xml', 'templates/nginx.xml', 'templates/badge.xml', + 'templates/branch.xml', 'data/runbot_cron.xml' ], } diff --git a/runbot/controllers/frontend.py b/runbot/controllers/frontend.py index 5d13b4cd..889d5e91 100644 --- a/runbot/controllers/frontend.py +++ b/runbot/controllers/frontend.py @@ -331,3 +331,19 @@ class Runbot(http.Controller): 'data': ctx, } return request.render("runbot.glances", qctx) + + @http.route(['/runbot/branch/', '/runbot/branch//page/'], website=True, auth='public', type='http') + def branch_builds(self, branch_id=None, search='', page=1, limit=50, refresh='', **kwargs): + """ list builds of a runbot branch """ + builds_count = request.env['runbot.build'].search_count([('branch_id','=',branch_id)]) + pager = request.website.pager( + url='/runbot/branch/%s' % branch_id, + total=builds_count, + page=page, + step=50 + ) + builds = request.env['runbot.build'].search([('branch_id','=',branch_id)], limit=limit, offset=pager.get('offset',0)) + + context = {'pager': pager, 'builds': builds} + return request.render("runbot.branch", context) + diff --git a/runbot/templates/branch.xml b/runbot/templates/branch.xml new file mode 100644 index 00000000..47b1c1f3 --- /dev/null +++ b/runbot/templates/branch.xml @@ -0,0 +1,56 @@ + + + + + + diff --git a/runbot/templates/frontend.xml b/runbot/templates/frontend.xml index a0e87cea..cc76c1b2 100644 --- a/runbot/templates/frontend.xml +++ b/runbot/templates/frontend.xml @@ -119,7 +119,7 @@ - +