context = super(PlatformView, self).get_context_data(**kwargs)
context['ALL_STATIC'] = "all_static"
- context['unfold1_main'] = debug_platform.render(self.request)
+ context['unfold_main'] = debug_platform.render(self.request)
# XXX This is repeated in all pages
# more general variables expected in the template
# . a django User in case of success
# . or None if the backend could be reached but the authentication failed
auth_result = authenticate(token=token)
+ # use one or two columns for the layout - not logged in users will see the login prompt
+ env['layout_1_or_2']="layout-unfold2.html" if not username else "layout-unfold1.html"
# high-level errors, like connection refused or the like
if isinstance (auth_result, ManifoldResult):
manifoldresult = auth_result
env['topmenu_items'] = topmenu_items(None, request)
if state: env['state'] = state
elif not env['username']: env['state'] = "Please sign in"
+ # use one or two columns for the layout - not logged in users will see the login prompt
+ env['layout_1_or_2']="layout-unfold2.html" if not env['username'] else "layout-unfold1.html"
return render_to_response('home-view.html',env, context_instance=RequestContext(request))
context.update(page.prelude_env())
+ context['layout_1_or_2']="layout-unfold2.html" if not context['username'] else "layout-unfold1.html"
+
return context
def render(self):
template_env = {}
- # define 'unfold1_main' to the template engine - the main contents
- template_env [ 'unfold1_main' ] = "\n".join(self._content)
+ # define 'unfold_main' to the template engine - the main contents
+ template_env [ 'unfold_main' ] = "\n".join(self._content)
# more general variables expected in the template
template_env [ 'title' ] = 'Test view that combines various plugins'
# variables that will get passed to the view-unfold1.html template
template_env = {}
- # define 'unfold1_main' to the template engine - the main contents
- template_env [ 'unfold1_main' ] = main_stack.render(request)
+ # define 'unfold_main' to the template engine - the main contents
+ template_env [ 'unfold_main' ] = main_stack.render(request)
# more general variables expected in the template
template_env [ 'title' ] = '%(slicename)s'%locals()
<script type="text/javascript" src="{{STATIC_URL}}/js/my_account.register.js"></script>
{% endblock %}
-{% block unfold1_main %}
+{% block unfold_main %}
<h2>Platform Access</h2>
{{ wizard.form.media }}
{% endblock %}
-{% block unfold1_main %}
+{% block unfold_main %}
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/onelab.css" />
<div class="onelab-title well well-lg">
{% extends "layout-unfold1.html" %}
-{% block unfold1_main %}
+{% block unfold_main %}
<h1>Query Received !</h1>
{% block head %}
{% endblock %}
-{% block unfold1_main %}
+{% block unfold_main %}
<div id='tophat_status'></div>
<div id='ms-dashboard'>
-{% extends 'layout-unfold2.html' %}
+{# fine for either layout-unfold1.html (logged in) or layout-unfold2.html (needs a login prompt) #}
+{% extends layout_1_or_2 %}
-{% block unfold2_margin %}
-{% if not username %}
+{% block unfold_margin %}
{% include 'widget-login.html' %}
-{% endif %}
-{% endblock unfold2_margin %}
+{% endblock unfold_margin %}
-{% block unfold2_main %}
+{% block unfold_main %}
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/onelab.css" />
<!-- xxx ideally only onelab.css but ... xxx -->
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/registration.css" />
<p>This UI server is connected to the manifold backend running at <code>{{ MANIFOLD_URL }}</code>.</p>
</div>
-{% endblock unfold2_main %}
+{% endblock unfold_main %}
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/dashboard.css" />
{% endblock %}
-{% block unfold1_main %}
+{% block unfold_main %}
<h1>Platform</h1>
{{networks}}
-{% extends "layout-unfold1.html" %}
+{# fine for either layout-unfold1.html (logged in) or layout-unfold2.html (needs a login prompt) #}
+{% extends layout_1_or_2 %}
+
+{% block unfold_margin %}
+{% include 'widget-login.html' %}
+{% endblock unfold_margin %}
{% block head %}
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/dashboard.css" />
{% endblock %}
-{% block unfold1_main %}
+{% block unfold_main %}
<h1>Platforms</h1>
{{platforms}}
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}css/smart_wizard.css" />
{% endblock %}
-{% block unfold1_main %}
+{% block unfold_main %}
<h1>User registration</h1>
{% extends "layout-unfold1.html" %}
-{% block unfold1_main %}
+{% block unfold_main %}
<div class="onelab-title well well-lg">
<h2>OneLab Experimenter Registration</h2>
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/dashboard.css" />
{% endblock %}
-{% block unfold1_main %}
+{% block unfold_main %}
<h1>Resource</h1>
{{resource}}
{% extends "layout-unfold1.html" %}
-{% block unfold1_main %}
+{% block unfold_main %}
<h1>Slice request Received !</h1>
{{ wizard.form.media }}
{% endblock %}
-{% block unfold1_main %}
+{% block unfold_main %}
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/onelab.css" />
<!-- xxx ideally only onelab.css but ... xxx -->
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}css/smart_wizard.css" />
{% endblock %}
-{% block unfold1_main %}
+{% block unfold_main %}
<h1>User registration</h1>
{% extends "layout-unfold1.html" %}
-{% block unfold1_main %}
+{% block unfold_main %}
<h1>User registration complete !</h1>
</script>
{% endblock %}
-{% block unfold1_main %}
+{% block unfold_main %}
<h1>Pending requests</h1>
context = super(PresViewView, self).get_context_data(**kwargs)
#context['ALL_STATIC'] = "all_static"
- context['unfold1_main'] = pres_view.render(self.request)
+ context['unfold_main'] = pres_view.render(self.request)
# XXX This is repeated in all pages
# more general variables expected in the template
# variables that will get passed to the view-unfold2.html template
template_env = {}
- # define 'unfold2_main' to the template engine
- template_env [ 'unfold2_main' ] = main_plugin.render(request)
+ # define 'unfold_main' to the template engine
+ template_env [ 'unfold_main' ] = main_plugin.render(request)
# more general variables expected in the template
template_env [ 'title' ] = 'Test view for a full request cycle'
query=slices_query,
)
# likewise but on the side view
- template_env [ 'unfold2_margin' ] = related_plugin.render (request)
+ template_env [ 'unfold_margin' ] = related_plugin.render (request)
# add our own css in the mix
#page.add_css_files ( 'css/dashboard.css')
$(function(){$("#bouton").click(issue_debug);});
""")
- # define 'unfold1_main' to the template engine
- template_env [ 'unfold1_main' ] = main_plugin.render(request)
+ # define 'unfold_main' to the template engine
+ template_env [ 'unfold_main' ] = main_plugin.render(request)
# more general variables expected in the template
template_env [ 'title' ] = 'Single Plugin View'
title='QuickFilter in main content',
criterias=quickfilter_criterias,
) ] )
- # define 'unfold2_main' to the template engine
- template_env [ 'unfold2_main' ] = main_plugin.render(request)
+ # define 'unfold_main' to the template engine
+ template_env [ 'unfold_main' ] = main_plugin.render(request)
##########
related_plugin = StaticList (page=page,
list=hard_wired_slice_names,
header='Slices')
# likewise but on the side view
- template_env [ 'unfold2_margin' ] = related_plugin.render (request)
+ template_env [ 'unfold_margin' ] = related_plugin.render (request)
# more general variables expected in the template
template_env [ 'title' ] = 'Test Plugin View'
{% extends 'layout-unfold2.html' %}
-{% block unfold2_main %}
+{% block unfold_main %}
{% insert_str prelude "css/sample.css" %}
<div id='scrollDiv3'> scroll3 area {{ lorem }} </div>
<div id='scrollDiv4'> scroll4 area {{ lorem }} {{ lorem }} {{ lorem }} </div>
<!--</div>-->
-{% endblock unfold2_main %}
+{% endblock unfold_main %}
-{% block unfold2_margin %}
+{% block unfold_margin %}
<div class="foo">
<ul class="nav nav-tabs nav-stacked">
<li><a href="#scrollDiv1" data-toggle="tab"><!--<i class="icon-chevron-right"/>--> scroll1 </a></li>
<li><a href="#scrollDiv4" data-toggle="tab"> scroll4 </a></li>
</ul>
</div>
-{% endblock unfold2_margin %}
+{% endblock unfold_margin %}
{% extends 'layout-unfold2.html' %}
-{% block unfold2_main %}
+{% block unfold_main %}
{% insert_str prelude "css/sample.css" %}
{% insert prelude_js %}
decima et quinta decima. Eodem modo typi, qui nunc nobis videntur
parum clari, fiant sollemnes in futurum.
</div>
-{% endblock unfold2_main %}
+{% endblock unfold_main %}
-{% block unfold2_margin %}
+{% block unfold_margin %}
This text is shorter on purpose Lorem <span class='bold'>ipsum
dolor</span> sit amet, consectetuer adipiscing elit, sed diam
nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat
volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo
consequat.
-{% endblock unfold2_margin %}
+{% endblock unfold_margin %}
{% extends 'layout-unfold2.html' %}
-{% block unfold2_main %}
-{{ unfold2_main|safe }}
-{% endblock unfold2_main %}
+{% block unfold_main %}
+{{ unfold_main|safe }}
+{% endblock unfold_main %}
-{% block unfold2_margin %}
-{{ unfold2_margin|safe }}
-{% endblock unfold2_margin %}
+{% block unfold_margin %}
+{{ unfold_margin|safe }}
+{% endblock unfold_margin %}
{% block base_content %}
<div id="unfold1-main" class="col-xs-12 columns">
- {% block unfold1_main %}
- "The main content area (define block 'unfold1_main')"
- {% endblock unfold1_main %}
+ {% block unfold_main %}
+ "The main content area (define block 'unfold_main')"
+ {% endblock unfold_main %}
</div><!--col-xs-12-->
{% endblock %}
{% block base_content %}
<div id="unfold2-main" class="col-xs-9 columns">
- {% block unfold2_main %}
- "The main content area (define block 'unfold2_main')"
- {% endblock unfold2_main %}
+ {% block unfold_main %}
+ "The main content area (define block 'unfold_main')"
+ {% endblock unfold_main %}
</div><!--col-xs-9-->
<div id='unfold2-margin' class='col-xs-3'>
- {% block unfold2_margin %}
- "The related content area (define block 'unfold2_margin')"
- {% endblock unfold2_margin %}
+ {% block unfold_margin %}
+ "The related content area (define block 'unfold_margin')"
+ {% endblock unfold_margin %}
</div><!--col-xs-3-->
{% endblock %}
{% extends 'layout-unfold1.html' %}
-{% block unfold1_main %}
-{{ unfold1_main|safe }}
-{% endblock unfold1_main %}
+{% block unfold_main %}
+{{ unfold_main|safe }}
+{% endblock unfold_main %}