From 35934c04f0bc461588cb24d29914de8fd42e26c3 Mon Sep 17 00:00:00 2001 From: Yanislav Igonin Date: Tue, 5 Oct 2021 21:46:17 +0300 Subject: [PATCH] refactoring: make separate files for embeded templates --- templates/index.html | 2 +- templates/meta-tags-dynamic.html | 22 ++++++ templates/meta-tags-static.html | 22 ++++++ templates/post-form.html | 48 +++++++++++++ templates/static.html | 18 +++++ templates/templates.html | 113 ------------------------------- templates/thread.html | 2 +- 7 files changed, 112 insertions(+), 115 deletions(-) create mode 100644 templates/meta-tags-dynamic.html create mode 100644 templates/meta-tags-static.html create mode 100644 templates/post-form.html create mode 100644 templates/static.html delete mode 100644 templates/templates.html diff --git a/templates/index.html b/templates/index.html index 01a2997..a054eaf 100644 --- a/templates/index.html +++ b/templates/index.html @@ -6,7 +6,7 @@ rel="stylesheet" > - {{ template "static-meta" }} + {{ template "meta-tags-static" }} diff --git a/templates/meta-tags-dynamic.html b/templates/meta-tags-dynamic.html new file mode 100644 index 0000000..672e6dc --- /dev/null +++ b/templates/meta-tags-dynamic.html @@ -0,0 +1,22 @@ +{{ define "meta-tags-dynamic" }} +{{ .Title }} + + + + + + + + + + + + + + + + + + + +{{ end }} \ No newline at end of file diff --git a/templates/meta-tags-static.html b/templates/meta-tags-static.html new file mode 100644 index 0000000..25d2fed --- /dev/null +++ b/templates/meta-tags-static.html @@ -0,0 +1,22 @@ +{{ define "meta-tags-static" }} +Micrach + + + + + + + + + + + + + + + + + + + +{{ end }} \ No newline at end of file diff --git a/templates/post-form.html b/templates/post-form.html new file mode 100644 index 0000000..6990d21 --- /dev/null +++ b/templates/post-form.html @@ -0,0 +1,48 @@ +{{ define "post-form" }} +
+ +
+ {{ if eq .FirstPostID 0 }} +
+ {{ else }} + + {{ end }} + + {{ if eq .FirstPostID 0 }} + + {{ end }} + + + + +
+ Captcha +
+ + + +
+ {{ if ne .FirstPostID 0 }} +
+ + +
+ {{ end }} + +
+ +
+
+
+
+ +
+{{ end }} diff --git a/templates/static.html b/templates/static.html new file mode 100644 index 0000000..43f8de6 --- /dev/null +++ b/templates/static.html @@ -0,0 +1,18 @@ +{{ define "static" }} + + + + +{{ end }} diff --git a/templates/templates.html b/templates/templates.html deleted file mode 100644 index 4d1c23f..0000000 --- a/templates/templates.html +++ /dev/null @@ -1,113 +0,0 @@ -{{ define "static" }} - - - - -{{ end }} - -{{ define "meta" }} - {{ .Title }} - - - - - - - - - - - - - - - - - - - -{{ end }} - -{{ define "static-meta" }} - Micrach - - - - - - - - - - - - - - - - - - - -{{ end }} - -{{ define "post-form" }} -
- -
- {{ if eq .FirstPostID 0 }} -
- {{ else }} - - {{ end }} - - {{ if eq .FirstPostID 0 }} - - {{ end }} - - - - -
- Captcha -
- - - -
- {{ if ne .FirstPostID 0 }} -
- - -
- {{ end }} - -
- -
-
-
-
- -
-{{ end }} \ No newline at end of file diff --git a/templates/thread.html b/templates/thread.html index d8b645f..ee59650 100644 --- a/templates/thread.html +++ b/templates/thread.html @@ -3,7 +3,7 @@ {{ template "static" }} - {{ template "meta" $FirstPost }} + {{ template "meta-tags-dynamic" $FirstPost }}