You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2015/10/23 16:49:18 UTC
[18/28] 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/3c70029c
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/3c70029c
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/3c70029c
Branch: refs/heads/ib/7924
Commit: 3c70029c09f5b8d7f0e7a7e459f13c189c8d6b36
Parents: 23261e0
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Oct 22 19:11:43 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Oct 22 19:11:43 2015 +0300
----------------------------------------------------------------------
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/3c70029c/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/3c70029c/Allura/allura/tests/test_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_globals.py b/Allura/allura/tests/test_globals.py
index 8b7c0c5..c70c2c6 100644
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -908,7 +908,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):