From 3ea515dbb11b86a7e504f51ace68cfec6b885ff0 Mon Sep 17 00:00:00 2001 From: Lova ANDRIARIMALALA <43842786+Xpirix@users.noreply.github.com> Date: Mon, 20 Nov 2023 11:27:12 +0300 Subject: [PATCH] Specify tag page title and other plugin page title (#308) --- qgis-app/plugins/templatetags/plugin_utils.py | 5 +++++ qgis-app/plugins/views.py | 1 + 2 files changed, 6 insertions(+) diff --git a/qgis-app/plugins/templatetags/plugin_utils.py b/qgis-app/plugins/templatetags/plugin_utils.py index 22ef9ccb..9eb8fbec 100755 --- a/qgis-app/plugins/templatetags/plugin_utils.py +++ b/qgis-app/plugins/templatetags/plugin_utils.py @@ -12,10 +12,15 @@ def klass(ob): def plugin_title(context): """Returns plugin name for title""" title = "" + + if "title" in context: + title = context["title"] if "plugin" in context: title = context["plugin"].name if "version" in context: title = "{plugin} {version}".format( plugin=context["version"].plugin.name, version=context["version"].version ) + if "page_title" in context: + title = context["page_title"] return title diff --git a/qgis-app/plugins/views.py b/qgis-app/plugins/views.py index 3e753ac6..f531a928 100644 --- a/qgis-app/plugins/views.py +++ b/qgis-app/plugins/views.py @@ -725,6 +725,7 @@ def get_context_data(self, **kwargs): context.update( { "title": _("Plugins tagged with: %s") % unquote(self.kwargs["tags"]), + "page_title": _("Tag: %s") % unquote(self.kwargs["tags"]) } ) return context