[IMP] runbot_merge, forwardport: notify when main crons are off

During freezes it can be useful to notify viewers that nothing is
going to forward port or merge for a while, and that this is
intentional (not something that's broken).

Fixes #307
This commit is contained in:
Xavier Morel 2020-02-07 13:47:18 +01:00 committed by xmo-odoo
parent 9d661480fc
commit 53e46001ba
2 changed files with 19 additions and 0 deletions

View File

@ -1,4 +1,13 @@
<odoo>
<template id="dashboard" inherit_id="runbot_merge.dashboard">
<xpath expr="//div[@id='alerts']">
<t t-set="fpcron" t-value="env(user=1).ref('forwardport.port_forward')"/>
<div t-if="not fpcron.active" class="alert alert-warning col-12" role="alert">
Forward-port is disabled, merged pull requests will not be forward-ported.
</div>
</xpath>
</template>
<record model="ir.ui.view" id="project">
<field name="name">Show forwardport project fields</field>
<field name="inherit_id" ref="runbot_merge.runbot_merge_form_project"/>

View File

@ -13,6 +13,16 @@
<template id="dashboard" name="mergebot dashboard">
<t t-call="website.layout">
<div id="wrap"><div class="container-fluid">
<div id="alerts" class="row text-center">
<t t-set="stagingcron" t-value="env(user=1).ref('runbot_merge.staging_cron')"/>
<div t-if="not stagingcron.active" class="alert alert-warning col-12" role="alert">
Staging is disabled, "ready" pull requests will not be staged.
</div>
<t t-set="mergecron" t-value="env(user=1).ref('runbot_merge.merge_cron')"/>
<div t-if="not mergecron.active" class="alert alert-warning col-12" role="alert">
Merging is disabled, stagings will not be disabled.
</div>
</div>
<section t-foreach="projects.with_context(active_test=False)" t-as="project" class="row">
<h1 class="col-md-12"><t t-esc="project.name"/></h1>
<div class="col-md-12">