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 2015/10/28 17:28:20 UTC

[18/35] allura git commit: [#7924] ticket:853 Only add "href" when tag is "a"

[#7924] ticket:853 Only add "href" when tag is "a"


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

Branch: refs/heads/master
Commit: 248543b676758adf6030ddfe580d520b4445769e
Parents: e60c4c1
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Oct 22 19:11:43 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Tue Oct 27 16:22:11 2015 +0200

----------------------------------------------------------------------
 Allura/allura/lib/app_globals.py    | 3 ++-
 Allura/allura/tests/test_globals.py | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/248543b6/Allura/allura/lib/app_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py
index 191d2f6..ca064bb 100644
--- a/Allura/allura/lib/app_globals.py
+++ b/Allura/allura/lib/app_globals.py
@@ -602,10 +602,11 @@ class Icon(object):
     def render(self, show_title=False, extra_css=None, closing_tag=True, tag='a', **kw):
         title = kw.get('title') or self.title
         attrs = {
-            'href': '#',
             'title': title,
             'class': ' '.join(['icon', self.css, extra_css or '']).strip(),
         }
+        if tag == 'a':
+            attrs['href'] = '#'
         attrs.update(kw)
         attrs = ew._Jinja2Widget().j2_attrs(attrs)
         visible_title = u''

http://git-wip-us.apache.org/repos/asf/allura/blob/248543b6/Allura/allura/tests/test_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_globals.py b/Allura/allura/tests/test_globals.py
index 8dbeca7..f22d949 100644
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -896,7 +896,7 @@ class TestIconRender(object):
         assert_equal(html, self.i.render(closing_tag=False))
 
     def test_tag(self):
-        html = u'<div class="icon fa fa-edit" href="#" title="Edit"></div>'
+        html = u'<div class="icon fa fa-edit" title="Edit"></div>'
         assert_equal(html, self.i.render(tag='div'))
 
     def test_kwargs(self):