added new layout with a single column - use this for the slice view
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 22 Mar 2013 11:14:36 +0000 (12:14 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 22 Mar 2013 11:14:36 +0000 (12:14 +0100)
in the mix renamed unfold1 into unfold2 (1 has 1 column and 2 has 2 columns)

12 files changed:
trash/dashboard.py
trash/pluginview.py
trash/sliceview.py
trash/templates/view-plugin.html
trash/templates/view-scroll.html
trash/templates/view-slice.html [new file with mode: 0644]
trash/templates/view-tab.html
unfold/prelude.py
views/css/layout-unfold2.css [moved from views/css/layout-unfold1.css with 75% similarity]
views/templates/layout-unfold1.html
views/templates/layout-unfold2.html [new file with mode: 0644]
views/templates/view-login.html

index cbe8bd4..cd1ba3d 100644 (file)
@@ -68,8 +68,8 @@ def dashboard_view (request):
     # variables that will get passed to the view-plugin.html template
     template_env = {}
     
-    # define 'unfold1_main' to the template engine
-    template_env [ 'unfold1_main' ] = main_plugin.render(request)
+    # define 'unfold2_main' to the template engine
+    template_env [ 'unfold2_main' ] = main_plugin.render(request)
 
     # more general variables expected in the template
     template_env [ 'title' ] = 'Test view for a full request cycle'
@@ -90,7 +90,7 @@ def dashboard_view (request):
         query=slices_query,
         )
     # likewise but on the side view
-    template_env [ 'unfold1_margin' ] = related_plugin.render (request)
+    template_env [ 'unfold2_margin' ] = related_plugin.render (request)
     
     # add our own css in the mix
     page.add_css_files ( 'css/dashboard.css')
index c836c76..c2939e1 100644 (file)
@@ -67,8 +67,8 @@ def test_plugin_view (request):
                                       title='QuickFilter in main content',
                                       criterias=quickfilter_criterias,
                                       ) ] )
-    # define 'unfold1_main' to the template engine
-    template_env [ 'unfold1_main' ] = main_plugin.render(request)
+    # define 'unfold2_main' to the template engine
+    template_env [ 'unfold2_main' ] = main_plugin.render(request)
 
     ##########
     related_plugin = StaticList (page=page,
@@ -77,7 +77,7 @@ def test_plugin_view (request):
                                  list=hard_wired_slice_names, 
                                  header='Slices')
     # likewise but on the side view
-    template_env [ 'unfold1_margin' ] = related_plugin.render (request)
+    template_env [ 'unfold2_margin' ] = related_plugin.render (request)
 
     # more general variables expected in the template
     template_env [ 'title' ] = 'Test Plugin View' 
index 4f4202d..a1048bd 100644 (file)
@@ -76,7 +76,7 @@ def slice_view (request, slicename=tmp_default_slice):
     # variables that will get passed to the view-plugin.html template
     template_env = {}
     
-    # define 'unfold1_main' to the template engine
+    # define 'unfold2_main' to the template engine
     template_env [ 'unfold1_main' ] = main_plugin.render(request)
 
     # more general variables expected in the template
@@ -98,7 +98,7 @@ def slice_view (request, slicename=tmp_default_slice):
 ###         query=main_query,
 ###         )
 ###     # likewise but on the side view
-###     template_env [ 'unfold1_margin' ] = related_plugin.render (request)
+###     template_env [ 'unfold2_margin' ] = related_plugin.render (request)
 ###     
 ###     # add our own css in the mix
 ###     page.add_css_files ( 'css/hazelnut.css')
@@ -113,5 +113,7 @@ def slice_view (request, slicename=tmp_default_slice):
     # define {js,css}_{files,chunks}
     prelude_env = page.prelude_env()
     template_env.update(prelude_env)
-    return render_to_response ('view-plugin.html',template_env,
+    result=render_to_response ('view-slice.html',template_env,
                                context_instance=RequestContext(request))
+    print 'result=',result
+    return result
index 33610b8..7626ab1 100644 (file)
@@ -1,9 +1,9 @@
-{% extends 'layout-unfold1.html' %}
+{% extends 'layout-unfold2.html' %}
 
-{% block unfold1_main %}
-{{ unfold1_main|safe }}
-{% endblock unfold1_main %}
+{% block unfold2_main %}
+{{ unfold2_main|safe }}
+{% endblock unfold2_main %}
 
-{% block unfold1_margin %}
-{{ unfold1_margin|safe }}
-{% endblock unfold1_margin %}
+{% block unfold2_margin %}
+{{ unfold2_margin|safe }}
+{% endblock unfold2_margin %}
index 0755e81..5fa9400 100644 (file)
@@ -1,6 +1,6 @@
-{% extends 'layout-unfold1.html' %}
+{% extends 'layout-unfold2.html' %}
 
-{% block unfold1_main %}
+{% block unfold2_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 unfold1_main %}
+{% endblock unfold2_main %}
 
-{% block unfold1_margin %}
+{% block unfold2_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 unfold1_margin %}
+{% endblock unfold2_margin %}
diff --git a/trash/templates/view-slice.html b/trash/templates/view-slice.html
new file mode 100644 (file)
index 0000000..75a1009
--- /dev/null
@@ -0,0 +1,5 @@
+{% extends 'layout-unfold1.html' %}
+
+{% block unfold1_main %}
+{{ unfold1_main|safe }}
+{% endblock unfold1_main %}
index 2cc6817..c3ba335 100644 (file)
@@ -1,6 +1,6 @@
-{% extends 'layout-unfold1.html' %}
+{% extends 'layout-unfold2.html' %}
 
-{% block unfold1_main %}
+{% block unfold2_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 unfold1_main %}
+{% endblock unfold2_main %}
 
-{% block unfold1_margin %}
+{% block unfold2_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 unfold1_margin %}
+{% endblock unfold2_margin %}
index 0d93822..f576ed3 100644 (file)
@@ -48,7 +48,7 @@ class Prelude:
     #    env['js_chunks']= '\n'.join(self.js_chunks)
     #    env['css_chunks']='\n'.join(self.css_chunks)
     #    return env
-    # together with this in layout-unfold1.html
+    # together with this in layout-unfold2.html
     # {% for js_file in js_files %} {% insert_str prelude js_file %} {% endfor %}
     # {% for css_file in css_files %} {% insert_str prelude css_file %} {% endfor %}
     # somehow however this would not work too well, 
similarity index 75%
rename from views/css/layout-unfold1.css
rename to views/css/layout-unfold2.css
index ab6af8a..d91775c 100644 (file)
@@ -1,7 +1,7 @@
 /* this relates to the unfold-layout1 template */
-#unfold1-main {
+#unfold2-main {
 }
