diff options
author | Florian Klink <flokli@flokli.de> | 2019-11-27T10·38+0100 |
---|---|---|
committer | Florian Klink <flokli@flokli.de> | 2019-11-27T10·40+0100 |
commit | 151cc755326098a26e1992c04eb7833d642a4a42 (patch) | |
tree | a11e016d7d2a8e51cd828bc717d76dd20a551f5c | |
parent | 1b249600e565d9b6bd28ecd6a743ebc425f02130 (diff) |
render serie via a separate block
-rw-r--r-- | frontend/frontend.go | 6 | ||||
-rw-r--r-- | public/serie.tmpl.html | 11 | ||||
-rw-r--r-- | public/submit-queue.tmpl.html | 10 |
3 files changed, 17 insertions, 10 deletions
diff --git a/frontend/frontend.go b/frontend/frontend.go index 7ed44efa591d..c7596ea326b0 100644 --- a/frontend/frontend.go +++ b/frontend/frontend.go @@ -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{ "series": submitQueue.Series, diff --git a/public/serie.tmpl.html b/public/serie.tmpl.html new file mode 100644 index 000000000000..7db666c173ec --- /dev/null +++ b/public/serie.tmpl.html @@ -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 }} \ No newline at end of file diff --git a/public/submit-queue.tmpl.html b/public/submit-queue.tmpl.html index 1a71f18d6c7c..c2eff3146637 100644 --- a/public/submit-queue.tmpl.html +++ b/public/submit-queue.tmpl.html @@ -67,15 +67,7 @@ </thead> <tbody> {{ range $serie := .series }} - <tr> - <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> + {{ block "serie" $serie }}{{ end }} {{ end }} </tbody> </table> |