runbot/runbot/templates/bundle.xml
Xavier-Do 7cdf77ce18 [IMP] runbot: hide some buttons
Force new batch buttons can be sometimes confusing for user.
Creating a group to show this button for advanced user only will help
avoiding useless new batch when it's not needed.

New batch is only needed:
- to create a new slot when a new trigger is added/modified through a
custom trigger
- take last databases into account for upgrades, mainly when backporting
a new field or strange usually forbiden operations
- avoiding to need to push again to rebase when a r+ was added on one
pr but one of them needs to be rebased or adapted.

Thos case are unusuall but the button is used most of the time thinking
this is a kind or rebuild or maybe it will rebase and push the branch
on the pr. Only user with basic knowledge of when it is needed should
have access to these buttons.
2022-11-29 16:07:34 +01:00

89 lines
6.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="runbot.bundle">
<t t-call='runbot.layout'>
<div class="container-fluid">
<div class="row">
<div class='col-md-12'>
<div class="navbar navbar-default">
<span class="text-center" style="font-size: 18px;">
<t t-esc="bundle.name"/>
<i t-if="bundle.sticky" class="fa fa-star" style="color: #f0ad4e" />
<div class="btn-group" role="group">
<a groups="runbot.group_runbot_advanced_user" t-attf-href="/web/#id={{bundle.id}}&amp;view_type=form&amp;model=runbot.bundle&amp;menu_id={{env.ref('runbot.runbot_menu_root').id}}" class="btn btn-default btn-sm" target="new" title="View in Backend">
<i class="fa fa-list"/>
</a>
<a groups="runbot.group_runbot_advanced_user" class="btn btn-default" t-attf-href="/runbot/bundle/{{bundle.id}}/force" title="Force A New Batch">
<i class="fa fa-refresh"/>
</a>
<a groups="runbot.group_runbot_advanced_user" class="btn btn-default" t-attf-href="/runbot/bundle/{{bundle.id}}/force/1" title="Force A New Batch with automatic rebase">
<i class="fa fa-fast-forward"/>
</a>
<t t-call="runbot.branch_copy_button"/>
<t t-call="runbot.bundle_stats_dropdown"/>
</div>
</span>
<span class="pull-right">
<t t-call="website.pager" />
</span>
</div>
<div>
<table class="table table-condensed table-responsive table-stripped">
<tr>
<td>Version</td>
<td>
<t t-esc="bundle.version_id.name"/>
</td>
</tr>
<tr>
<td>Branches</td>
<td>
<t t-foreach="bundle.branch_groups().items()" t-as="group">
<t t-foreach="group[1]" t-as="branch">
<small>
<div class="btn-toolbar mb-1" role="toolbar">
<div class="btn-group btn-group-ssm" role="group">
<a t-att-href="branch.branch_url" class="btn btn-default text-left" title="View Branch on Github"><i class="fa fa-github"/></a>
<a groups="runbot.group_runbot_admin" class="btn btn-default fa fa-list text-left" t-attf-href="/web/#id={{branch.id}}&amp;view_type=form&amp;model=runbot.branch" target="new" title="View Branch in Backend"/>
<a href="#" t-esc="branch.remote_id.short_name" class="btn btn-default disabled text-left"/>
<a t-attf-href="/runbot/branch/{{branch.id}}" class="btn btn-default text-left" title="View Branch Details"><span t-att-class="'' if branch.alive else 'line-through'" t-esc="branch.name"/> <i t-if="not branch.alive" title="deleted/closed" class="fa fa-ban text-danger"/></a>
<t t-if="len(group[1]) == 1 and not branch.is_pr">
<a t-attf-href="https://{{group[0].main_remote_id.base_url}}/compare/{{bundle.version_id.name}}...{{branch.remote_id.owner}}:{{branch.name}}?expand=1" class="btn btn-default text-left" title="Create pr"><i class="fa fa-code-fork"/> Create pr</a>
</t>
</div>
</div>
</small>
</t>
</t>
</td>
</tr>
<tr t-if="more">
<td>Project</td>
<td t-esc="bundle.project_id.name"/>
</tr>
<tr t-if="more">
<td>New build enabled</td>
<td>
<i t-attf-class="fa fa-{{'times' if bundle.no_build else 'check'}}"/>
</td>
</tr>
<tr t-if="more">
<td>Modules</td>
<td t-esc="bundle.modules or '/'"/>
</tr>
</table>
</div>
<div t-foreach="bundle.consistency_warning()" t-as="warning" t-esc="warning[1]" t-attf-class="alert alert-{{warning[0]}}"/>
<div class="batch_row" t-foreach="batchs" t-as="batch">
<t t-call="runbot.batch_tile"/>
</div>
</div>
</div>
</div>
</t>
</template>
</data>
</odoo>