-#unfold1-margin {
+#unfold2-margin {
     padding: 10;
     background-color: #fff2ff;
 }
index 9f7de2c..8ce6cdc 100644 (file)
@@ -1,5 +1,4 @@
-{# This is required by insert_above #}{% insert_handler %}
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+{# This is required by insert_above #}{% insert_handler %}<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
 <html lang="en"> <head>
 <title> MySlice - {{ title }} </title>
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -8,7 +7,7 @@
 <style type="text/css">{# In case we need to add raw css code #}{% container prelude_css %}</style>
 {{ header_prelude }}
 </head>{# let's add these ones no matter what #}
-{% insert_str prelude "css/layout-unfold1.css" %}
+{# not yet needed {% insert_str prelude "css/layout-unfold1.css" %} #}
 {% insert_str prelude "js/jquery.js" %}
 {% insert_str prelude "js/init-all-plugins.js" %}
 <body>
   {% endblock topmenu %}
 <div class="container-fluid">
   <div class="row-fluid">
-    <div id="unfold1-main" class="span9 columns">
+    <div id="unfold1-main" class="span12 columns">
       {% block unfold1_main %}
       "The main content area (define block 'unfold1_main')"
       {% endblock unfold1_main %}
-    </div><!--span9-->
-    <div id='unfold1-margin' class='span3'>
-      {% block unfold1_margin %}
-      "The related content area (define block 'related_main')"
-      {% endblock unfold1_margin %}
-    </div><!--span3-->
+    </div><!--span12-->
   </div><!--raw-fluid-->
 </div><!--container-fluid-->
 {% endblock container %}
diff --git a/views/templates/layout-unfold2.html b/views/templates/layout-unfold2.html
new file mode 100644 (file)
index 0000000..75c3087
--- /dev/null
@@ -0,0 +1,35 @@
+{# This is required by insert_above #}{% insert_handler %}<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html lang="en"> <head>
+<title> MySlice - {{ title }} </title>
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+{# This is where insert_str will end up #}{% media_container prelude %}
+<script type="text/javascript"> {# raw js code - use {% insert prelude_js %} ... {% endinsert %} #} {% container prelude_js %}</script>
+<style type="text/css">{# In case we need to add raw css code #}{% container prelude_css %}</style>
+{{ header_prelude }}
+</head>{# let's add these ones no matter what #}
+{% insert_str prelude "css/layout-unfold2.css" %}
+{% insert_str prelude "js/jquery.js" %}
+{% insert_str prelude "js/init-all-plugins.js" %}
+<body>
+{% block container %}
+<div id="container">
+  {% block topmenu %}
+  {% include 'widget-topmenu.html' %}
+  {% endblock topmenu %}
+<div class="container-fluid">
+  <div class="row-fluid">
+    <div id="unfold2-main" class="span9 columns">
+      {% block unfold2_main %}
+      "The main content area (define block 'unfold2_main')"
+      {% endblock unfold2_main %}
+    </div><!--span9-->
+    <div id='unfold2-margin' class='span3'>
+      {% block unfold2_margin %}
+      "The related content area (define block 'related_main')"
+      {% endblock unfold2_margin %}
+    </div><!--span3-->
+  </div><!--raw-fluid-->
+</div><!--container-fluid-->
+{% endblock container %}
+</body>
+</html>
index c17ae5d..6cd126e 100644 (file)
@@ -1,10 +1,10 @@
-{% extends 'layout-unfold1.html' %}
+{% extends 'layout-unfold2.html' %}
 
-{% block unfold1_margin %}
+{% block unfold2_margin %}
 {% include 'widget-login.html' %}
-{% endblock unfold1_margin %}
+{% endblock unfold2_margin %}
 
-{% block unfold1_main %}
+{% block unfold2_main %}
 <code> This page is currently connected to two authentication systems:</code>
 <ul>
 <li> A manifold server, located at <code>{{ manifold_url }}</code>, (configured in <code>myslice/config.py</code>), and</li>
@@ -17,4 +17,4 @@ Currently hard wired users are:
   {% endfor %}
 </ul>
 </li></ul>
-{% endblock unfold1_main %}
+{% endblock unfold2_main %}