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

brondsem 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 0eafcb18e [#8492] fix skills text, hide skills & socials if none
0eafcb18e is described below

commit 0eafcb18e469fa9c4d3e7116ec613e143aac8737
Author: Dave Brondsema <[email protected]>
AuthorDate: Tue Feb 7 12:50:16 2023 -0500

    [#8492] fix skills text, hide skills & socials if none
---
 Allura/allura/ext/user_profile/templates/sections/skills.html | 2 +-
 Allura/allura/ext/user_profile/user_main.py                   | 6 ++++++
 Allura/allura/nf/allura/css/site_style.css                    | 2 +-
 Allura/allura/tests/functional/test_user_profile.py           | 3 +--
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/Allura/allura/ext/user_profile/templates/sections/skills.html 
b/Allura/allura/ext/user_profile/templates/sections/skills.html
index 1905256a3..3e2000aa5 100644
--- a/Allura/allura/ext/user_profile/templates/sections/skills.html
+++ b/Allura/allura/ext/user_profile/templates/sections/skills.html
@@ -32,7 +32,7 @@
 
 {% 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>
+    <h4 id="widget-message">This is a list of skills that {{ 
user.get_pref('display_name') }} possesses:</h4>
     {% endif %}
     <ul>
     {% for skill in user.get_skills() %}
diff --git a/Allura/allura/ext/user_profile/user_main.py 
b/Allura/allura/ext/user_profile/user_main.py
index c9081618b..cf7840523 100644
--- a/Allura/allura/ext/user_profile/user_main.py
+++ b/Allura/allura/ext/user_profile/user_main.py
@@ -325,6 +325,9 @@ class SkillsSection(ProfileSectionBase):
     def __json__(self):
         return dict(skills=self.user.get_skills())
 
+    def check_display(self):
+        return bool(self.user.skills)
+
 
 class ToolsSection(ProfileSectionBase):
     template = 'allura.ext.user_profile:templates/sections/tools.html'
@@ -336,3 +339,6 @@ class SocialSection(ProfileSectionBase):
     def __json__(self):
         return dict(
             
socialnetworks=self.user.get_pref('socialnetworks')._deinstrument())
+
+    def check_display(self):
+        return bool(self.user.get_pref('socialnetworks'))
diff --git a/Allura/allura/nf/allura/css/site_style.css 
b/Allura/allura/nf/allura/css/site_style.css
index df53fb02a..48293e68e 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -3588,7 +3588,7 @@ ul.dropdown ul li:first-child a {
   margin: 0;
 }
 .profile-section.projects #widget-message{
-  padding: 10px;
+  padding: 0 10px 10px 10px;
 }
 .profile-section.projects ul li {
   clear: both;
diff --git a/Allura/allura/tests/functional/test_user_profile.py 
b/Allura/allura/tests/functional/test_user_profile.py
index 33502c783..9d9e205fb 100644
--- a/Allura/allura/tests/functional/test_user_profile.py
+++ b/Allura/allura/tests/functional/test_user_profile.py
@@ -79,8 +79,7 @@ class TestUserProfile(TestDiscussBase):
         assert 'Last Updated:' in r.html.find(None, 'projects').getText()
         assert 'tools' in sections
         assert 'Admin' in r.html.find(None, 'tools').getText()
-        assert 'skills' in sections
-        assert 'No skills entered' in r.html.find(None, 'skills').getText()
+        assert 'skills' not in sections
 
     @td.with_user_project('test-admin')
     @mock.patch.dict(tg.config, {'use_gravatar': 'true'})

Reply via email to