the 'plugin' page is now for standalone testing
[myslice.git] / trash / pluginview.py
1 # Create your views here.
2
3 from django.core.context_processors import csrf
4 from django.template import RequestContext
5 from django.template.loader import render_to_string
6 from django.shortcuts import render_to_response
7
8 from django.contrib.auth.decorators import login_required
9
10 from unfold.page import Page
11
12 from plugins.stack.stack import Stack
13 from plugins.tabs.tabs import Tabs
14 from plugins.lists.staticlist import StaticList
15 from plugins.quickfilter.quickfilter import QuickFilter
16 from plugins.raw.raw import Raw
17 from plugins.messages.messages import Messages
18
19 from myslice.viewutils import topmenu_items, the_user
20 from myslice.viewutils import hard_wired_slice_names, hard_wired_list, lorem_p, lorem, quickfilter_criterias
21
22 @login_required
23 def test_plugin_view (request):
24
25     page = Page(request)
26     
27     # variables that will get passed to this template
28     template_env = {}
29     
30     main_plugin = \
31             Messages (
32                 page=page,
33                 title="Runtime messages",
34                 domid="msgs-pre",
35                 )
36
37     # define 'unfold1_main' to the template engine
38     template_env [ 'unfold1_main' ] = main_plugin.render(request)
39
40     # more general variables expected in the template
41     template_env [ 'title' ] = 'Single Plugin View' 
42     template_env [ 'topmenu_items' ] = topmenu_items('plugin', request) 
43     template_env [ 'username' ] = the_user (request) 
44
45     # we don't have anythong asynchroneous, and manifold.js is not loaded
46 #    page.exec_queue_asynchroneously ()
47
48     # the prelude object in page contains a summary of the requirements() for all plugins
49     # define {js,css}_{files,chunks}
50     prelude_env = page.prelude_env()
51     template_env.update(prelude_env)
52     return render_to_response ('view-unfold1.html',template_env,
53                                context_instance=RequestContext(request))
54