runbot/runbot/templates/frontend.xml
Xavier-Do fe987cd0f3 [IMP] runbot: some fixes for ps runbot
- searching on number will search for both pr and branche name
- hooks are now using payload to define repo when not given in url
- fixes .git cleaning in repo
    (remove rstrip since it can fail for repo starting with g, i, t)
- recompute base on prepare if base was not found
- remove local_result form write values if there is a single record
    (instead of raising, makes python step easier to write).
- avoid stucked build/loop after removing a step from a config.
- avoid to send ci for linked base_commit
- add a fallback mechanism for base if no master branch is found
- add option on project to avoid to keep sticky running, usefull
    when using a lots of projects
    WARNING: this is a change of default behaviour, need to update
    existing projects.
- always discover new commits for branch matching base paterns.
    This is especially usefull to discover old versions on project with
    low merge frequency.
- always create a batch, event if there is now trigger. This helps to
    notice that commits are discovered
- add line-through on death branches/pr
- manual trigger are now displayed on main page
2022-01-10 15:19:44 +01:00

123 lines
6.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="runbot.bundles">
<t t-call='web.frontend_layout'>
<t t-set="nav_form">
<form class="form-inline my-2 my-lg-0" role="search" t-att-action="qu(search='')" method="get">
<div class="input-group md-form form-sm form-2 pl-0">
<input class="form-control my-0 py-1 red-border" type="text" placeholder="Search" aria-label="Search" name="search" t-att-value="search"/>
<div class="input-group-append">
<button type='submit' class="input-group-text red lighten-3" id="basic-text1">
<i class="fa fa-search text-grey"/>
</button>
</div>
</div>
</form>
</t>
<div class="container-fluid frontend">
<div class="row">
<div class='col-md-12'>
<span class="pull-right" t-call="runbot.slots_infos"/>
</div>
<div class='col-md-12'>
<div t-if="message" class="alert alert-warning" role="alert">
<t t-esc="message" />
</div>
<div t-if="not project" class="mb32">
<h1>No project</h1>
</div>
<div t-else="">
<div t-foreach="bundles" t-as="bundle" class="row bundle_row">
<div class="col-md-3 col-lg-2 cell">
<div class="one_line">
<i t-if="bundle.sticky" class="fa fa-star" style="color: #f0ad4e" />
<a t-attf-href="/runbot/bundle/#{bundle.id}" title="View Bundle">
<b t-esc="bundle.name"/>
</a>
</div>
<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
<div class="btn-group" role="group">
<t t-foreach="categories" t-as="category">
<t t-if="active_category_id != category.id">
<t t-set="last_category_batch" t-value="bundle.with_context(category_id=category.id).last_done_batch"/>
<t t-if="last_category_batch">
<t t-if="category.view_id" t-call="{{category.view_id.key}}"/>
<a t-else=""
t-attf-title="View last {{category.name}} batch"
t-attf-href="/runbot/batch/{{last_category_batch.id}}"
t-attf-class="fa fa-{{category.icon}}"
/>
</t>
</t>
</t>
</div>
<div class="btn-group" role="group">
<t t-if="not bundle.sticky" t-call="runbot.branch_copy_button"/>
<t t-call="runbot.branch_github_menu"/>
</div>
</div>
</div>
<div class="col-md-9 col-lg-10">
<div class="row no-gutters">
<div t-foreach="bundle.last_batchs" t-as="batch" t-attf-class="col-md-6 col-xl-3 {{'d-none d-xl-block' if batch_index > 1 else ''}}">
<t t-call="runbot.batch_tile"/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</t>
</template>
<template id="runbot.batch_tile">
<t t-set="klass">info</t>
<t t-if="batch.state=='skipped'" t-set="klass">killed</t>
<t t-if="batch.state=='done' and all(slot.build_id.global_result == 'ok' for slot in batch.slot_ids if slot.build_id)" t-set="klass">success</t>
<t t-if="batch.state=='done' and any(slot.build_id.global_result in ('ko', 'warn') for slot in batch.slot_ids)" t-set="klass">danger</t>
<div t-attf-class="batch_tile {{'more' if more else 'nomore'}}">
<div t-attf-class="card bg-{{klass}}-light">
<div class="batch_header">
<a t-attf-href="/runbot/batch/#{batch.id}" t-attf-class="badge badge-{{'warning' if batch.has_warning else 'light'}}" title="View Batch">
<t t-esc="batch.get_formated_age()"/>
<i class="fa fa-exclamation-triangle" t-if="batch.has_warning"/>
<i class="arrow fa fa-window-maximize"/>
</a>
</div>
<t t-if="batch.state=='preparing'">
<span><i class="fa fa-cog fa-spin fa-fw"/> preparing</span>
</t>
<div class="batch_slots">
<t t-foreach="batch.slot_ids" t-as="slot">
<t t-if="slot.build_id">
<div t-if="((not slot.trigger_id.hide and trigger_display is None) or (trigger_display and slot.trigger_id.id in trigger_display)) or slot.build_id.global_result == 'ko'"
t-call="runbot.slot_button" class="slot_container"/>
</t>
</t>
<div class="slot_filler" t-foreach="range(10)" t-as="x"/>
</div>
<div class="batch_commits">
<div t-foreach="batch.commit_link_ids.sorted(lambda cl: (cl.commit_id.repo_id.sequence, cl.commit_id.repo_id.id))" t-as="commit_link" class="one_line">
<a t-attf-href="/runbot/commit/#{commit_link.commit_id.id}" t-attf-class="badge badge-light batch_commit match_type_{{commit_link.match_type}}">
<i class="fa fa-fw fa-hashtag" t-if="commit_link.match_type == 'new'" title="This commit is a new head"/>
<i class="fa fa-fw fa-link" t-if="commit_link.match_type == 'head'" title="This commit is an existing head from bundle branches"/>
<i class="fa fa-fw fa-code-fork" t-if="commit_link.match_type == 'base_match'" title="This commit is matched from a base batch with matching merge_base"/>
<i class="fa fa-fw fa-clock-o" t-if="commit_link.match_type == 'base_head'" title="This commit is the head of a base branch"/>
<t t-esc="commit_link.commit_id.dname"/>
</a>
<a t-att-href="'https://%s/commit/%s' % (commit_link.branch_id.remote_id.base_url, commit_link.commit_id.name)" class="badge badge-light" title="View Commit on Github"><i class="fa fa-github"/></a>
<span t-esc="commit_link.commit_id.subject"/>
</div>
</div>
</div>
</div>
</template>
</data>
</odoo>