You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by he...@apache.org on 2015/10/28 19:01:24 UTC

[02/50] [abbrv] allura git commit: [#7924] ticket:858 Do not include text in the .fa element

[#7924] ticket:858 Do not include text in the .fa element


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

Branch: refs/heads/hs/7919
Commit: 3c7449554e7ad3f93abd523047b6fb31546a0a8d
Parents: 8c90a5b
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Oct 27 16:29:10 2015 +0200
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Tue Oct 27 16:29:10 2015 +0200

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


http://git-wip-us.apache.org/repos/asf/allura/blob/3c744955/Allura/allura/lib/app_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py
index 1f47330..df34964 100644
--- a/Allura/allura/lib/app_globals.py
+++ b/Allura/allura/lib/app_globals.py
@@ -606,7 +606,7 @@ class Icon(object):
         title = kw.get('title') or self.title
         attrs = {
             'title': title,
-            'class': ' '.join(['icon', self.css, extra_css or '']).strip(),
+            'class': ' '.join(['icon', extra_css or '']).strip(),
         }
         if tag == 'a':
             attrs['href'] = '#'
@@ -614,7 +614,7 @@ class Icon(object):
         attrs = ew._Jinja2Widget().j2_attrs(attrs)
         visible_title = u''
         if show_title:
-            visible_title = u'<span>&nbsp;{}</span>'.format(Markup.escape(title))
+            visible_title = u'&nbsp;{}'.format(Markup.escape(title))
         closing_tag = u'</{}>'.format(tag) if closing_tag else u''
-        icon = u'<{} {}>{}{}'.format(tag, attrs, visible_title, closing_tag)
+        icon = u'<{} {}><i class="{}"></i>{}{}'.format(tag, attrs, self.css, visible_title, closing_tag)
         return Markup(icon)

http://git-wip-us.apache.org/repos/asf/allura/blob/3c744955/Allura/allura/tests/test_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_globals.py b/Allura/allura/tests/test_globals.py
index f22d949..c29cfa2 100644
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -877,32 +877,32 @@ class TestIconRender(object):
         self.i = g.icons['edit']
 
     def test_default(self):
-        html = u'<a class="icon fa fa-edit" href="#" title="Edit"></a>'
+        html = u'<a class="icon" href="#" title="Edit"><i class="fa fa-edit"></i></a>'
         assert_equal(html, self.i.render())
 
     def test_show_title(self):
-        html = u'<a class="icon fa fa-edit" href="#" title="Edit"><span>&nbsp;Edit</span></a>'
+        html = u'<a class="icon" href="#" title="Edit"><i class="fa fa-edit"></i>&nbsp;Edit</a>'
         assert_equal(html, self.i.render(show_title=True))
 
-        html = u'<a class="icon fa fa-edit" href="#" title="&lt;script&gt;"><span>&nbsp;&lt;script&gt;</span></a>'
+        html = u'<a class="icon" href="#" title="&lt;script&gt;"><i class="fa fa-edit"></i>&nbsp;&lt;script&gt;</a>'
         assert_equal(html, self.i.render(show_title=True, title="<script>"))
 
     def test_extra_css(self):
-        html = u'<a class="icon fa fa-edit reply btn" href="#" title="Edit"></a>'
+        html = u'<a class="icon reply btn" href="#" title="Edit"><i class="fa fa-edit"></i></a>'
         assert_equal(html, self.i.render(extra_css='reply btn'))
 
     def test_no_closing_tag(self):
-        html = u'<a class="icon fa fa-edit" href="#" title="Edit">'
+        html = u'<a class="icon" href="#" title="Edit"><i class="fa fa-edit"></i>'
         assert_equal(html, self.i.render(closing_tag=False))
 
     def test_tag(self):
-        html = u'<div class="icon fa fa-edit" title="Edit"></div>'
+        html = u'<div class="icon" title="Edit"><i class="fa fa-edit"></i></div>'
         assert_equal(html, self.i.render(tag='div'))
 
     def test_kwargs(self):
-        html = u'<a class="icon fa fa-edit" data-id="123" href="#" title="Edit"></a>'
+        html = u'<a class="icon" data-id="123" href="#" title="Edit"><i class="fa fa-edit"></i></a>'
         assert_equal(html, self.i.render(**{'data-id': '123'}))
 
     def test_escaping(self):
-        html = u'<a class="icon fa fa-edit &#34;" data-url="&gt;" href="#" title="Edit"></a>'
+        html = u'<a class="icon &#34;" data-url="&gt;" href="#" title="Edit"><i class="fa fa-edit"></i></a>'
         assert_equal(html, self.i.render(extra_css='"', **{'data-url': '>'}))