Skip to content

Commit

Permalink
changed tooltip on btn group
Browse files Browse the repository at this point in the history
Removed tooltip from individual buttons and added a big one on label of the results button groups, since it is not simply possible to show a tooltip on a disabled button.

Co-authored-by: Yannik <[email protected]>
  • Loading branch information
jooooosef and ybrnr committed Jan 6, 2025
1 parent 522df3f commit 325a534
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions evap/results/templates/results_evaluation_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,29 @@ <h3 class="mb-0">{{ evaluation.full_name }} ({{ evaluation.course.semester.name
<div class="row">
<div class="col-auto">
<div class="btn-switch btn-switch-light my-auto d-print-none">
<div class="btn-switch-label">{% translate 'General results' %}</div>
<div
class="btn-switch-label"
data-bs-toggle="tooltip"
data-bs-placement="bottom"
data-bs-html="true"
title="{% translate 'Show answers for general questions.' %}
<ul>
<li>{% translate 'Full: All results of general questions (including text answers)' %} </li>
<li>{% translate 'Ratings: Only rating results of general questions (without text answers)' %} </li>
</ul>"
>{% translate 'General results' %}</div>
<div class="btn-switch btn-group">
<a
href="{% url 'results:evaluation_detail' evaluation.course.semester.id evaluation.id %}?view_general_results=full&view_contributor_results={{ view_contributor_results.value }}"
role="button"
class="btn btn-sm btn-light {% if not general_textanswers %} disabled {% elif view_general_results == ViewGeneralResults.FULL %} active {% endif %}"
data-bs-toggle="tooltip"
data-bs-placement="bottom"
title="{% blocktranslate %}All results of general questions (including text answers){% endblocktranslate %}"
>
{% translate 'Full' %}
</a>
<a
href="{% url 'results:evaluation_detail' evaluation.course.semester.id evaluation.id %}?view_general_results=ratings&view_contributor_results={{ view_contributor_results.value }}"
role="button"
class="btn btn-sm btn-light {% if not general_textanswers %} disabled {% endif %} {% if view_general_results == ViewGeneralResults.RATINGS or not general_textanswers %} active{% endif %}"
data-bs-toggle="tooltip"
data-bs-placement="bottom"
title="{% translate 'Only rating results of general questions (without text answers)' %}"
>
{% translate 'Ratings' %}
</a>
Expand All @@ -66,35 +70,37 @@ <h3 class="mb-0">{{ evaluation.full_name }} ({{ evaluation.course.semester.name
<div class="row mt-1">
<div class="col-auto">
<div class="btn-switch btn-switch-light my-auto d-print-none">
<div class="btn-switch-label">{% translate 'Contributor results' %}</div>
<div
class="btn-switch-label"
data-bs-toggle="tooltip"
data-bs-placement="bottom"
data-bs-html="true"
title="{% translate 'Show answers for contributor questions.' %}
<ul>
<li>{% translate 'Full: All results of contributor questions available for you (including text answers)' %} </li>
<li>{% translate 'Ratings: Only rating results of contributor questions (without text answers)' %} </li>
<li>{% translate 'Personal: All results of contributor questions regarding yourself, hiding other contributors' %} </li>
</ul>"
>{% translate 'Contributor results' %}</div>
<div class="btn-switch btn-group">
<a
href="{% url 'results:evaluation_detail' evaluation.course.semester.id evaluation.id %}?view_general_results={{ view_general_results.value }}&view_contributor_results=full"
role="button"
class="btn btn-sm btn-light {% if not contributor_textanswers %} disabled {% elif view_contributor_results == ViewContributorResults.FULL %} active {% endif %}"
data-bs-toggle="tooltip"
data-bs-placement="bottom"
title="{% blocktranslate %}All results of contributor questions available for you (including text answers){% endblocktranslate %}"
>
{% translate 'Full' %}
</a>
<a
href="{% url 'results:evaluation_detail' evaluation.course.semester.id evaluation.id %}?view_general_results={{ view_general_results.value }}&view_contributor_results=ratings"
role="button"
class="btn btn-sm btn-light {% if not contributor_textanswers %} disabled {% endif %} {% if view_contributor_results == ViewContributorResults.RATINGS or not contributor_textanswers %} active{% endif %}"
data-bs-toggle="tooltip"
data-bs-placement="bottom"
title="{% translate 'Only rating results of contributor questions (without text answers)' %}"
>
{% translate 'Ratings' %}
</a>
<a
href="{% url 'results:evaluation_detail' evaluation.course.semester.id evaluation.id %}?view_general_results={{ view_general_results.value }}&view_contributor_results=personal"
role="button"
class="btn btn-sm btn-light {% if not contributor_personal or not contributor_textanswers %} disabled {% elif view_contributor_results == ViewContributorResults.PERSONAL %} active {% endif %}"
data-bs-toggle="tooltip"
data-bs-placement="bottom"
title="{% translate 'All results of contributor questions regarding yourself, hiding other contributors' %}"
>
{% translate 'Personal' %}
</a>
Expand Down

0 comments on commit 325a534

Please sign in to comment.