From e6a03813d463bc0c624a3c40fb615cacc006e265 Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Fri, 7 Sep 2018 04:59:06 +0200 Subject: [PATCH] Extract header and footer content to separate tmpl (#4797) 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 26ba3421fd..0dd8871525 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 0000000000..eb050cc58a --- /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 65eec65e59..b6ab8141e2 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 0000000000..08db199cf1 --- /dev/null +++ b/templates/base/head_navbar.tmpl @@ -0,0 +1,134 @@ +