homeview and platformsview now use layout-unfold1 or layout-unfold2 depending on...
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 12 Nov 2013 15:39:46 +0000 (16:39 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 12 Nov 2013 15:39:46 +0000 (16:39 +0100)
30 files changed:
debug_platform/views.py
portal/homeview.py
portal/platformsview.py
portal/portalpage.py
portal/sliceview.py
portal/templates/account-view.html
portal/templates/contact.html
portal/templates/contact_sent.html
portal/templates/dashboard.html
portal/templates/home-view.html
portal/templates/platform.html
portal/templates/platforms.html
portal/templates/register_user_wizard.html
portal/templates/registration_view.html
portal/templates/resource.html
portal/templates/slice-request-ack-view.html
portal/templates/slice-request-view.html
portal/templates/user_register.html
portal/templates/user_register_complete.html
portal/templates/validate_pending.html
portal/views.py
trash/dashboard.py
trash/pluginview.py
trash/sampleviews.py
trash/templates/view-scroll.html
trash/templates/view-tab.html
trash/templates/view-unfold2.html
ui/templates/layout-unfold1.html
ui/templates/layout-unfold2.html
ui/templates/view-unfold1.html

index e6b0c95..ead4ed7 100644 (file)
@@ -45,7 +45,7 @@ class PlatformView(TemplateView):
         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
index b6af064..5b82221 100644 (file)
@@ -33,6 +33,8 @@ class HomeView (FreeAccessView):
         # . 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
@@ -61,5 +63,7 @@ class HomeView (FreeAccessView):
         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))
 
index 12e9485..6744643 100644 (file)
@@ -48,4 +48,6 @@ class PlatformsView(FreeAccessView):
 
         context.update(page.prelude_env())
 
+        context['layout_1_or_2']="layout-unfold2.html" if not context['username'] else "layout-unfold1.html"
+
         return context
index b5470fd..f592444 100644 (file)
@@ -15,8 +15,8 @@ class PortalPage(Page):
     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'
index 96bb218..4037e75 100644 (file)
@@ -324,8 +324,8 @@ class SliceView (LoginRequiredAutoLogoutView):
         # 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()
index 98da579..f3c731a 100644 (file)
@@ -8,7 +8,7 @@
 <script type="text/javascript" src="{{STATIC_URL}}/js/my_account.register.js"></script>
 {% endblock %}
 
-{% block unfold1_main %}
+{% block unfold_main %}
 
 
 <h2>Platform Access</h2>
