Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Commit

Permalink
[#843] Add question popover to dataset and place pages
Browse files Browse the repository at this point in the history
  • Loading branch information
brew committed Mar 23, 2017
1 parent d2f8b43 commit b2db2b9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
20 changes: 12 additions & 8 deletions census/views/includes/dataviews/table_slice_dataset.html
@@ -1,11 +1,14 @@
{% import "macros/popovers.html" as popovers %}

{% if is_index %}
{% set tableId = 'slice-table-index' %}
{% set sortby = 'rank' %}
{% else %}
{% set tableId = 'slice-table' %}
{% set sortby = 'name' %}
{% endif %}

<div class="table-responsive">
{% if is_index %}
{% set tableId = 'slice-table-index' %}
{% set sortby = 'rank' %}
{% else %}
{% set tableId = 'slice-table' %}
{% set sortby = 'name' %}
{% endif %}
<table id="{{ tableId }}" class="table slice-table data-table table-header-stuck">
{% if is_index %}
<colgroup>
Expand Down Expand Up @@ -56,7 +59,7 @@
{% set answer = entry.getAnswerValueForQuestion(question) %}
{% set pass = 'yes' if question.pass(answer) else 'no' %}
{% endif %}
<li class="{{ pass }}" title="{% if pass == 'yes' %}It's {% elif pass == 'no' %}It's not {% endif %}{{ question.questionshort|lower }}"><i class="fa fa-{{ question.icon }}"></i>&nbsp;</li>
<li class="{{ pass }}" title="{{ question.question }}" data-toggle="popover" data-content="{{ popovers.popover_slice_content(question.description)|escape }}"><i class="fa fa-{{ question.icon }}"></i>&nbsp;</li>
{% endfor %}
</ul>
</td>
Expand Down Expand Up @@ -163,3 +166,4 @@ <h6><span class="icon">&#8627;</span> {{ gettext("Awaiting review") }}</h6>
</tbody>
</table>
</div>
<div id="popover" class="popover fade bottom in" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>
2 changes: 1 addition & 1 deletion census/views/includes/dataviews/table_slice_place.html
Expand Up @@ -64,7 +64,7 @@
{% set answer = entry.getAnswerValueForQuestion(question) %}
{% set pass = 'yes' if question.pass(answer) else 'no' %}
{% endif %}
<li class="{{ pass }}" title="{% if pass == 'yes' %}It's {% elif pass == 'no' %}It's not {% endif %}{{ question.questionshort|lower }}" title="{{ question.question }}" data-toggle="popover" data-content="{{ popovers.popover_slice_content(question.description)|escape }}"><i class="fa fa-{{ question.icon }}"></i>&nbsp;</li>
<li class="{{ pass }}" title="{{ question.question }}" data-toggle="popover" data-content="{{ popovers.popover_slice_content(question.description)|escape }}"><i class="fa fa-{{ question.icon }}"></i>&nbsp;</li>
{% endfor %}
</ul>
</td>
Expand Down

0 comments on commit b2db2b9

Please sign in to comment.