render serie via a separate block
This commit is contained in:
parent
1b249600e5
commit
151cc75532
3 changed files with 17 additions and 10 deletions
|
@ -68,7 +68,11 @@ func MakeFrontend(runner *submitqueue.Runner) http.Handler {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
tmpl := template.Must(loadTemplate([]string{"submit-queue.tmpl.html", "changeset.tmpl.html"}, funcMap))
|
tmpl := template.Must(loadTemplate([]string{
|
||||||
|
"submit-queue.tmpl.html",
|
||||||
|
"serie.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,
|
||||||
|
|
11
public/serie.tmpl.html
Normal file
11
public/serie.tmpl.html
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{{ define "serie" }}
|
||||||
|
<tr>
|
||||||
|
<td colspan="3" class="{{ if not (. | isAutoSubmittable) }}table-primary{{ else }}table-success{{ end }}">Serie with {{ len .ChangeSets }} changes</td>
|
||||||
|
</tr>
|
||||||
|
{{ range $changeset := .ChangeSets }}
|
||||||
|
{{ block "changeset" $changeset }}{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
<tr>
|
||||||
|
<td colspan="3"> </td>
|
||||||
|
</tr>
|
||||||
|
{{ end }}
|
|
@ -67,15 +67,7 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{{ range $serie := .series }}
|
{{ range $serie := .series }}
|
||||||
<tr>
|
{{ block "serie" $serie }}{{ end }}
|
||||||
<td colspan="3" class="{{ if not ($serie | isAutoSubmittable) }}table-primary{{ else }}table-success{{ end }}">Serie with {{ len $serie.ChangeSets }} changes</td>
|
|
||||||
</tr>
|
|
||||||
{{ range $changeset := $serie.ChangeSets }}
|
|
||||||
{{ block "changeset" $changeset }}{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
<tr>
|
|
||||||
<td colspan="3"> </td>
|
|
||||||
</tr>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in a new issue