incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [2/3] git commit: [#4227][#4511] ticket:551 add quotes to links of labels
Date Fri, 07 Mar 2014 15:44:13 GMT
[#4227][#4511] ticket:551 add quotes to links of labels


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/0fc16242
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/0fc16242
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/0fc16242

Branch: refs/heads/master
Commit: 0fc16242091af23036e92f09f36ca8e86dce63e3
Parents: 1bf1e8d
Author: Yuriy Arhipov <yuriyarhipovua@yandex.ru>
Authored: Fri Feb 28 23:52:34 2014 +0400
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Fri Mar 7 15:12:40 2014 +0000

----------------------------------------------------------------------
 ForgeTracker/forgetracker/templates/tracker/ticket.html   |  2 +-
 .../templates/tracker_widgets/ticket_search_results.html  |  2 +-
 ForgeTracker/forgetracker/tests/functional/test_root.py   |  6 +++++-
 ForgeWiki/forgewiki/templates/wiki/page_view.html         |  2 +-
 ForgeWiki/forgewiki/tests/functional/test_root.py         | 10 ++++++++++
 5 files changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0fc16242/ForgeTracker/forgetracker/templates/tracker/ticket.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker/ticket.html b/ForgeTracker/forgetracker/templates/tracker/ticket.html
index 2e374c7..dc4b56e 100644
--- a/ForgeTracker/forgetracker/templates/tracker/ticket.html
+++ b/ForgeTracker/forgetracker/templates/tracker/ticket.html
@@ -86,7 +86,7 @@
         <label class="simple">Labels: </label>
         {% for label in ticket.labels %}
           <span class="ui-corner-all tag">
-              <a href="../search?q=labels:{{h.urlquoteplus(label)}}">{{label}} ({{ticket.artifacts_labeled_with(label,
ticket.app_config).count()}})</a>
+              <a href="../search?q=labels:'{{h.urlquoteplus(label)}}'">{{label}} ({{ticket.artifacts_labeled_with(label,
ticket.app_config).count()}})</a>
           </span>
         {% else %}
           None

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0fc16242/ForgeTracker/forgetracker/templates/tracker_widgets/ticket_search_results.html
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/templates/tracker_widgets/ticket_search_results.html
b/ForgeTracker/forgetracker/templates/tracker_widgets/ticket_search_results.html
index 2c5bb6c..f8515db 100644
--- a/ForgeTracker/forgetracker/templates/tracker_widgets/ticket_search_results.html
+++ b/ForgeTracker/forgetracker/templates/tracker_widgets/ticket_search_results.html
@@ -59,7 +59,7 @@
               {% elif col['name'] == 'labels' %}
               <td>
                   {%- for l in t.labels -%}
-                  <a href="{{c.app.url}}search?q=labels:{{h.urlquoteplus(l)}}">{{l}}</a>
+                  <a href="{{c.app.url}}search?q=labels:'{{h.urlquoteplus(l)}}'">{{l}}</a>
                     {%- if not loop.last -%}, {% endif -%}
                   {%- endfor -%}
               </td>

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0fc16242/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 6a5fc02..d3a8200 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -287,10 +287,14 @@ class TestFunctionalController(TrackerTestController):
 
     def test_new_ticket(self):
         summary = 'test new ticket'
-        ticket_view = self.new_ticket(summary=summary).follow()
+        ticket_view = self.new_ticket(summary=summary, labels="test label").follow()
         assert_true(summary in ticket_view)
         assert 'class="artifact_subscribe' in ticket_view
 
+    def test_labels(self):
+        ticket_view = self.new_ticket(summary='summary', labels="test label").follow()
+        assert '''<a href="../search?q=labels:'test+label'">test label (1)</a>'''
in ticket_view
+
     def test_new_with_milestone(self):
         ticket_view = self.new_ticket(
             summary='test new with milestone', **{'_milestone': '1.0'}).follow()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0fc16242/ForgeWiki/forgewiki/templates/wiki/page_view.html
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/templates/wiki/page_view.html b/ForgeWiki/forgewiki/templates/wiki/page_view.html
index 8369b9c..817db02 100644
--- a/ForgeWiki/forgewiki/templates/wiki/page_view.html
+++ b/ForgeWiki/forgewiki/templates/wiki/page_view.html
@@ -66,7 +66,7 @@
     <label class="simple">Labels: </label>
     {% for label in page.labels %}
       {% if label != '' %}
-        <span><a href="{{c.app.url}}search/?q=labels_t:{{label}}&parser=standard">{{label}}
({{page.artifacts_labeled_with(label, page.app_config).count()}})</a></span>
+        <span><a href="{{c.app.url}}search/?q=labels_t:'{{label}}'&parser=standard">{{label}}
({{page.artifacts_labeled_with(label, page.app_config).count()}})</a></span>
       {% endif %}
     {% endfor %}
   </div>

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0fc16242/ForgeWiki/forgewiki/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/tests/functional/test_root.py b/ForgeWiki/forgewiki/tests/functional/test_root.py
index d4c8acb..86d0c3a 100644
--- a/ForgeWiki/forgewiki/tests/functional/test_root.py
+++ b/ForgeWiki/forgewiki/tests/functional/test_root.py
@@ -169,6 +169,16 @@ class TestRootController(TestController):
         assert create_activity.call_count == 1
         assert create_activity.call_args[0][1] == 'renamed'
 
+    def test_labels(self):
+        response = self.app.post(
+            '/wiki/foo-bar/update',
+            params={
+                'title': 'foo',
+                'text': 'sometext',
+                'labels': 'test label',
+                'viewable_by-0.id': 'all'}).follow()
+        assert '''<a href="/p/test/wiki/search/?q=labels_t:'test label'&parser=standard">test
label (1)</a>''' in response
+
     def test_title_slashes(self):
         # forward slash not allowed in wiki page title - converted to dash
         response = self.app.post(


Mime
View raw message