You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2021/08/31 16:16:38 UTC

[allura] branch master updated: fixed url param values in comment link

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 a7a400f  fixed url param values in comment link
a7a400f is described below

commit a7a400fb415e8a117ecf77fd970ea92b510105c6
Author: Guillermo Cruz <gu...@slashdotmedia.com>
AuthorDate: Mon Aug 30 15:51:59 2021 -0600

    fixed url param values in comment link
---
 Allura/allura/lib/helpers.py                     |  1 +
 Allura/allura/templates/widgets/post_widget.html | 11 ++++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py
index 3e6f15d..94f7713 100644
--- a/Allura/allura/lib/helpers.py
+++ b/Allura/allura/lib/helpers.py
@@ -44,6 +44,7 @@ from functools import partial
 from io import BytesIO
 import cgi
 
+
 # https://forge-allura.apache.org/p/allura/tickets/8386/
 # we don't want to depend on LGPL'd chardet, but the requests library needs it
 # so if we can't import it, we'll make it exist as a copy of cchardet
diff --git a/Allura/allura/templates/widgets/post_widget.html b/Allura/allura/templates/widgets/post_widget.html
index 8fc7c24..f8f65f3 100644
--- a/Allura/allura/templates/widgets/post_widget.html
+++ b/Allura/allura/templates/widgets/post_widget.html
@@ -19,11 +19,16 @@
 {% import 'allura:templates/jinja_master/lib.html' as lib with context %}
 {% set page = request.params.get('page','0') %}
 {% set limit = request.params.get('limit','0') %}
-{% set params = '' %}
+{% set params_dict = {} %}
 {% if page != '0' %}
-    {% set params = '?page={}&limit={}'.format(page, limit) %}
+    {% do params_dict.update({'page': page}) %}
 {% endif %}
-{% set shortlink_url = h.absurl(request.path + params + '#' + value.slug) %}
+{%  if limit != '0' %}
+    {% do params_dict.update({'limit': limit}) %}
+{%  endif %}
+
+
+{% set shortlink_url = h.absurl(tg.url(request.path , params_dict) + '#' + value.slug) %}
 
 <div>
   <div id="{{value.slug}}" class="discussion-post{%if value.is_meta %} meta_post{% endif %}">