|
From: Mercurial C. <th...@in...> - 2026-05-17 06:27:55
|
# HG changeset patch
# User John Rouillard <ro...@ie...>
# Date 1778982438 14400
# Sat May 16 21:47:18 2026 -0400
# Node ID d681fce4c3789b28a31f109b47aa462c58acfe28
# Parent 9a2845390354bf41b984337ccf21747d9bdb54b4
bug: queries triggered from query edit page missing query name
The query edit page is used to editing the queries listed in the main
menu's "Your Queries" section. However it also allows you to execute
all available queries.
However when these queries are executed, they query name is not
included. This patch fixes that.
Also it improves the jinja2 template to display the query name which
didn't work even when the query was done from the main menu.
The jinja code works in manual testing. I verified that & and <> etc
are escaped properly in the URL as well as in the html with the
classic and jinja2 trackers.
diff -r 9a2845390354 -r d681fce4c378 CHANGES.txt
--- a/CHANGES.txt Wed May 13 21:40:51 2026 -0400
+++ b/CHANGES.txt Sat May 16 21:47:18 2026 -0400
@@ -93,6 +93,9 @@
without further info. Added more specific ConnectionAbortedError
and changed IOError handling. Case in issue now logs the exception
for diagnosis.
+- Make queries selected from query edit screen include the query
+ name/display name. This makes it work the same as invoking a query
+ from the main "Your Queries" menu. (John Rouillard)
Features:
diff -r 9a2845390354 -r d681fce4c378 doc/upgrading.txt
--- a/doc/upgrading.txt Wed May 13 21:40:51 2026 -0400
+++ b/doc/upgrading.txt Sat May 16 21:47:18 2026 -0400
@@ -365,6 +365,62 @@
Additional details can be found in the :ref:`nonceless CSRF` section of
the reference guide.
+Make Query Edit Page Queries Display Query Name (optional)
+----------------------------------------------------------
+
+When queries are started from the main ``Your Queries`` menu section,
+the window shows the query name for TAL based trackers. Users can
+pick which queries/searches appear in the main menu's ``Your Queries``
+section by clicking the ``edit`` link to go to the edit screen. The
+``edit`` screen also lets users run the queries that aren't in the
+main section.
+
+Before this update, the query name wasn't shown when running queries
+from the ``edit`` screen. This update fixes that for all the included
+templates. It also makes the jinja2 issue index template show the
+query name.
+
+You can add this to your tracker. If you are not using a jinja2 based
+tracker, open your tracker's ``html/query.edit.html`` file. Find and
+change the line that includes::
+
+ <a tal:attributes="href string:${query/klass}?${query/url}"
+
+to look like::
+
+ <a tal:attributes="href string:${query/klass}?${query/url}&@dispname=${query/name/url_quote}"
+
+If you are using the jinja2 template, a similar change is needed to
+``html/query.edit.html`` replacing::
+
+ <a href="{{ query.klass.plain()|u }}?{{ query.url.plain()|u }}">{{ query.name.plain() }}</a>
+
+with::
+
+ <a href="{{ query.klass.plain()|u }}?{{ query.url.plain()|u }}&@dispname={{ query.name.url_quote()|u }}">{{ query.name.plain() }}</a>
+
+Then in the ``html/issue.index.html`` you will add::
+
+ {% if request.form['@dispname'] %}
+ - {{ request.form['@dispname'].value|u }}
+ {% endif %}
+
+to the ``head_title`` and ``page_header`` blocks so they look like::
+
+ {% block head_title %}
+ {% trans %}List of issues{% endtrans %}
+ {% if request.form['@dispname'] %}
+ - {{ request.form['@dispname'].value|u }}
+ {% endif %}
+ {% endblock %}
+
+ {% block page_header %}
+ {% trans %}List of issues{% endtrans %}
+ {% if request.form['@dispname'] %}
+ - {{ request.form['@dispname'].value|u }}
+ {% endif %}
+ {% endblock %}
+
.. index:: Upgrading; 2.4.0 to 2.5.0
Migrating from 2.4.0 to 2.5.0
diff -r 9a2845390354 -r d681fce4c378 share/roundup/templates/classic/html/query.edit.html
--- a/share/roundup/templates/classic/html/query.edit.html Wed May 13 21:40:51 2026 -0400
+++ b/share/roundup/templates/classic/html/query.edit.html Sat May 16 21:47:18 2026 -0400
@@ -68,8 +68,8 @@
<tr tal:define="queries python:db.query.filter(filterspec={'creator': uid})"
tal:repeat="query queries">
<tal:block>
- <td><a tal:attributes="href string:${query/klass}?${query/url}"
- tal:content="query/name">query</a></td>
+ <td><a tal:attributes="href string:${query/klass}?${query/url}&@dispname=${query/name/url_quote}"
+ tal:content="query/name">query</a></td>
<td metal:define-macro="include">
<select tal:condition="python:query.id not in mine"
diff -r 9a2845390354 -r d681fce4c378 share/roundup/templates/devel/html/query.edit.html
--- a/share/roundup/templates/devel/html/query.edit.html Wed May 13 21:40:51 2026 -0400
+++ b/share/roundup/templates/devel/html/query.edit.html Sat May 16 21:47:18 2026 -0400
@@ -67,8 +67,8 @@
<tr tal:repeat="query mine">
<tal:block condition="query/is_retired">
- <td><a tal:attributes="href string:${query/klass}?${query/url}"
- tal:content="query/name">query</a></td>
+ <td><a tal:attributes="href string:${query/klass}?${query/url}&@dispname=${query/name/url_quote}"
+ tal:content="query/name">query</a></td>
<td metal:define-macro="include">
<select tal:condition="python:query.id not in mine"
diff -r 9a2845390354 -r d681fce4c378 share/roundup/templates/jinja2/html/issue.index.html
--- a/share/roundup/templates/jinja2/html/issue.index.html Wed May 13 21:40:51 2026 -0400
+++ b/share/roundup/templates/jinja2/html/issue.index.html Sat May 16 21:47:18 2026 -0400
@@ -2,10 +2,16 @@
{% block head_title %}
{% trans %}List of issues{% endtrans %}
+ {% if request.form['@dispname'] %}
+ - {{ request.form['@dispname'].value|u }}
+ {% endif %}
{% endblock %}
{% block page_header %}
{% trans %}List of issues{% endtrans %}
+ {% if request.form['@dispname'] %}
+ - {{ request.form['@dispname'].value|u }}
+ {% endif %}
{% endblock %}
{% block content %}
@@ -108,3 +114,4 @@
{% endif %}
{% endblock %}
+<!-- SHA: 6d38a513a175e5167c501d47dbb7528617df4bca -->
diff -r 9a2845390354 -r d681fce4c378 share/roundup/templates/jinja2/html/query.edit.html
--- a/share/roundup/templates/jinja2/html/query.edit.html Wed May 13 21:40:51 2026 -0400
+++ b/share/roundup/templates/jinja2/html/query.edit.html Sat May 16 21:47:18 2026 -0400
@@ -93,7 +93,7 @@
{% for query in queries %}
<tr>
<td>
- <a href="{{ query.klass.plain()|u }}?{{ query.url.plain()|u }}">{{ query.name.plain() }}</a>
+ <a href="{{ query.klass.plain()|u }}?{{ query.url.plain()|u }}&@dispname={{ query.name.url_quote()|u }}">{{ query.name.plain() }}</a>
</td>
{{ include_query(query) }}
diff -r 9a2845390354 -r d681fce4c378 share/roundup/templates/responsive/html/query.edit.html
--- a/share/roundup/templates/responsive/html/query.edit.html Wed May 13 21:40:51 2026 -0400
+++ b/share/roundup/templates/responsive/html/query.edit.html Sat May 16 21:47:18 2026 -0400
@@ -67,8 +67,8 @@
<tr tal:repeat="query mine">
<tal:block condition="query/is_retired">
- <td><a tal:attributes="href string:${query/klass}?${query/url}"
- tal:content="query/name">query</a></td>
+ <td><a tal:attributes="href string:${query/klass}?${query/url}&@dispname=${query/name/url_quote}"
+ tal:content="query/name">query</a></td>
<td metal:define-macro="include">
<select tal:condition="python:query.id not in mine"
|