This is an automated email from the ASF dual-hosted git repository. gcruz pushed a commit to branch gc/8492 in repository https://gitbox.apache.org/repos/asf/allura.git
commit 1402e91d4f7ae21e94af6a888c3496a0aea3a6ba Author: Guillermo Cruz <[email protected]> AuthorDate: Wed Jan 18 16:50:41 2023 -0600 [#8492] updated login on user profile to require projects and activity to be present before removing the noindex attr from the robots meta tag --- Allura/allura/ext/user_profile/templates/sections/projects.html | 4 ++++ Allura/allura/ext/user_profile/templates/sections/skills.html | 3 +++ Allura/allura/ext/user_profile/user_main.py | 8 ++++++-- Allura/allura/nf/allura/css/site_style.css | 3 +++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Allura/allura/ext/user_profile/templates/sections/projects.html b/Allura/allura/ext/user_profile/templates/sections/projects.html index bee6552e9..06c940709 100644 --- a/Allura/allura/ext/user_profile/templates/sections/projects.html +++ b/Allura/allura/ext/user_profile/templates/sections/projects.html @@ -33,6 +33,9 @@ {% block section_class %}projects{% endblock %} {% block content %} + {% if projects|length %} + <h4 id="widget-message">This is a list of open source software projects that {{ c.user.get_pref('display_name') }} is associated with:</h4> + {% endif %} <ul> {% for project in projects %} <li{% if loop.index > 5 %} class="hidden"{% endif %}> @@ -63,4 +66,5 @@ </button> </div> {% endif %} + {% endblock %} diff --git a/Allura/allura/ext/user_profile/templates/sections/skills.html b/Allura/allura/ext/user_profile/templates/sections/skills.html index 966ce0aba..1905256a3 100644 --- a/Allura/allura/ext/user_profile/templates/sections/skills.html +++ b/Allura/allura/ext/user_profile/templates/sections/skills.html @@ -31,6 +31,9 @@ {% block section_class %}skills{% endblock %} {% block content %} + {% if user.get_skills()|length %} + <h4 id="widget-message">This is a list of open source software projects that {{ c.user.get_pref('display_name') }} is associated with:</h4> + {% endif %} <ul> {% for skill in user.get_skills() %} <li>{{ skill.skill.fullname }}</li> diff --git a/Allura/allura/ext/user_profile/user_main.py b/Allura/allura/ext/user_profile/user_main.py index c23e481e3..6df361c07 100644 --- a/Allura/allura/ext/user_profile/user_main.py +++ b/Allura/allura/ext/user_profile/user_main.py @@ -156,10 +156,14 @@ class UserProfileController(BaseController, FeedController): for section in c.app.profile_sections] noindex = True + required_section = 2 + count = 0 for s in sections: s.setup_context() - if s.context.get('projects') or s.context.get('timeline'): - noindex = False + if s.context.get('timeline') or s.context.get('projects'): + count += 1 + if count == required_section: + noindex = False return dict( user=user, reg_date=provider.user_registration_date(user), diff --git a/Allura/allura/nf/allura/css/site_style.css b/Allura/allura/nf/allura/css/site_style.css index 087d7b14d..df53fb02a 100644 --- a/Allura/allura/nf/allura/css/site_style.css +++ b/Allura/allura/nf/allura/css/site_style.css @@ -3587,6 +3587,9 @@ ul.dropdown ul li:first-child a { list-style: none; margin: 0; } +.profile-section.projects #widget-message{ + padding: 10px; +} .profile-section.projects ul li { clear: both; border-top: 1px solid #e5e5e5;
