You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by di...@apache.org on 2021/08/17 19:21:01 UTC

[allura] branch master updated: Fix SitemapEntry html attrs being skipped/clobbered in a few places

This is an automated email from the ASF dual-hosted git repository.

dill0wn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git


The following commit(s) were added to refs/heads/master by this push:
     new db986f4  Fix SitemapEntry html attrs being skipped/clobbered in a few places
db986f4 is described below

commit db986f493209b47dc85a7c35243e329da46a7aaa
Author: Dave Brondsema <db...@slashdotmedia.com>
AuthorDate: Wed Aug 11 14:58:22 2021 -0400

    Fix SitemapEntry html attrs being skipped/clobbered in a few places
---
 Allura/allura/app.py                                         | 1 +
 Allura/allura/model/project.py                               | 2 +-
 Allura/allura/templates_responsive/jinja_master/top_nav.html | 4 ++--
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index fdd1fca..9d57e17 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -176,6 +176,7 @@ class SitemapEntry(object):
                             tool_name=self.tool_name,
                             matching_urls=self.matching_urls,
                             mount_point=app.config.options.mount_point,
+                            extra_html_attrs=self.extra_html_attrs,
                             )
 
     def extend(self, sitemap_entries):
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 1ce3e9d..49af70a 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -609,7 +609,7 @@ class Project(SearchIndexable, MappedClass, ActivityNode, ActivityObject):
                     entry.tool_name = ac.tool_name
                     entry.ui_icon = 'tool-%s' % entry.tool_name.lower()
                     if is_nofollow_url(entry.url):
-                        entry.extra_html_attrs = {'rel': 'nofollow'}
+                        entry.extra_html_attrs.update({'rel': 'nofollow'})
                     if not self.is_nbhd_project and (entry.tool_name.lower() in list(anchored_tools.keys())):
                         ordinal = list(anchored_tools.keys()).index(
                             entry.tool_name.lower())
diff --git a/Allura/allura/templates_responsive/jinja_master/top_nav.html b/Allura/allura/templates_responsive/jinja_master/top_nav.html
index b010df1..14ed6d4 100644
--- a/Allura/allura/templates_responsive/jinja_master/top_nav.html
+++ b/Allura/allura/templates_responsive/jinja_master/top_nav.html
@@ -22,14 +22,14 @@
   {% set navbar_entries = c.project.grouped_navbar_entries() %}
   {% for s in navbar_entries %}
     <li class="{% if s.matches_url(request) %}selected{% endif %}">
-        <a href="{{s.url}}" class="tool-{{(s.tool_name or 'admin').lower()}}-32">
+        <a href="{{s.url}}" class="tool-{{(s.tool_name or 'admin').lower()}}-32" {{ s.extra_html_attrs|xmlattr }}>
             {{s.label}}
         </a>
         {% set grouped_tool_count = s.matching_urls|length %}
         {% if grouped_tool_count %}
             <ul>
                 {%for tool in s.children%}
-                    <li class="{% if tool.matches_url(request) %}selected{% endif %}"><a href="{{tool.url}}">{{tool.label}}</a></li>
+                    <li class="{% if tool.matches_url(request) %}selected{% endif %}"><a href="{{tool.url}}" {{ tool.extra_html_attrs|xmlattr }}>{{tool.label}}</a></li>
                 {%endfor%}
             </ul>
         {% endif %}