123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- {% load static %}
- {% load humanize %}
- {% load project_url_tag %}
- <script src="{% static 'js/mrbsection.js' %}"></script>
- {% if mru %}
- {% if mrb_type == 'project' %}
- <h2>
- Latest project builds
- {% if project.is_default %}
- <span class="glyphicon glyphicon-question-sign get-help heading-help" data-original-title="Builds in this project cannot be started from Toaster: they are started from the command line"></span>
- {% endif %}
- </h2>
- {% else %}
- <div class="page-header">
- <h1>Latest builds</h1>
- </div>
- {% endif %}
- <div id="latest-builds">
- {% for build in mru %}
- <div data-latest-build-result="{{build.id}}" class="alert build-result {% if build.outcome == build.SUCCEEDED %}alert-success{% elif build.outcome == build.FAILED %}alert-danger{% else %}alert-info{% endif %}">
- <!-- project title -->
- {% if mrb_type != 'project' %}
- <div class="row project-name">
- <div class="col-md-12">
- <small>
- <a class="alert-link text-uppercase" href={% project_url build.project %}>{{build.project.name}}</a>
- </small>
- </div>
- </div>
- {% endif %}
- <div class="row" data-role="build-status-container">
- <div class="col-md-12">
- Loading...
- </div>
- </div>
- </div>
- {% endfor %}
- </div>
- {% endif %}
- <!-- build main template -->
- <script id="build-template" type="text/x-jsrender">
- <div class="col-md-3">
- <!-- only show link for completed builds -->
- <%if state == 'Succeeded' || state == 'Failed'%>
- <a class="alert-link" href="<%:dashboard_url%>">
- <span data-toggle="tooltip" data-role="targets-text" title="Recipes: <%:targets%>">
- <%:targets_abbreviated%>
- </span>
- </a>
- <%else%>
- <span data-toggle="tooltip" data-role="targets-text" title="Recipes: <%:targets%>">
- <%:targets_abbreviated%>
- </span>
- <%/if%>
- </div>
- <%if state == 'Queued'%>
- <%include tmpl='#queued-build-template'/%>
- <%else state == 'Succeeded' || state == 'Failed'%>
- <%include tmpl='#succeeded-or-failed-build-template'/%>
- <%else state == 'Cancelling'%>
- <%include tmpl='#cancelling-build-template'/%>
- <%else state == 'In Progress'%>
- <%include tmpl='#in-progress-build-template'/%>
- <%else state == 'Cancelled'%>
- <%include tmpl='#cancelled-build-template'/%>
- <%/if%>
- </script>
- <!-- queued build -->
- <script id="queued-build-template" type="text/x-jsrender">
- <div class="col-md-5">
- Build queued
- </div>
- <div class="col-md-4">
- <%if is_default_project_build%>
- <!-- no cancel icon -->
- <span class="glyphicon glyphicon-question-sign get-help get-help-blue pull-right" title="Builds in this project cannot be cancelled from Toaster: they can only be cancelled from the command line"></span>
- <%else%>
- <!-- cancel button -->
- <span class="cancel-build-btn pull-right alert-link"
- data-buildrequest-id="<%:id%>" data-request-url="<%:cancel_url%>">
- <span class="glyphicon glyphicon-remove-circle"></span>
- Cancel
- </span>
- <%/if%>
- </div>
- </script>
- <!-- in progress build -->
- <script id="in-progress-build-template" type="text/x-jsrender">
- <!-- progress bar and task completion percentage -->
- <div data-role="build-status" class="col-md-4 col-md-offset-1 progress-info">
- <!-- progress bar -->
- <div class="progress" id="build-pc-done-title-<%:id%>">
- <div id="build-pc-done-bar-<%:id%>"
- style="width: <%:tasks_complete_percentage%>%;"
- class="progress-bar">
- </div>
- </div>
- </div>
- <div class="col-md-4 progress-info">
- <!-- task completion percentage -->
- <span id="build-pc-done-<%:id%>"><%:tasks_complete_percentage%></span>% of
- tasks complete
- <%if is_default_project_build%>
- <!-- no cancel icon -->
- <span class="glyphicon glyphicon-question-sign get-help get-help-blue pull-right" title="Builds in this project cannot be cancelled from Toaster: they can only be cancelled from the command line"></span>
- <%else%>
- <!-- cancel button -->
- <span class="cancel-build-btn pull-right alert-link"
- data-buildrequest-id="<%:id%>" data-request-url="<%:cancel_url%>">
- <span class="glyphicon glyphicon-remove-circle"></span>
- Cancel
- </span>
- <%/if%>
- </div>
- </script>
- <!-- cancelling build -->
- <script id="cancelling-build-template" type="text/x-jsrender">
- <div class="col-md-9">
- Cancelling the build ...
- </div>
- </script>
- <!-- succeeded or failed build -->
- <script id="succeeded-or-failed-build-template" type="text/x-jsrender">
- <!-- completed_on -->
- <div class="col-md-2">
- <%:completed_on%>
- </div>
- <!-- errors -->
- <div class="col-md-2">
- <%if errors%>
- <span class="glyphicon glyphicon-minus-sign"></span>
- <a href="<%:dashboard_errors_url%>" class="alert-link">
- <%:errors%> error<%:errors_pluralize%>
- </a>
- <%/if%>
- </div>
- <!-- warnings -->
- <div class="col-md-2">
- <%if warnings%>
- <span class="glyphicon glyphicon-minus-sign"></span>
- <a href="<%:dashboard_warnings_url%>" class="alert-link">
- <%:warnings%> warning<%:warnings_pluralize%>
- </a>
- <%/if%>
- </div>
- <!-- build time -->
- <div class="col-md-3">
- Build time: <a class="alert-link" href="<%:buildtime_url%>"><%:buildtime%></a>
- <%if is_default_project_build%>
- <!-- info icon -->
- <span class="pull-right glyphicon glyphicon-question-sign get-help <%if state == 'Success'%>get-help-green<%else state == 'Failed'%>get-help-red<%else%>get-help-blue<%/if%>"
- title="Builds in this project cannot be started from Toaster: they are started from the command line">
- </span>
- <%else%>
- <!-- rebuild button -->
- <span class="rebuild-btn alert-link <%if state == 'Success'%>success<%else state == 'Failed'%>danger<%else%>info<%/if%> pull-right"
- data-request-url="<%:rebuild_url%>" data-target='<%:build_targets_json%>'>
- <span class="glyphicon glyphicon-repeat"></span>
- Rebuild
- </span>
- <%/if%>
- </div>
- </script>
- <!-- cancelled build -->
- <script id="cancelled-build-template" type="text/x-jsrender">
- <!-- build cancelled message -->
- <div class="col-md-6">
- Build cancelled
- </div>
- <!-- rebuild button -->
- <div class="col-md-3">
- <span class="info pull-right rebuild-btn alert-link"
- data-request-url="<%:rebuild_url%>" data-target='<%:build_targets_json%>'>
- <span class="glyphicon glyphicon-repeat"></span>
- Rebuild
- </span>
- </div>
- </script>
- <script>
- $(document).ready(function () {
- var ctx = {
- mrbType : "{{mrb_type}}",
- }
- try {
- mrbSectionInit(ctx);
- } catch (e) {
- document.write("Sorry, An error has occurred loading this page");
- console.warn(e);
- }
- });
- </script>
|