From 686c329615d1d1f68db79038c96e45cb80f098bb Mon Sep 17 00:00:00 2001 From: Timur Ismagilov Date: Sat, 2 Apr 2022 00:35:40 +0300 Subject: [PATCH] Categories, views: Give the card view its own file, make title a block --- categories/categories.html | 38 -------------------------- categories/view_card.html | 35 ++++++++++++++++++++++++ categories/view_list.html | 3 +- categories/view_page.html | 1 + categories/views.go | 56 ++++++++++---------------------------- viewutil/base.html | 2 +- viewutil/viewutil.go | 7 +++-- 7 files changed, 58 insertions(+), 84 deletions(-) delete mode 100644 categories/categories.html create mode 100644 categories/view_card.html diff --git a/categories/categories.html b/categories/categories.html deleted file mode 100644 index ea099c9..0000000 --- a/categories/categories.html +++ /dev/null @@ -1,38 +0,0 @@ -{{define "category x"}}Category {{. | beautifulName}}{{end}} -{{define "category list heading"}}Category list{{end}} - -{{define "category card"}} -{{$hyphaName := .HyphaName}} -{{$givenPermission := .GivenPermissionToModify}} - -{{end}} \ No newline at end of file diff --git a/categories/view_card.html b/categories/view_card.html new file mode 100644 index 0000000..1f145c2 --- /dev/null +++ b/categories/view_card.html @@ -0,0 +1,35 @@ +{{define "category card"}} + {{$hyphaName := .HyphaName}} + {{$givenPermission := .GivenPermissionToModify}} + +{{end}} \ No newline at end of file diff --git a/categories/view_list.html b/categories/view_list.html index 8cd79da..fdd21db 100644 --- a/categories/view_list.html +++ b/categories/view_list.html @@ -1,6 +1,7 @@ +{{define "title"}}Category list{{end}} {{define "body"}}
-

{{block `category list heading` .}}Category list{{end}}

+

{{template "title"}}

{{if len .Categories}}