From 45c264f681e3f7e1a22a191029836a690959aac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Gonz=C3=A1lez=20Palomo?= Date: Wed, 10 Jan 2018 07:19:50 +0100 Subject: [PATCH] Templates for extra links in top navbar and repo tool tabs. (#3308) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These templates add content to the top navbar and to the repository page. This way we do not have to copy and modify the whole template, and re-modify it after upgrading Gitea if it changes. Signed-off-by: Alberto González Palomo --- docs/content/doc/advanced/customizing-gitea.en-us.md | 2 ++ templates/base/head.tmpl | 3 +++ templates/custom/extra_links.tmpl | 0 templates/custom/extra_tabs.tmpl | 0 templates/repo/header.tmpl | 2 ++ 5 files changed, 7 insertions(+) create mode 100644 templates/custom/extra_links.tmpl create mode 100644 templates/custom/extra_tabs.tmpl diff --git a/docs/content/doc/advanced/customizing-gitea.en-us.md b/docs/content/doc/advanced/customizing-gitea.en-us.md index 5be30740c..55e47d020 100644 --- a/docs/content/doc/advanced/customizing-gitea.en-us.md +++ b/docs/content/doc/advanced/customizing-gitea.en-us.md @@ -66,6 +66,8 @@ To add custom HTML to the header or the footer of the page, in the `templates/cu directory there is `header.tmpl` and `footer.tmpl` that can be modified. This can be a useful place to add custom CSS files or additional Javascript. +If all you want is to add extra links to the top navigation bar, or extra tabs to the repository view, you can put them in `extra_links.tmpl` and `extra_tabs.tmpl` inside your `custom/templates/custom/` directory. + ## Customizing gitignores, labels, licenses, locales, and readmes. Place custom files in corresponding sub-folder under `custom/options`. diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index 04c5a43e4..a486d9b9b 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -158,6 +158,9 @@ {{end}} {{.i18n.Tr "explore"}} + + {{template "custom/extra_links" .}} + {{/*
diff --git a/templates/custom/extra_links.tmpl b/templates/custom/extra_links.tmpl new file mode 100644 index 000000000..e69de29bb diff --git a/templates/custom/extra_tabs.tmpl b/templates/custom/extra_tabs.tmpl new file mode 100644 index 000000000..e69de29bb diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index c83505ac9..db5b6c7f0 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -89,6 +89,8 @@ {{end}} + {{template "custom/extra_tabs" .}} + {{if .IsRepositoryAdmin}}