| <!-- |
| Copyright 2020 The Go Authors. All rights reserved. |
| Use of this source code is governed by a BSD-style |
| license that can be found in the LICENSE file. |
| --> |
| {{template "layout" .}} |
| |
| {{define "content"}} |
| {{- /* gotype: golang.org/x/build/internal/relui.homeResponse */ -}} |
| <section class="Workflows"> |
| <div class="Workflows-header"> |
| <h2> |
| {{if ne .SiteHeader.NameParam "all"}} |
| {{.SiteHeader.NameParam}} |
| {{else}} |
| Workflows |
| {{end}} |
| </h2> |
| <a href="{{baseLink "/new_workflow"}}" class="Button">New</a> |
| </div> |
| <h2>Active Workflows</h2> |
| {{template "workflow_list" .ActiveWorkflows}} |
| <h2>Completed Workflows</h2> |
| {{template "workflow_list" .InactiveWorkflows}} |
| </section> |
| {{end}} |
| |
| {{- /* gotype: []golang.org/x/build/internal/relui/db.Workflow */ -}} |
| {{define "workflow_list"}} |
| <table class="WorkflowList"> |
| <thead> |
| <tr class="WorkflowList-itemHeader"> |
| <th class="WorkflowList-itemHeaderCol WorkflowList-itemStateHeader">State</th> |
| <th class="WorkflowList-itemHeaderCol WorkflowList-itemName">Name</th> |
| <th class="WorkflowList-itemHeaderCol WorkflowList-itemCreated">Created</th> |
| <th class="WorkflowList-itemHeaderCol WorkflowList-itemUpdated">Updated</th> |
| </tr> |
| </thead> |
| <tbody> |
| {{- /* gotype: golang.org/x/build/internal/relui/db.Workflow */ -}} |
| {{range .}} |
| <tr class="WorkflowList-item"> |
| <td class="WorkflowList-itemState"> |
| {{if .Error}} |
| <img |
| class="WorkflowList-itemStateIcon" |
| alt="error" |
| src="{{baseLink "/static/images/error_red_24dp.svg"}}" /> |
| {{else if .Finished}} |
| <img |
| class="WorkflowList-itemStateIcon" |
| alt="finished" |
| src="{{baseLink "/static/images/check_circle_green_24dp.svg"}}" /> |
| {{else}} |
| <img |
| class="WorkflowList-itemStateIcon" |
| alt="started" |
| src="{{baseLink "/static/images/pending_yellow_24dp.svg"}}" /> |
| {{end}} |
| </td> |
| <td class="WorkflowList-itemName"> |
| <a href="{{baseLink "/workflows/" .ID.String}}">{{.Name.String}}</a> |
| </td> |
| <td class="WorkflowList-itemCreated"> |
| {{.CreatedAt.UTC.Format "Mon, 02 Jan 2006 15:04:05 MST"}} |
| </td> |
| <td class="WorkflowList-itemUpdated"> |
| {{.UpdatedAt.UTC.Format "Mon, 02 Jan 2006 15:04:05 MST"}} |
| </td> |
| </tr> |
| {{else}} |
| <tr> |
| <td>None</td> |
| </tr> |
| {{end}} |
| </tbody> |
| </table> |
| {{end}} |