From 48b2c53ffb71cce1fe572cdbf84f2f949867e1e1 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sep 19 2018 11:56:34 +0000 Subject: Add a link to the group when viewing a namespace When viewing projects of a namespace, it is nice to be able to access quickly the group which is underneath this namespace (assuming there is one, ie that the namespace isn't in the list of allowed_prefix). Fixes https://pagure.io/pagure/issue/3582 Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/templates/index.html b/pagure/templates/index.html index 176b950..98bf911 100644 --- a/pagure/templates/index.html +++ b/pagure/templates/index.html @@ -18,6 +18,16 @@ {{ browse_header(select=select) }} + {% if namespace %} +
+

+ These projects are under the `{{ namespace }}` namespace making them + likely related to the {{ namespace }} + group. +

+
+ {% endif %}
{{ render_repos( repos, total_page, 'page', page, diff --git a/pagure/ui/app.py b/pagure/ui/app.py index 4639798..77001a8 100644 --- a/pagure/ui/app.py +++ b/pagure/ui/app.py @@ -633,8 +633,12 @@ def view_projects(pattern=None, namespace=None): total_page = int(ceil(projects_length / float(limit))) + if namespace in pagure_config["ALLOWED_PREFIX"]: + namespace = None + return flask.render_template( "index.html", + namespace=namespace, repos=projects, repos_length=projects_length, total_page=total_page,