clean the main layout now known as unfold1, including for the 2 pieces (unfold1_main...
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Wed, 20 Mar 2013 07:36:54 +0000 (08:36 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Wed, 20 Mar 2013 07:36:54 +0000 (08:36 +0100)
17 files changed:
plugins/lists/simplelist.js
plugins/lists/simplelist.py
trash/dashboard.py
trash/pluginview.py
trash/sampleviews.py
trash/templates/view-plugin.html
trash/templates/view-scroll.html
trash/templates/view-slice.html
trash/templates/view-tab.html
unfold/js/unfold-helper.js [new file with mode: 0644]
unfold/prelude.py
views/css/layout-unfold1.css [new file with mode: 0644]
views/css/myslice.css [deleted file]
views/js/myslice.js [deleted file]
views/templates/layout-unfold1.html [moved from views/templates/layout-myslice.html with 73% similarity]
views/templates/view-login.html
views/templates/view-logout.html

index 147bd44..e883759 100644 (file)
        $plugindiv.closest('.need-spin').spin(false);
 
         if (rows.length == 0) {
-           if (use_datatables) datatables_set_message ($table, $tbody, myslice_warning("No result"));
-           else                regular_set_message ($table, $tbody, myslice_warning("No result"));
+           if (use_datatables) datatables_set_message ($table, $tbody, unfold.warning("No result"));
+           else                regular_set_message ($table, $tbody, unfold.warning("No result"));
             return;
         }
         if (typeof rows[0].error != 'undefined') {
            var error="ERROR: " + rows[0].error;
-           if (use_datatables) datatables_set_message ($table, $tbody, myslice_error(error));
-           else                regular_set_message ($table, $tbody, myslice_error(error));
+           if (use_datatables) datatables_set_message ($table, $tbody, unfold.error(error));
+           else                regular_set_message ($table, $tbody, unfold.error(error));
             return;
         }
         var options = $plugindiv.data().SimpleList;
index bf0120c..69e47aa 100644 (file)
@@ -25,7 +25,7 @@ class SimpleList (Plugin) :
             'js_files' : [ "js/simplelist.js", 
                            "js/manifold.js", "js/manifold-query.js", 
                            "js/spin.presets.js", "js/spin.min.js", "js/jquery.spin.js", 
-                           "js/myslice.js",
+                           "js/unfold-helper.js",
                            ] ,
             'css_files': [ "css/simplelist.css" ],
             }
index 969149c..74493af 100644 (file)
@@ -65,8 +65,8 @@ def dashboard_view (request):
     # variables that will get passed to the view-plugin.html template
     template_env = {}
     
-    # define 'content_main' to the template engine
-    template_env [ 'content_main' ] = main_plugin.render(request)
+    # define 'unfold1_main' to the template engine
+    template_env [ 'unfold1_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 [ 'content_related' ] = related_plugin.render (request)
+    template_env [ 'unfold1_margin' ] = related_plugin.render (request)
     
     # add our own css in the mix
     page.add_css_files ( 'css/dashboard.css')
index 5c996f8..1bfbb8c 100644 (file)
@@ -60,8 +60,8 @@ def test_plugin_view (request):
                                       title='QuickFilter in main content',
                                       criterias=quickfilter_criterias,
                                       ) ] )
-    # define 'content_main' to the template engine
-    template_env [ 'content_main' ] = main_plugin.render(request)
+    # define 'unfold1_main' to the template engine
+    template_env [ 'unfold1_main' ] = main_plugin.render(request)
 
     ##########
     related_plugin = StaticList (page=page,
@@ -70,7 +70,7 @@ def test_plugin_view (request):
                                  list=hard_wired_slice_names, 
                                  header='Slices')
     # likewise but on the side view
-    template_env [ 'content_related' ] = related_plugin.render (request)
+    template_env [ 'unfold1_margin' ] = related_plugin.render (request)
 
     # more general variables expected in the template
     template_env [ 'title' ] = 'Test Plugin View' 
index bb47262..4733402 100644 (file)
@@ -44,7 +44,7 @@ def slice_view (request, name=None):
                                 'topmenu_items' : topmenu_items('slice',request),
                                 'username':the_user (request),
                                 'slices': hard_wired_slice_names,
-                                'content_main' : lorem,
+                                'unfold1_main' : lorem,
                                 },
                                context_instance=RequestContext(request))
 
index f33256b..33610b8 100644 (file)
@@ -1,9 +1,9 @@
-{% extends 'layout-myslice.html' %}
+{% extends 'layout-unfold1.html' %}
 
-{% block content_main %}
-{{ content_main|safe }}
-{% endblock content_main %}
+{% block unfold1_main %}
+{{ unfold1_main|safe }}
+{% endblock unfold1_main %}
 
-{% block content_related %}
-{{ content_related|safe }}
-{% endblock content_related %}
+{% block unfold1_margin %}
+{{ unfold1_margin|safe }}
+{% endblock unfold1_margin %}
index 4d0122c..0755e81 100644 (file)
@@ -1,6 +1,6 @@
-{% extends 'layout-myslice.html' %}
+{% extends 'layout-unfold1.html' %}
 
-{% block content_main %}
+{% block unfold1_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 content_main %}
+{% endblock unfold1_main %}
 
