incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [39/45] git commit: [#6942] Allow tools to supply their own icons for nav
Date Fri, 13 Dec 2013 05:08:25 GMT
[#6942] Allow tools to supply their own icons for nav

This change causes the icons to be fetched via the tool's icon_url()
rather than via the theme css

Signed-off-by: Tim Van Steenburgh <tvansteenburgh@gmail.com>


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

Branch: refs/heads/tv/6942
Commit: 1082505ce938623e4fb1cf219a2e53080a6a68f6
Parents: b988a93
Author: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Authored: Tue Dec 3 21:21:10 2013 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Thu Dec 12 21:57:59 2013 +0000

----------------------------------------------------------------------
 Allura/allura/templates/jinja_master/top_nav.html   | 3 ++-
 Allura/allura/tests/functional/test_neighborhood.py | 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1082505c/Allura/allura/templates/jinja_master/top_nav.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/top_nav.html b/Allura/allura/templates/jinja_master/top_nav.html
index 8ef4621..90e1d9e 100644
--- a/Allura/allura/templates/jinja_master/top_nav.html
+++ b/Allura/allura/templates/jinja_master/top_nav.html
@@ -20,7 +20,8 @@
 <ul class="dropdown">
   {% for s in c.project.grouped_navbar_entries() %}
     <li class="{% if s.matches_url(request) %}selected{% endif %}">
-        <a href="{{s.url}}" class="ui-icon-{{s.ui_icon or 'admin'}}">
+        <a href="{{s.url}}"
+          style="background-repeat: no-repeat; background-image: url({{ g.theme.app_icon_url((s.tool_name
or 'admin').lower(), 32) }});">
             {{s.label}}
         </a>
         {% set grouped_tool_count = s.matching_urls|length %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1082505c/Allura/allura/tests/functional/test_neighborhood.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_neighborhood.py b/Allura/allura/tests/functional/test_neighborhood.py
index c9dc1fe..2b165a3 100644
--- a/Allura/allura/tests/functional/test_neighborhood.py
+++ b/Allura/allura/tests/functional/test_neighborhood.py
@@ -731,8 +731,8 @@ class TestNeighborhood(TestController):
             antispam=True,
             extra_environ=dict(username='root'))
         r = self.app.get('/adobe/testtemp/admin/tools')
-        assert '<a href="/adobe/testtemp/wiki/" class="ui-icon-tool-wiki">' in r
-        assert '<a href="/adobe/testtemp/admin/" class="ui-icon-tool-admin">' in r
+        assert r.html.find('div', id='top_nav').find('a', href='/adobe/testtemp/wiki/'),
r.html
+        assert r.html.find('div', id='top_nav').find('a', href='/adobe/testtemp/admin/'),
r.html
 
     def test_name_suggest(self):
         r = self.app.get('/p/suggest_name?project_name=My+Moz')
@@ -824,7 +824,7 @@ class TestNeighborhood(TestController):
     @td.with_user_project('test-user')
     def test_profile_topnav_menu(self):
         r = self.app.get('/u/test-user/', extra_environ=dict(username='test-user')).follow()
-        assert '<a href="/u/test-user/profile/" class="ui-icon-tool-profile">' in r,
r
+        assert r.html.find('div', id='top_nav').find('a', href='/u/test-user/profile/'),
r.html
 
     def test_user_project_creates_on_demand(self):
         M.User.register(dict(username='donald-duck'), make_project=False)


Mime
View raw message