From 5741daf5436565a4090495e7c3a1e6cb2c445b52 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 20 Mar 2013 08:36:54 +0100 Subject: [PATCH] clean the main layout now known as unfold1, including for the 2 pieces (unfold1_main and unfold1_margin) --- plugins/lists/simplelist.js | 8 ++++---- plugins/lists/simplelist.py | 2 +- trash/dashboard.py | 6 +++--- trash/pluginview.py | 6 +++--- trash/sampleviews.py | 2 +- trash/templates/view-plugin.html | 14 +++++++------- trash/templates/view-scroll.html | 10 +++++----- trash/templates/view-slice.html | 6 +++--- trash/templates/view-tab.html | 11 ++++++----- unfold/js/unfold-helper.js | 8 ++++++++ unfold/prelude.py | 2 +- views/css/layout-unfold1.css | 7 +++++++ views/css/myslice.css | 8 -------- views/js/myslice.js | 2 -- ...{layout-myslice.html => layout-unfold1.html} | 17 ++++++++--------- views/templates/view-login.html | 10 +++++----- views/templates/view-logout.html | 4 ++-- 17 files changed, 64 insertions(+), 59 deletions(-) create mode 100644 unfold/js/unfold-helper.js create mode 100644 views/css/layout-unfold1.css delete mode 100644 views/css/myslice.css delete mode 100644 views/js/myslice.js rename views/templates/{layout-myslice.html => layout-unfold1.html} (73%) diff --git a/plugins/lists/simplelist.js b/plugins/lists/simplelist.js index 147bd447..e883759a 100644 --- a/plugins/lists/simplelist.js +++ b/plugins/lists/simplelist.js @@ -72,14 +72,14 @@ $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; diff --git a/plugins/lists/simplelist.py b/plugins/lists/simplelist.py index bf0120c9..69e47aa5 100644 --- a/plugins/lists/simplelist.py +++ b/plugins/lists/simplelist.py @@ -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" ], } diff --git a/trash/dashboard.py b/trash/dashboard.py index 969149c7..74493af9 100644 --- a/trash/dashboard.py +++ b/trash/dashboard.py @@ -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') diff --git a/trash/pluginview.py b/trash/pluginview.py index 5c996f83..1bfbb8c2 100644 --- a/trash/pluginview.py +++ b/trash/pluginview.py @@ -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' diff --git a/trash/sampleviews.py b/trash/sampleviews.py index bb472628..47334028 100644 --- a/trash/sampleviews.py +++ b/trash/sampleviews.py @@ -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)) diff --git a/trash/templates/view-plugin.html b/trash/templates/view-plugin.html index f33256bd..33610b82 100644 --- a/trash/templates/view-plugin.html +++ b/trash/templates/view-plugin.html @@ -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 %} diff --git a/trash/templates/view-scroll.html b/trash/templates/view-scroll.html index 4d0122c4..0755e81c 100644 --- a/trash/templates/view-scroll.html +++ b/trash/templates/view-scroll.html @@ -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 @@
scroll3 area {{ lorem }}
scroll4 area {{ lorem }} {{ lorem }} {{ lorem }}
-{% endblock content_main %} +{% endblock unfold1_main %} -{% block content_related %} +{% block unfold1_margin %}
-{% endblock content_related %} +{% endblock unfold1_margin %} diff --git a/trash/templates/view-slice.html b/trash/templates/view-slice.html index 03e5d276..e6560f45 100644 --- a/trash/templates/view-slice.html +++ b/trash/templates/view-slice.html @@ -1,11 +1,11 @@ {# -*-django-html-mumamo-mode-*- #} -{% extends 'layout-myslice.html' %} +{% extends 'layout-unfold1.html' %} -{% block content_main %} +{% block unfold1_main %} {% if name %}

We're getting the variable name= {{ name }} from the URL

{% else %}

This URL is not valid, you need to pass a slice name like in /slice/my.slice.name

{% endif %} -{% endblock content_main %} +{% endblock unfold1_main %} diff --git a/trash/templates/view-tab.html b/trash/templates/view-tab.html index e497523b..94a541aa 100644 --- a/trash/templates/view-tab.html +++ b/trash/templates/view-tab.html @@ -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 +

Let's see what a looks like.

a sample of the 'well' class quis nostrud exercitation
@@ -51,13 +52,13 @@ a first "+text+""; + }, + error : function(text){ + return ""; + }, +} // global unfold diff --git a/unfold/prelude.py b/unfold/prelude.py index 9492e806..0d93822f 100644 --- a/unfold/prelude.py +++ b/unfold/prelude.py @@ -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 index 00000000..ab6af8af --- /dev/null +++ b/views/css/layout-unfold1.css @@ -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 index 9ae36c6e..00000000 --- a/views/css/myslice.css +++ /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 index 644a3d0d..00000000 --- a/views/js/myslice.js +++ /dev/null @@ -1,2 +0,0 @@ -function myslice_warning(text){ return ""+text+""; } -function myslice_error(text){ return ""+text+""; } diff --git a/views/templates/layout-myslice.html b/views/templates/layout-unfold1.html similarity index 73% rename from views/templates/layout-myslice.html rename to views/templates/layout-unfold1.html index 1d148123..1bd75e47 100644 --- a/views/templates/layout-myslice.html +++ b/views/templates/layout-unfold1.html @@ -9,9 +9,8 @@ {{ header_prelude }} {# 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" %} {% block container %}
@@ -20,15 +19,15 @@ {% endblock topmenu %}
-
- {% block content_main %} - "The main content area (define block 'content_main')" - {% endblock content_main %} +
+ {% block unfold1_main %} + "The main content area (define block 'unfold1_main')" + {% endblock unfold1_main %}
-
diff --git a/views/templates/view-login.html b/views/templates/view-login.html index d4c976c0..c17ae5d7 100644 --- a/views/templates/view-login.html +++ b/views/templates/view-login.html @@ -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 %} This page is currently connected to two authentication systems:
  • A manifold server, located at {{ manifold_url }}, (configured in myslice/config.py), and
  • @@ -17,4 +17,4 @@ Currently hard wired users are: {% endfor %}
-{% endblock content_main %} +{% endblock unfold1_main %} diff --git a/views/templates/view-logout.html b/views/templates/view-logout.html index 0433628f..16b3cf45 100644 --- a/views/templates/view-logout.html +++ b/views/templates/view-logout.html @@ -1,6 +1,6 @@ -{% extends 'layout-myslice.html' %} +{% extends 'layout-unfold1.html' %} -{% block content_main %} +{% block unfold1_main %} {% include 'widget-logout.html' %} {% endblock %} -- 2.43.0