Skip to content

Commit

Permalink
Merge pull request #1371 from kinow/make-tooltips-conditional
Browse files Browse the repository at this point in the history
Tooltips are now conditional on the hierarchy
  • Loading branch information
osma authored Oct 4, 2022
2 parents 77eb4a2 + 6dc902d commit ac64a05
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
5 changes: 4 additions & 1 deletion view/changes.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
{% endif %}
<h3 class="sr-only">{% trans "List vocabulary concepts hierarchically" %}</h3>
{% if active_tab == 'hierarchy' %}{% set css_class = css_class|merge(['active']) %}{% endif %}
<li id="hierarchy{% if not vocab.config.showHierarchy %}-disabled{% endif %}" class="nav-item"><a class="{{ css_class|join(' ') }} skosmos-tooltip-wrapper skosmos-tooltip t-bottom" href="#" id="hier-trigger"{% if not vocab.config.showHierarchy %} data-title="{% trans 'hierarchy-disabled-help' %}"{% endif %}>{% trans "Hier-nav" %}</a></li>
{% if not vocab.config.showHierarchy %}
{% set css_class = css_class|merge(['skosmos-tooltip-wrapper', 'skosmos-tooltip', 't-bottom']) %}
{% endif %}
<li id="hierarchy{% if not vocab.config.showHierarchy %}-disabled{% endif %}" class="nav-item"><a class="{{ css_class|join(' ') }}" href="#" id="hier-trigger"{% if not vocab.config.showHierarchy %} data-title="{% trans 'hierarchy-disabled-help' %}"{% endif %}>{% trans "Hier-nav" %}</a></li>
{% if vocab.config.groupClassURI %}
{% set css_class = ['nav-link'] %}
<h3 class="sr-only">{% trans "List vocabulary concepts and groupings hierarchically" %}</h3>
Expand Down
5 changes: 4 additions & 1 deletion view/group-contents.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
<li id="alpha" class="nav-item"><a class="{{ css_class|join(' ') }}" href="{{ request.vocabid }}/{{ request.lang }}/index{% if request.contentLang != request.lang %}?clang={{ request.contentLang }}{% endif %}">{% if vocab.config.showChangeList and vocab.config.groupClassURI %}{% trans 'A-Z' %}{% else %}{% trans "Alpha-nav" %}{% endif %}</a></li>
{% endif %}
<h3 class="sr-only">{% trans "List vocabulary concepts hierarchically" %}</h3>
<li id="hierarchy{% if not vocab.config.showHierarchy %}-disabled{% endif %}" class="nav-item"><a class="{{ css_class|join(' ') }} skosmos-tooltip-wrapper skosmos-tooltip t-bottom" href="#" id="hier-trigger"{% if not vocab.config.showHierarchy %} data-title="{% trans 'hierarchy-disabled-help' %}"{% endif %}>{% trans "Hier-nav" %}</a></li>
{% if not vocab.config.showHierarchy %}
{% set css_class = css_class|merge(['skosmos-tooltip-wrapper', 'skosmos-tooltip', 't-bottom']) %}
{% endif %}
<li id="hierarchy{% if not vocab.config.showHierarchy %}-disabled{% endif %}" class="nav-item"><a class="{{ css_class|join(' ') }}" href="#" id="hier-trigger"{% if not vocab.config.showHierarchy %} data-title="{% trans 'hierarchy-disabled-help' %}"{% endif %}>{% trans "Hier-nav" %}</a></li>
{% if vocab.config.groupClassURI %}
<h3 class="sr-only">{% trans "List vocabulary concepts and groupings hierarchically" %}</h3>
{% if search_results|first.isGroup %}{% set css_class = css_class|merge(['active']) %}{% endif %}
Expand Down
5 changes: 4 additions & 1 deletion view/group-index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
<li id="alpha" class="nav-item"><a class="{{ css_class|join(' ') }}" href="{{ request.vocabid }}/{{ request.lang }}/index{% if request.contentLang != request.lang %}?clang={{ request.contentLang }}{% endif %}">{% if vocab.config.showChangeList and vocab.config.groupClassURI %}{% trans 'A-Z' %}{% else %}{% trans "Alpha-nav" %}{% endif %}</a></li>
{% endif %}
<h3 class="sr-only">{% trans "List vocabulary concepts hierarchically" %}</h3>
<li id="hierarchy{% if not vocab.config.showHierarchy %}-disabled{% endif %}" class="nav-item"><a class="{{ css_class|join(' ') }} skosmos-tooltip-wrapper skosmos-tooltip t-bottom" href="#" id="hier-trigger"{% if not vocab.config.showHierarchy %} data-title="{% trans 'hierarchy-disabled-help' %}"{% endif %}>{% trans "Hier-nav" %}</a></li>
{% if not vocab.config.showHierarchy %}
{% set css_class = css_class|merge(['skosmos-tooltip-wrapper', 'skosmos-tooltip', 't-bottom']) %}
{% endif %}
<li id="hierarchy{% if not vocab.config.showHierarchy %}-disabled{% endif %}" class="nav-item"><a class="{{ css_class|join(' ') }}" href="#" id="hier-trigger"{% if not vocab.config.showHierarchy %} data-title="{% trans 'hierarchy-disabled-help' %}"{% endif %}>{% trans "Hier-nav" %}</a></li>
{% if vocab.config.groupClassURI %}
<h3 class="sr-only">{% trans "List vocabulary concepts and groupings hierarchically" %}</h3>
{% set css_class = css_class|merge(['active']) %}
Expand Down
5 changes: 4 additions & 1 deletion view/light.twig
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@
{% endif %}
{% set css_class = ['nav-link'] %}
{% set disabledHierarchy = not vocab.config.showHierarchy and not search_results|length == 1 %}
{% if disabledHierarchy %}
{% set css_class = css_class|merge(['skosmos-tooltip-wrapper', 'skosmos-tooltip', 't-bottom']) %}
{% endif %}
<h3 class="sr-only">{% trans "List vocabulary concepts hierarchically" %}</h3>
{% if search_results|length == 1 and not term %}{% set css_class = css_class|merge(['active']) %}{% endif %}
<li id="hierarchy{%- if disabledHierarchy %}-disabled{% endif -%}" class="nav-item">
<a class="{{ css_class|join(' ') }} skosmos-tooltip-wrapper skosmos-tooltip t-bottom" href="#" id="hier-trigger"
<a class="{{ css_class|join(' ') }}" href="#" id="hier-trigger"
{% if disabledHierarchy%} data-title="{% trans 'hierarchy-disabled-help' %}"{% endif %}
>{% trans "Hier-nav" %}
</a>
Expand Down
5 changes: 4 additions & 1 deletion view/vocab.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
<h3 class="sr-only">{% trans "List vocabulary concepts hierarchically" %}</h3>
{% set css_class = ['nav-link'] %}
{% if active_tab == 'hierarchy' %}{% set css_class = css_class|merge(['active']) %}{% endif %}
<li id="hierarchy{% if not vocab.config.showHierarchy %}-disabled{% endif %}" class="nav-item"><a class="{{ css_class|join(' ') }} skosmos-tooltip-wrapper skosmos-tooltip t-bottom" href="#" id="hier-trigger"{% if not vocab.config.showHierarchy %} data-title="{% trans 'hierarchy-disabled-help' %}"{% endif %}>{% trans "Hier-nav" %}</a></li>
{% if not vocab.config.showHierarchy %}
{% set css_class = css_class|merge(['skosmos-tooltip-wrapper', 'skosmos-tooltip', 't-bottom']) %}
{% endif %}
<li id="hierarchy{% if not vocab.config.showHierarchy %}-disabled{% endif %}" class="nav-item"><a class="{{ css_class|join(' ') }}" href="#" id="hier-trigger"{% if not vocab.config.showHierarchy %} data-title="{% trans 'hierarchy-disabled-help' %}"{% endif %}>{% trans "Hier-nav" %}</a></li>
{% if vocab.config.groupClassURI %}
<h3 class="sr-only">{% trans "List vocabulary concepts and groupings hierarchically" %}</h3>
<li id="groups" class="nav-item"><a class="{{ css_class|join(' ') }}" href="{{ request.vocabid }}/{{ request.lang }}/groups{% if request.contentLang != request.lang %}?clang={{ request.contentLang }}{% endif %}">{% trans "Group-nav" %}</a></li>
Expand Down

0 comments on commit ac64a05

Please sign in to comment.