Skip to content

Commit

Permalink
Add ubiquitous iframe switch to remote header, footer and feedback panel
Browse files Browse the repository at this point in the history
  • Loading branch information
atiberghien committed Apr 30, 2014
1 parent 5824093 commit e25ab1a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
7 changes: 7 additions & 0 deletions apps/i4p_base/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ def settings(request):
return additions


def iframe(request):
if request.method == "GET":
return {'iframe' : 'iframe' in request.GET}
return {}






Expand Down
24 changes: 14 additions & 10 deletions apps/i4p_base/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,26 +183,30 @@
</div>
{% endblock %}

{% block header %}{% include "header.html" %}{% endblock %}


{% block header %}{% if not iframe %}{% include "header.html" %}{% endif %}{% endblock %}

{% block subheader %}{% endblock %}

{% block feedback %}
{% if user.is_authenticated %}
<div>
<a href="#" id="feedback-trigger" class="trigger right">&nbsp;</a>
<div id="feedback" class="feedback-panel right">
{% include 'backcap/feedback_tab.html' %}
</div>
</div>
{% if not iframe %}
{% if user.is_authenticated %}
<div>
<a href="#" id="feedback-trigger" class="trigger right">&nbsp;</a>
<div id="feedback" class="feedback-panel right">
{% include 'backcap/feedback_tab.html' %}
</div>
</div>
{% endif %}
{% endif %}
{% endblock %}

{% block central_content_zone %}
{% block content %}{% endblock %}
{% endblock %}

{% block footer %} {% include "footer.html" %} {% endblock %}

{% block footer %}{% if not iframe %}{% include "footer.html" %}{% endif %}{% endblock %}


</div>
Expand Down
1 change: 1 addition & 0 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
'django.core.context_processors.static',
'apps.i4p_base.context_processors.search_form',
'apps.i4p_base.context_processors.settings',
'apps.i4p_base.context_processors.iframe',
'apps.member.context_processors.member_forms',

'cms.context_processors.media',
Expand Down

0 comments on commit e25ab1a

Please sign in to comment.