fix various names and add various missing stuff for a plugin view
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 10 Dec 2012 19:26:46 +0000 (20:26 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 10 Dec 2012 19:26:46 +0000 (20:26 +0100)
engine/plugin.py
engine/views.py
slice/views.py
templates/view-plugin.html [new file with mode: 0644]

index b766ad7..a76881a 100644 (file)
@@ -37,7 +37,7 @@ class Plugin:
         # compute an 'optionstr' from the set of available settings/options as a json string
         # that gets passed to jquery somehow
         # see the bottom of 
-        result = render_to_string ('plugin-wrap.html',
+        result = render_to_string ('widget-plugin.html',
                                    {'uuid':uuid, 'title':title,
                                     'visible':self.is_visible(),
                                     'hidable':self.is_hidable(),
index f7996a2..56c375e 100644 (file)
@@ -7,6 +7,8 @@ from django.shortcuts import render_to_response
 
 from plugins.simplelist import SimpleList
 
+from slice.views import menu_items, the_user
+
 def test_plugin_view (request):
     
     test_plugin = SimpleList (visible=True, hidable=True)
@@ -16,7 +18,11 @@ def test_plugin_view (request):
     print plugin_content
     print '--------------------'
 
-    return render_to_response ('test-plugin.html',
-                               {'content_main' : plugin_content},
+    return render_to_response ('view-plugin.html',
+                               {'title': 'Test Plugin View',
+                                'menu_items': menu_items('plugin', request),
+                                'content_main' : plugin_content,
+                                'username' : the_user (request),
+                                },
                                context_instance=RequestContext(request))
                                
index 76987a7..ce951ff 100644 (file)
@@ -13,6 +13,7 @@ Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh
 standard_menu_items = [ { 'label':'Slice view',  'href': '/slice/'},
                         { 'label':'Scroll view', 'href': '/scroll/'},
                         { 'label':'Tab view', 'href': '/tab/'},
+                        { 'label':'Mini plugin', 'href': '/plugin/'},
                         ]
 
 login_out_items = { False: { 'label':'Login', 'href':'/login/'},
diff --git a/templates/view-plugin.html b/templates/view-plugin.html
new file mode 100644 (file)
index 0000000..8413732
--- /dev/null
@@ -0,0 +1,5 @@
+{% extends 'layout-myslice.html' %}
+
+{% block content_main %}
+{{ content_main }}
+{% endblock content_main %}