This is an automated email from the ASF dual-hosted git repository. gcruz pushed a commit to branch gc/8446 in repository https://gitbox.apache.org/repos/asf/allura.git
commit a3f3566c4fce2707d103b7579d8b530fb63b8cbe Author: Guillermo Cruz <[email protected]> AuthorDate: Mon Jul 18 08:50:54 2022 -0600 [#8446] fixed tooltip loading for profile links, converted new setting to boolean --- Allura/allura/controllers/project.py | 2 +- Allura/allura/lib/app_globals.py | 2 +- Allura/allura/public/nf/js/allura-base.js | 2 +- Allura/allura/templates/jinja_master/lib.html | 6 +++--- Allura/allura/templates/macro/members.html | 2 +- Allura/allura/templates/members.html | 2 +- Allura/allura/templates/repo/merge_requests.html | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py index 827c58bd9..2ab8591bf 100644 --- a/Allura/allura/controllers/project.py +++ b/Allura/allura/controllers/project.py @@ -401,7 +401,7 @@ class ProjectController(FeedController): if mount is not None: if hasattr(app, 'default_redirect'): app.default_redirect() - redirect(app.url() if callable(app.url) else app.url) # Application has property; Subproject has method + redirect(app.url() if callable(app.url) else app.url, redirect_with=exc.HTTPMovedPermanently) # Application has property; Subproject has method else: redirect(c.project.app_configs[0].url()) diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py index 7517cb6a5..6f8c642a7 100644 --- a/Allura/allura/lib/app_globals.py +++ b/Allura/allura/lib/app_globals.py @@ -581,7 +581,7 @@ class Globals: @property def user_profile_urls_with_profile_path(self): - return config['user_profile_url_with_profile_path'] + return asbool(config['user_profile_url_with_profile_path']) def app_static(self, resource, app=None): base = config['static.url_base'] diff --git a/Allura/allura/public/nf/js/allura-base.js b/Allura/allura/public/nf/js/allura-base.js index a4031d602..6d0171eb6 100644 --- a/Allura/allura/public/nf/js/allura-base.js +++ b/Allura/allura/public/nf/js/allura-base.js @@ -297,7 +297,7 @@ $(function(){ // load from cache } else { - $.get(userUrl + 'profile/user_card', function(data) { + $.get(userUrl + 'user_card', function(data) { displayUserCard(instance, data); umProfileStore[userUrl] = data; }); diff --git a/Allura/allura/templates/jinja_master/lib.html b/Allura/allura/templates/jinja_master/lib.html index 3aa3366ca..0af3f490e 100644 --- a/Allura/allura/templates/jinja_master/lib.html +++ b/Allura/allura/templates/jinja_master/lib.html @@ -109,11 +109,11 @@ {% endif %} {%- endmacro %} -{% macro user_link(user, avatar=False, size=16) -%} +{% macro user_link(user, avatar=False, size=16, nofollow=False) -%} {% if user %} {% if not user.is_anonymous() %} - {% set profile_path = user.url() + 'profile/' if g.user_profile_urls_with_profile_path == 'true' else user.url() %} - <a href="{{profile_path}}" class="user-mention"> + {% set profile_path = user.url() + 'profile/' if g.user_profile_urls_with_profile_path else user.url() %} + <a href="{{profile_path}}" class="user-mention" {% if nofollow %}rel="nofollow" {% endif %}> {% if avatar %} {{ gravatar_or_name(user, size) }} {% else %} diff --git a/Allura/allura/templates/macro/members.html b/Allura/allura/templates/macro/members.html index a3e3db472..8f7a874e5 100644 --- a/Allura/allura/templates/macro/members.html +++ b/Allura/allura/templates/macro/members.html @@ -18,7 +18,7 @@ -#} <h6>Project Members:</h6> <ul class="md-users-list"> - {% set profile_path = 'profile/' if g.user_profile_urls_with_profile_path == 'true' else '' %} + {% set profile_path = 'profile/' if g.user_profile_urls_with_profile_path else '' %} {% for user in users -%} <li><a href="{{ user.url ~ profile_path}}">{{user.name}}</a>{{user.admin}}</li> {%- endfor %} diff --git a/Allura/allura/templates/members.html b/Allura/allura/templates/members.html index 8088eb999..a7afb6490 100644 --- a/Allura/allura/templates/members.html +++ b/Allura/allura/templates/members.html @@ -18,7 +18,7 @@ -#} {% set hide_left_bar = True %} {% set h1_text = c.project.name ~ ' ' ~ 'Project' ~ ' ' ~ 'Member List' %} -{% set profile_path = 'profile/' if g.user_profile_urls_with_profile_path == 'true' else '' %} +{% set profile_path = 'profile/' if g.user_profile_urls_with_profile_path else '' %} {% extends g.theme.master %} {% block title %}{{ h1_text }}{% endblock %} {% block header %}Members{% endblock %} diff --git a/Allura/allura/templates/repo/merge_requests.html b/Allura/allura/templates/repo/merge_requests.html index 8deeb118d..04acb7e11 100644 --- a/Allura/allura/templates/repo/merge_requests.html +++ b/Allura/allura/templates/repo/merge_requests.html @@ -19,7 +19,7 @@ {% extends 'allura:templates/repo/repo_master.html' %} {% import 'allura:templates/jinja_master/lib.html' as lib with context %} {% set status = request.params.get('status' , '') %} -{% set profile_path = 'profile/' if g.user_profile_urls_with_profile_path == 'true' else '' %} + {% block title %} {{c.project.name}} / {{c.app.config.options.mount_label}} / Merge Requests {% endblock %} @@ -61,7 +61,7 @@ {% else %} <i>(deleted)</i> {% endif %}</td> - <td><a href="{{req.creator_url ~ profile_path}}" rel="nofollow">{{req.creator_name}}</a></td> + <td> {{ lib.user_link(req.creator,nofollow=True) }}</td> <td>{{lib.abbr_date(req.created)}}</td> <td>{{lib.abbr_date(req.mod_date)}}</td> </tr>
