You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by tv...@apache.org on 2013/05/08 00:27:57 UTC
[19/50] [abbrv] git commit: [#5599] Fixed and cleaned up nav-bar
selection logic
[#5599] Fixed and cleaned up nav-bar selection logic
Signed-off-by: Cory Johns <cj...@slashdotmedia.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/323b7d93
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/323b7d93
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/323b7d93
Branch: refs/heads/tv/3854
Commit: 323b7d93786f8d79b2070e5193b4a6f1e58f1845
Parents: be11653
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Wed May 1 20:37:09 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed May 1 20:38:38 2013 +0000
----------------------------------------------------------------------
Allura/allura/model/project.py | 2 +
Allura/allura/templates/jinja_master/top_nav.html | 19 +--------------
2 files changed, 4 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/323b7d93/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 8a06566..f95aae0 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -445,6 +445,8 @@ class Project(MappedClass, ActivityNode, ActivityObject):
ordinal = anchored_tools.keys().index(entry.tool_name.lower())
else:
ordinal = int(ac.options.get('ordinal', 0)) + delta_ordinal
+ if self.is_nbhd_project and entry.label == 'Admin':
+ entry.matching_urls.append('%s_admin/' % self.url())
if ordinal > max_ordinal:
max_ordinal = ordinal
entries.append({'ordinal':ordinal,'entry':entry})
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/323b7d93/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 47ef332..8ef4621 100644
--- a/Allura/allura/templates/jinja_master/top_nav.html
+++ b/Allura/allura/templates/jinja_master/top_nav.html
@@ -19,18 +19,7 @@
{% if c.project %}
<ul class="dropdown">
{% for s in c.project.grouped_navbar_entries() %}
- {% set selected = False %}
- {% if s.label == 'Home' %}
- {% set url_length = s.url|length %}
- {% if request.url.rfind(s.url, -url_length) != -1 %}
- {% set selected = True %}
- {% endif %}
- {% else %}
- {% if s.matches_url(request) or c.project.neighborhood.url()+'_admin' in request.upath_info %}
- {% set selected = True %}
- {% endif %}
- {% endif %}
- <li class="{% if selected %}selected{% endif %}">
+ <li class="{% if s.matches_url(request) %}selected{% endif %}">
<a href="{{s.url}}" class="ui-icon-{{s.ui_icon or 'admin'}}">
{{s.label}}
</a>
@@ -38,11 +27,7 @@
{% if grouped_tool_count %}
<ul>
{%for tool in s.children%}
- {% set selected = False %}
- {% if tool.matches_url(request) or c.project.neighborhood.url()+'_admin' in request.upath_info%}
- {% set selected = True %}
- {% endif %}
- <li class="{% if selected %}selected{% endif %}"><a href="{{tool.url}}">{{tool.label}}</a></li>
+ <li class="{% if tool.matches_url(request) %}selected{% endif %}"><a href="{{tool.url}}">{{tool.label}}</a></li>
{%endfor%}
</ul>
{% endif %}