render changeset via a separate block
This commit is contained in:
parent
97eb1fae38
commit
1b249600e5
3 changed files with 18 additions and 15 deletions
|
@ -68,7 +68,7 @@ func MakeFrontend(runner *submitqueue.Runner) http.Handler {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
tmpl := template.Must(loadTemplate("submit-queue.tmpl.html", funcMap))
|
tmpl := template.Must(loadTemplate([]string{"submit-queue.tmpl.html", "changeset.tmpl.html"}, funcMap))
|
||||||
|
|
||||||
tmpl.ExecuteTemplate(c.Writer, "submit-queue.tmpl.html", gin.H{
|
tmpl.ExecuteTemplate(c.Writer, "submit-queue.tmpl.html", gin.H{
|
||||||
"series": submitQueue.Series,
|
"series": submitQueue.Series,
|
||||||
|
|
15
public/changeset.tmpl.html
Normal file
15
public/changeset.tmpl.html
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{{ define "changeset" }}
|
||||||
|
<tr>
|
||||||
|
<td>{{ .OwnerName }}</td>
|
||||||
|
<td>
|
||||||
|
<strong>{{ .Subject }}</strong> (<a href="{{ changesetURL . }}" target="_blank">#{{ .Number }}</a>)<br />
|
||||||
|
<small><code>{{ .CommitID }}</code></small>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span>
|
||||||
|
{{ if .IsVerified }}<span class="badge badge-success badge-pill">+1 (CI)</span>{{ end }}
|
||||||
|
{{ if .IsCodeReviewed }}<span class="badge badge-info badge-pill">+2 (CR)</span>{{ end }}
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{ end }}
|
|
@ -71,19 +71,7 @@
|
||||||
<td colspan="3" class="{{ if not ($serie | isAutoSubmittable) }}table-primary{{ else }}table-success{{ end }}">Serie with {{ len $serie.ChangeSets }} changes</td>
|
<td colspan="3" class="{{ if not ($serie | isAutoSubmittable) }}table-primary{{ else }}table-success{{ end }}">Serie with {{ len $serie.ChangeSets }} changes</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{ range $changeset := $serie.ChangeSets }}
|
{{ range $changeset := $serie.ChangeSets }}
|
||||||
<tr>
|
{{ block "changeset" $changeset }}{{ end }}
|
||||||
<td>{{ $changeset.OwnerName }}</td>
|
|
||||||
<td>
|
|
||||||
<strong>{{ $changeset.Subject }}</strong> (<a href="{{ changesetURL $changeset }}" target="_blank">#{{ $changeset.Number }}</a>)<br />
|
|
||||||
<small><code>{{ $changeset.CommitID }}</code></small>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<span>
|
|
||||||
{{ if $changeset.IsVerified }}<span class="badge badge-success badge-pill">+1 (CI)</span>{{ end }}
|
|
||||||
{{ if $changeset.IsCodeReviewed }}<span class="badge badge-info badge-pill">+2 (CR)</span>{{ end }}
|
|
||||||
</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3"> </td>
|
<td colspan="3"> </td>
|
||||||
|
|
Loading…
Reference in a new issue