Skip to content

Commit df384fb

Browse files
committed
Move popover trigger to base.html
1 parent d834868 commit df384fb

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

dojo/templates/base.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,12 @@
369369
<script src="{% static "jquery-cookie/jquery.cookie.js" %}"></script>
370370
<!-- our JS -->
371371
<script src="{% static "dojo/js/index.js" %}"></script>
372+
<script type="application/javascript">
373+
$(document).ready(function() {
374+
$('.has-popover').popover({'trigger':'hover'});
375+
});
376+
</script>
377+
372378
{% block postscript %}
373379
{% endblock %}
374380
</body>

dojo/templates/dojo/form_fields.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
{{ field }} <span>{{ field.label }}{% if field.field.required%}<sup>*</sup>{% endif %}</span>
2121
</label>
2222
{% endif %}
23+
{% if field.help_text %}
24+
<i class="fa fa-question-circle has-popover" data-trigger="hover" data-content="{{ field.help_text }}" data-placement="right" data-container="body">
25+
</i>
26+
{% endif %}
2327
{% for error in field.errors %}
2428
<span class="help-block {{ form.error_css_class }}">{{ error }}</span>
2529
{% endfor %}
2630

27-
{% if field.help_text %}
28-
<i class="fa fa-question-circle has-popover" data-trigger="hover" data-content="{{ field.help_text|safe }}" data-placement="right" data-container="body">
29-
</i>
30-
{% endif %}
3131
</div>
3232
</div>
3333
{% elif field|is_radio %}
@@ -50,15 +50,20 @@
5050
{% endfor %}
5151

5252
{% if field.help_text %}
53-
<i class="fa fa-question-circle has-popover" data-trigger="hover" data-content="{{ field.help_text|safe }}" data-placement="right" data-container="body">
53+
<i class="fa fa-question-circle has-popover" data-trigger="hover" data-content="{{ field.help_text }}" data-placement="right" data-container="body">
5454
</i>
5555
{% endif %}
5656
</div>
5757
{% else %}
5858
{% if field.auto_id %}
5959
<label class="col-sm-2 control-label
6060
{% if field.field.required %}{{ form.required_css_class }}{% endif %}"
61-
for="{{ field.auto_id }}">{{ field.label }}{% if field.field.required%}<sup>*</sup>{% endif %}</label>
61+
for="{{ field.auto_id }}">{{ field.label }}{% if field.field.required%}<sup>*</sup>{% endif %}
62+
{% if field.help_text %}
63+
<i class="fa fa-question-circle has-popover" data-trigger="hover" data-content="{{ field.help_text }}" data-placement="right" data-container="body">
64+
</i>
65+
{% endif %}
66+
</label>
6267
{% endif %}
6368

6469
<div class="col-sm-10 {{ classes.value }} {% if field|is_multiple_checkbox %}multiple-checkbox{% endif %}">
@@ -67,11 +72,6 @@
6772
{% for error in field.errors %}
6873
<span class="help-block {{ form.error_css_class }}">{{ error }}</span>
6974
{% endfor %}
70-
71-
{% if field.help_text %}
72-
<i class="fa fa-question-circle has-popover" data-trigger="hover" data-content="{{ field.help_text|safe }}" data-placement="right" data-container="body">
73-
</i>
74-
{% endif %}
7575
</div>
7676
{% endif %}
7777
</div>

dojo/templates/dojo/system_settings.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,3 @@ <h3> System Settings </h3>
2020
</div>
2121
</form>
2222
{% endblock %}
23-
{% block postscript %}
24-
<script type="application/javascript">
25-
$(document).ready(function() {
26-
$('.has-popover').popover({'trigger':'hover'});
27-
});
28-
</script>
29-
{% endblock %}

0 commit comments

Comments
 (0)