-{% block content_related %}
+{% block unfold1_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 content_related %}
+{% endblock unfold1_margin %}
index 03e5d27..e6560f4 100644 (file)
@@ -1,11 +1,11 @@
 {# -*-django-html-mumamo-mode-*- #}
-{% extends 'layout-myslice.html' %}
+{% extends 'layout-unfold1.html' %}
 
-{% block content_main %}
+{% block unfold1_main %}
 {% if name %}
 <p class='well'>We're getting the variable <code>name= {{ name }}</code> from the URL </p>
 {% else %}
 <p class='well'>This URL is not valid, you need to pass a slice name like in <a href="/slice/my.slice.name">/slice/my.slice.name</a></p>
 {% endif %}
-{% endblock content_main %}
+{% endblock unfold1_main %}
 
index e497523..94a541a 100644 (file)
@@ -1,6 +1,6 @@
-{% extends 'layout-myslice.html' %}
+{% extends 'layout-unfold1.html' %}
 
-{% block content_main %}
+{% block unfold1_main %}
 
 {% insert_str prelude "css/sample.css" %}
 {% insert prelude_js %}
@@ -24,6 +24,7 @@ $(function(){console.log('hey!');$('#tooltipid').tooltip({'selector':'','placeme
 </div>   
 </div>
 
+<p>Let's see what a <button class='unfold-warning btn btn-warning'>warning button</button> looks like.</p>
 
 <div class='well'> a sample of the 'well' class quis nostrud exercitation </div>
 
@@ -51,13 +52,13 @@ a first <a id='tooltipid' href="#" data-toggle="tooltip" data-original-title="wh
     decima et quinta decima. Eodem modo typi, qui nunc nobis videntur
     parum clari, fiant sollemnes in futurum.
   </div>
-{% endblock content_main %}
+{% endblock unfold1_main %}
 
-{% block content_related %}
+{% block unfold1_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 content_related %}
+{% endblock unfold1_margin %}
diff --git a/unfold/js/unfold-helper.js b/unfold/js/unfold-helper.js
new file mode 100644 (file)
index 0000000..6d8e01c
--- /dev/null
@@ -0,0 +1,8 @@
+var unfold = {
+    warning:function(text){ 
+       return "<button class='unfold-warning btn btn-warning'>"+text+"</button>"; 
+    },
+    error : function(text){ 
+       return "<button class='unfold-error btn btn-error'>"+text+"</button>"; 
+    },
+} // global unfold
index 9492e80..0d93822 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-myslice.html
+    # together with this in layout-unfold1.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, 
diff --git a/views/css/layout-unfold1.css b/views/css/layout-unfold1.css
new file mode 100644 (file)
index 0000000..ab6af8a
--- /dev/null
@@ -0,0 +1,7 @@
+/* this relates to the unfold-layout1 template */
+#unfold1-main {
+}
+#unfold1-margin {
+    padding: 10;
+    background-color: #fff2ff;
+}
diff --git a/views/css/myslice.css b/views/css/myslice.css
deleted file mode 100644 (file)
index 9ae36c6..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#content-main {
-}
-#content-related {
-    padding: 10;
-    background-color: #fff2ff;
-}
-span.myslice-warning { background-color: orange; }
-span.myslice-error { background-color: red; }
diff --git a/views/js/myslice.js b/views/js/myslice.js
deleted file mode 100644 (file)
index 644a3d0..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-function myslice_warning(text){ return "<span class='myslice-warning'>"+text+"</span>"; }
-function myslice_error(text){ return "<span class='myslice-error'>"+text+"</span>"; }
similarity index 73%
rename from views/templates/layout-myslice.html
rename to views/templates/layout-unfold1.html
index 1d14812..1bd75e4 100644 (file)
@@ -9,9 +9,8 @@
 {{ header_prelude }}
 </head>{# let's add these ones no matter what #}
 {% insert_str prelude "js/jquery.js" %}
-{# {% insert prelude_js %} jQuery.noConflict(); {% endinsert %} #}
 {% insert_str prelude "js/init-all-plugins.js" %}
-{% insert_str prelude "css/myslice.css" %}
+{% insert_str prelude "css/layout-unfold1.css" %}
 <body>
 {% block container %}
 <div id="container">
   {% endblock topmenu %}
 <div class="container-fluid">
   <div class="row-fluid">
-    <div id="content-main" class="span9 columns">
-      {% block content_main %}
-      "The main content area (define block 'content_main')"
-      {% endblock content_main %}
+    <div id="unfold1-main" class="span9 columns">
+      {% block unfold1_main %}
+      "The main content area (define block 'unfold1_main')"
+      {% endblock unfold1_main %}
     </div><!--span9-->
-    <div id='content-related' class='span3'>
-      {% block content_related %}
+    <div id='unfold1-margin' class='span3'>
+      {% block unfold1_margin %}
       "The related content area (define block 'related_main')"
-      {% endblock content_related %}
+      {% endblock unfold1_margin %}
     </div><!--span3-->
   </div><!--raw-fluid-->
 </div><!--container-fluid-->
index d4c976c..c17ae5d 100644 (file)
@@ -1,10 +1,10 @@
-{% extends 'layout-myslice.html' %}
+{% extends 'layout-unfold1.html' %}
 
-{% block content_related %}
+{% block unfold1_margin %}
 {% include 'widget-login.html' %}
-{% endblock content_related %}
+{% endblock unfold1_margin %}
 
-{% block content_main %}
+{% block unfold1_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 content_main %}
+{% endblock unfold1_main %}
index 0433628..16b3cf4 100644 (file)
@@ -1,6 +1,6 @@
-{% extends 'layout-myslice.html' %}
+{% extends 'layout-unfold1.html' %}
 
-{% block content_main %}
+{% block unfold1_main %}
 {% include 'widget-logout.html' %}
 {% endblock %}