Display horizontal separator only for links that are visible

This commit is contained in:
Roberto Rosario
2012-08-01 16:56:03 -04:00
parent 7b5a64f434
commit 9bb7821553
2 changed files with 6 additions and 5 deletions

View File

@@ -73,18 +73,19 @@ class Link(object):
# Check to see if link has conditional display # Check to see if link has conditional display
if self.condition: if self.condition:
condition_result = self.condition(context) self.condition_result = self.condition(context)
else: else:
condition_result = True self.condition_result = True
logger.debug('condition_result: %s', condition_result) logger.debug('self.condition_result: %s', self.condition_result)
if condition_result: if self.condition_result:
resolved_link = ResolvedLink() resolved_link = ResolvedLink()
resolved_link.text = self.text resolved_link.text = self.text
resolved_link.sprite = self.sprite resolved_link.sprite = self.sprite
resolved_link.icon = self.icon resolved_link.icon = self.icon
resolved_link.permissions = self.permissions resolved_link.permissions = self.permissions
resolved_link.condition_result = self.condition_result
try: try:
#args, kwargs = resolve_arguments(context, self.get('args', {})) #args, kwargs = resolve_arguments(context, self.get('args', {}))

View File

@@ -5,5 +5,5 @@
{% if link.disabled %} {% if link.disabled %}
<a class="{{ link.class }}" style="cursor: default;" href="#">{% if link.sprite and not disable_icons %}<span class="famfam inactive famfam-{{ link.sprite|default:'link' }}"></span>{% endif %}{{ link.text|capfirst }}{% if link.error %} - {{ link.error }}{% endif %}{% if link.active and not hide_active_anchor %}<span class="famfam active famfam-resultset_previous"></span>{% endif %}</a>{% if horizontal %}{% if not forloop.last %} | {% endif %}{% endif %} <a class="{{ link.class }}" style="cursor: default;" href="#">{% if link.sprite and not disable_icons %}<span class="famfam inactive famfam-{{ link.sprite|default:'link' }}"></span>{% endif %}{{ link.text|capfirst }}{% if link.error %} - {{ link.error }}{% endif %}{% if link.active and not hide_active_anchor %}<span class="famfam active famfam-resultset_previous"></span>{% endif %}</a>{% if horizontal %}{% if not forloop.last %} | {% endif %}{% endif %}
{% else %} {% else %}
<a class="{{ link.class }}" href="{{ link.url }}">{% if link.sprite and not disable_icons %}<span class="famfam active famfam-{{ link.sprite|default:'link' }}"></span>{% endif %}{{ link.text|capfirst }}{% if link.error %} - {{ link.error }}{% endif %}{% if link.active and not hide_active_anchor %}<span class="famfam active famfam-resultset_previous"></span>{% endif %}</a>{% if horizontal %}{% if not forloop.last %} | {% endif %}{% endif %} <a class="{{ link.class }}" href="{{ link.url }}">{% if link.sprite and not disable_icons %}<span class="famfam active famfam-{{ link.sprite|default:'link' }}"></span>{% endif %}{{ link.text|capfirst }}{% if link.error %} - {{ link.error }}{% endif %}{% if link.active and not hide_active_anchor %}<span class="famfam active famfam-resultset_previous"></span>{% endif %}</a>{% if horizontal %}{% if not forloop.last %}{% if link.condition_result %} | {% endif %}{% endif %}{% endif %}
{% endif %} {% endif %}