From 64e143f948d9176106d2103ee9c813b20c516e25 Mon Sep 17 00:00:00 2001 From: Ryan Lerch Date: Sep 13 2018 03:24:44 +0000 Subject: introduce the browseheader_message macro Introduces a new macro for themes, the browseheader_message. This allows a theme to define the message that is shown on the browse pages. In the default theme, this message was and is only shown on the browse projects. This also updates the srcfpo theme to use this new macro, and remove the overridden template that was being used to do this. Fixes #3617 --- diff --git a/doc/usage/theming.rst b/doc/usage/theming.rst index 8bbe4b3..ab805bc 100644 --- a/doc/usage/theming.rst +++ b/doc/usage/theming.rst @@ -113,6 +113,30 @@ this needs to be included in this macro in your theme. Example: {% endmacro %} +`browseheader_message(select)` macro +###################### + +An optional Jinja macro that defines the welcome message that is shown +above the tabs on the Browse Pages (Projects, Users, and Groups). The +select parameter is a string with the name of the page being shown +Example: + +:: + + {% macro browseheader_message(select) %} + {% if select == 'projects' %} +
+
+
+

Welcome to my Pagure

+

Pagure is an Open Source software code hosting system.

+
+
+
+ {% endif %} + {% endmacro %} + + `footer()` macro ###################### diff --git a/pagure/templates/_browseheader.html b/pagure/templates/_browseheader.html index fb0ce79..a984238 100644 --- a/pagure/templates/_browseheader.html +++ b/pagure/templates/_browseheader.html @@ -1,15 +1,9 @@ +{% import "theme.html" as theme with context %} + {% macro browse_header(select) -%} -{% if select == 'projects' %} -
-
-
-

Welcome to Pagure

-

Pagure is an Open Source software code hosting system.

-
-
-
-{% endif %} +{{ theme.browseheader_message(select) if theme.browseheader_message is defined }} +