index 43adfa5..3aa9f19 100644 (file)
@@ -4,7 +4,7 @@
 {{ 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">
index ca12d5f..62a2ab9 100644 (file)
@@ -1,6 +1,6 @@
 {% extends "layout-unfold1.html" %}
 
-{% block unfold1_main %}
+{% block unfold_main %}
 
   <h1>Query Received !</h1>
 
index 5ca062d..cd13608 100644 (file)
@@ -3,7 +3,7 @@
 {% block head %}
 {% endblock %}
 
-{% block unfold1_main %}
+{% block unfold_main %}
 
 <div id='tophat_status'></div>
 <div id='ms-dashboard'>
index 123bc28..1c887a3 100644 (file)
@@ -1,12 +1,11 @@
-{% 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" />
@@ -28,4 +27,4 @@ federated testbeds.
 <p>This UI server is connected to the manifold backend running at <code>{{ MANIFOLD_URL }}</code>.</p>
 </div>
 
-{% endblock unfold2_main %}
+{% endblock unfold_main %}
index d24d9ed..48afd94 100644 (file)
@@ -4,7 +4,7 @@
 <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/dashboard.css" />
 {% endblock %}
 
-{% block unfold1_main %}
+{% block unfold_main %}
 
 <h1>Platform</h1>
 {{networks}}
index 2234066..ee86241 100644 (file)
@@ -1,10 +1,15 @@
-{% 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}}
index 8d1d528..1f480a1 100644 (file)
@@ -8,7 +8,7 @@
 <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}css/smart_wizard.css" />
 {% endblock %}
 
-{% block unfold1_main %}
+{% block unfold_main %}
 
   <h1>User registration</h1>
 
index 2780d60..b942b17 100644 (file)
@@ -1,6 +1,6 @@
 {% extends "layout-unfold1.html" %}
 
-{% block unfold1_main %}        
+{% block unfold_main %}        
 
 <div class="onelab-title well well-lg">
   <h2>OneLab Experimenter Registration</h2>
index 27089a7..6346667 100644 (file)
@@ -4,7 +4,7 @@
 <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/dashboard.css" />
 {% endblock %}
 
-{% block unfold1_main %}
+{% block unfold_main %}
 
 <h1>Resource</h1>
 {{resource}}
index 7ea26ed..dc98c27 100644 (file)
@@ -1,6 +1,6 @@
 {% extends "layout-unfold1.html" %}
 
-{% block unfold1_main %}
+{% block unfold_main %}
 
   <h1>Slice request Received !</h1>
 
index 502e380..7c7a53f 100644 (file)
@@ -5,7 +5,7 @@
 {{ 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 -->
index baa5667..bfb08f1 100644 (file)
@@ -5,7 +5,7 @@
 <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}css/smart_wizard.css" />
 {% endblock %}
 
-{% block unfold1_main %}
+{% block unfold_main %}
 
   <h1>User registration</h1>
 
index 9e134cf..35b252e 100644 (file)
@@ -1,6 +1,6 @@
 {% extends "layout-unfold1.html" %}
 
-{% block unfold1_main %}
+{% block unfold_main %}
 
   <h1>User registration complete !</h1>
 
index 24a6dbc..c46fda3 100644 (file)
@@ -45,7 +45,7 @@
 </script>
 {% endblock %}
 
-{% block unfold1_main %}
+{% block unfold_main %}
 
 <h1>Pending requests</h1>
 
index 167f324..d454502 100644 (file)
@@ -62,7 +62,7 @@ class PresViewView(FreeAccessView):
         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
index a974226..f4bde8f 100644 (file)
@@ -65,8 +65,8 @@ def dashboard_view (request):
     # 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'
@@ -87,7 +87,7 @@ def dashboard_view (request):
         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')
index 491900a..f200312 100644 (file)
@@ -84,8 +84,8 @@ function issue_debug() {console.log("issue_debug");messages.debug("issue_debug")
 $(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' 
index 5d257a4..e1c66d8 100644 (file)
@@ -84,8 +84,8 @@ def test_plugin_view (request):
                                       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,
@@ -94,7 +94,7 @@ def test_plugin_view (request):
                                  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' 
index 5fa9400..f6f6b93 100644 (file)
@@ -1,6 +1,6 @@
 {% extends 'layout-unfold2.html' %}
 
-{% block unfold2_main %}
+{% block unfold_main %}
 
 {% insert_str prelude "css/sample.css" %}
 
@@ -11,9 +11,9 @@
 <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>
@@ -22,4 +22,4 @@
   <li><a href="#scrollDiv4" data-toggle="tab"> scroll4 </a></li>
 </ul>
 </div>
-{% endblock unfold2_margin %}
+{% endblock unfold_margin %}
index c3ba335..6b4472b 100644 (file)
@@ -1,6 +1,6 @@
 {% extends 'layout-unfold2.html' %}
 
-{% block unfold2_main %}
+{% block unfold_main %}
 
 {% insert_str prelude "css/sample.css" %}
 {% insert prelude_js %}
@@ -58,13 +58,13 @@ $(function() {$('#mylougout').click(foo);})
     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 %}
index 7626ab1..e1e4317 100644 (file)
@@ -1,9 +1,9 @@
 {% 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 %}
index fa796b9..7d3ee2e 100644 (file)
@@ -2,8 +2,8 @@
 
 {% 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 %}
index 345f57f..7022aa5 100644 (file)
@@ -2,13 +2,13 @@
 
 {% 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 %}
index 75a1009..8fc17f1 100644 (file)
@@ -1,5 +1,5 @@
 {% extends 'layout-unfold1.html' %}
 
-{% block unfold1_main %}
-{{ unfold1_main|safe }}
-{% endblock unfold1_main %}
+{% block unfold_main %}
+{{ unfold_main|safe }}
+{% endblock unfold_main %}