Reimplemented first tab link detention in template instead of tag

This commit is contained in:
Roberto Rosario
2011-05-25 01:35:43 -04:00
parent df1dc904fb
commit 6e67f1e37c
3 changed files with 4 additions and 4 deletions

View File

@@ -177,11 +177,11 @@
{% if form_navigation_links %}
<div class="secondary-navigation">
<ul class="wat-cf">
{% with form_navigation_links as object_navigation_links %}
{% with "true" as as_li %}
{% with "true" as hide_active_anchor %}
{% with "active" as li_class_active %}
{% with "first" as li_class_first %}
{% with form_navigation_links as object_navigation_links %}
{% include "generic_navigation.html" %}
{% endwith %}
{% endwith %}

View File

@@ -9,7 +9,7 @@
{% evaluate_link condition as conditional_display %}
{% if conditional_display %}
{% if as_li %}
<li class="{% if link.first and li_class_first %}{{ li_class_first}} {% endif %}{% if link.active and li_class_active %}{{ li_class_active }}{% endif %}">
<li class="{% if forloop.first and li_class_first %}{{ li_class_first}} {% endif %}{% if link.active and li_class_active %}{{ li_class_active }}{% endif %}">
{% endif %}
{% include "generic_link_instance.html" %}
{% if as_li %}</li>{% endif %}

View File

@@ -26,7 +26,8 @@ def process_links(links, view_name, url):
"""
items = []
active_item = None
for item, count in zip(links, range(len(links))):
#for item, count in zip(links, range(len(links))):
for item in links:
item_view = 'view' in item and item['view']
item_url = 'url' in item and item['url']
new_link = item.copy()
@@ -42,7 +43,6 @@ def process_links(links, view_name, url):
if view_name == child_view or url == child_url:
active_item = item
new_link.update({
'first': count == 0,
'url': item_view and reverse(item_view) or item_url or u'#',
})
items.append(new_link)