Skip to content
Snippets Groups Projects
Commit 417bf07b authored by Alice Heaton's avatar Alice Heaton :speech_balloon:
Browse files

Add a basic html tab for tabs that just contain text (and for testing)

parent c00635df
No related branches found
No related tags found
2 merge requests!23Tabbed view header styling,!22Tabbed page
......@@ -24,3 +24,26 @@ def clear_tabs():
global _pool
_pool = {}
class BasicHtmlTab(object):
""" A simple tab to display html
Settings:
title: The title of the tab
(in the header, not in
the tab)
body: The tab html
"""
template_name = 'tabbed_page/basic_html_tab.html'
def get_context_data(self, **kwargs):
title = kwargs.get('title', '(no title)')
body = kwargs.get('body', '(no body)')
return {
'title': title,
'body': body
}
register_tab('basic-html-tab', BasicHtmlTab())
{% load i18n %}
<div class="panel panel-default">
<div class="panel-heading container-fluid">
<div class="col-sm-5 col-xs-12">
<span class="fa fa-align-justify fa-fw"></span>
{% trans title %}
</div>
</div>
<div class="panel-body">
{{ body|safe }}
</div>
</div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment