From b921f2b3ecdaa9423cdf502f1e6a3b62058d51f4 Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Sun, 26 Aug 2018 15:57:58 +0200 Subject: [PATCH] Extract header and footer content to separate tmpl This change makes it easier to customize the header and footer content. Before this change, the whole header and footer had to be overridden, including the meta, style and script tags. Signed-off-by: Lukas Bestle --- templates/base/footer.tmpl | 27 +----- templates/base/footer_content.tmpl | 25 ++++++ templates/base/head.tmpl | 135 +---------------------------- templates/base/head_navbar.tmpl | 134 ++++++++++++++++++++++++++++ 4 files changed, 162 insertions(+), 159 deletions(-) create mode 100644 templates/base/footer_content.tmpl create mode 100644 templates/base/head_navbar.tmpl diff --git a/templates/base/footer.tmpl b/templates/base/footer.tmpl index 26ba3421fdd77..0dd8871525c6d 100644 --- a/templates/base/footer.tmpl +++ b/templates/base/footer.tmpl @@ -10,31 +10,8 @@ {{template "custom/body_outer_post" .}} -
-
-
- © Gitea {{if (or .ShowFooterVersion .PageIsAdmin)}}{{.i18n.Tr "version"}}: {{AppVer}}{{end}} {{if ShowFooterTemplateLoadTime}}{{.i18n.Tr "page"}}: {{LoadTimes .PageStartTime}} {{.i18n.Tr "template"}}: {{call .TmplLoadTimes}}{{end}} -
- -
-
+ {{template "base/footer_content" .}} + {{if .RequireSimpleMDE}} diff --git a/templates/base/footer_content.tmpl b/templates/base/footer_content.tmpl new file mode 100644 index 0000000000000..eb050cc58ade0 --- /dev/null +++ b/templates/base/footer_content.tmpl @@ -0,0 +1,25 @@ +
+
+
+ © Gitea {{if (or .ShowFooterVersion .PageIsAdmin)}}{{.i18n.Tr "version"}}: {{AppVer}}{{end}} {{if ShowFooterTemplateLoadTime}}{{.i18n.Tr "page"}}: {{LoadTimes .PageStartTime}} {{.i18n.Tr "template"}}: {{call .TmplLoadTimes}}{{end}} +
+ +
+
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index 65eec65e591e9..b6ab8141e2a12 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -142,140 +142,7 @@ {{if not .PageIsInstall}} {{end}} {{/* diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl new file mode 100644 index 0000000000000..08db199cf157a --- /dev/null +++ b/templates/base/head_navbar.tmpl @@ -0,0 +1,134 @@ +