Commit fa3a5033 authored by Kroustouris Stauros's avatar Kroustouris Stauros Committed by Zenon Mousmoulas

Merge branch 'master' of https://github.com/grnet/djnro

Conflicts:
	djnro/templates/partial/footer.html
	edumanage/templatetags/include_maybe.py
parents cd652918 f5557fe8
local_settings.py
djnro/local_settings.py
*~
*.pyc
*.db
all.kml
static/img/logo_holder.png
static/img/logo_small.png
static/img/right_logo_small.png
bottom_iframe.html
djnro/templates/partial/extra.footer.html
<iframe id='logos' scrolling="no" marginheight="0" marginwidth="0" src="https://dido.grnet.gr/logos/index.html" frameborder="0" height="60" width="500" align="middle"></iframe>
<style type="text/css" scoped>
iframe#logos {
width: 100%;
height: 60px;
}
@media screen and (max-width: 480px) {
iframe#logos {
height: 120px;
}
}
</style>
{% load i18n %}
{% load include_maybe %}
{% load template_exists %}
<footer class="stickyfooter">
<div>
......@@ -14,9 +14,9 @@
</a>
{% endfor %}
Powered by <a href="http://djnro.grnet.gr/" target="_blank">DjNRO</a> v{{VERSION}}
{% if "partial/bottom_iframe.html"|template_exists %}
{% if "partial/extra.footer.html"|template_exists %}
<div class="">
{% include_maybe 'partial/bottom_iframe.html' %}
{% include "partial/extra.footer.html" %}
</div>
{% endif %}
</div>
......
......@@ -103,10 +103,9 @@ Set the Realm country for REALM model::
('country_2letters', 'Country' ),
)
### Custom content in footer
### Adding iframe in footer
In case you need to add an iframe with banners at the bottom of the every page, you can paste your iframe code at a file called bottom_iframe template placed under 'djnro/templates/partial/bottom_iframe.html'
If you need to present custom content in the footer at the bottom of the every page, you can add HTML/template code in `djnro/templates/partial/extra.footer.html`.
Attribute map to match your AAI policy and SSO software (typically Shibboleth SP)::
......
from django import template
from django.template.defaultfilters import stringfilter
from django.template.loader_tags import do_include
from django.template.defaulttags import CommentNode
register = template.Library()
@register.filter
@stringfilter
def template_exists(value):
try:
template.loader.get_template(value)
return True
except template.TemplateDoesNotExist:
return False
@register.tag('include_maybe')
def do_include_maybe(parser, token):
"Source: http://stackoverflow.com/a/18951166/15690"
# Source: http://stackoverflow.com/a/18951166/15690
bits = token.split_contents()
if len(bits) < 2:
raise template.TemplateSyntaxError(
......@@ -33,7 +20,6 @@ def do_include_maybe(parser, token):
return CommentNode()
_orig_render = silent_node.render
def wrapped_render(*args, **kwargs):
try:
return _orig_render(*args, **kwargs)
......
from django import template
from django.template.defaultfilters import stringfilter
register = template.Library()
@register.filter
@stringfilter
def template_exists(value):
try:
template.loader.get_template(value)
return True
except template.TemplateDoesNotExist:
return False
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment