1 # Create your views here.
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
8 from django.contrib.auth.decorators import login_required
10 from engine.manifoldquery import ManifoldQuery
12 #from plugins.verticallayout import VerticalLayout
13 #from plugins.tabs import Tabs
14 from plugins.simplelist import SimpleList
15 # from plugins.slicelist import SliceList
16 # from plugins.quickfilter import QuickFilter
17 # from plugins.raw import Raw
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
23 def dashboard_view (request):
25 slices_query = ManifoldQuery (action='get',
29 # xxx filter : should filter on the slices the logged user can see
30 # we don't have the user's hrn yet
31 # in addition this currently returns all slices anyways
34 # variables that will get passed to this template
37 main_plugin = SimpleList ( # setting visible attributes first
38 title='SimpleList and dataTables',
42 # this is required for the javascript code
48 # define 'content_main' to the template engine
49 template_env [ 'content_main' ] = main_plugin.render(request)
52 # # lacks a/href to /slice/%s
53 # related_plugin = SliceList (title='SliceList plugin',domid='slicelist1',
54 # with_datatables='yes',
55 # list=hard_wired_slice_names,
57 # # likewise but on the side view
58 # template_env [ 'content_related' ] = related_plugin.render (request)
60 # more general variables expected in the template
61 template_env [ 'title' ] = 'Test Plugin View'
62 template_env [ 'topmenu_items' ] = topmenu_items('dashboard', request)
63 template_env [ 'username' ] = the_user (request)
65 # request.plugin_prelude holds a summary of the requirements() for all plugins
66 # define {js,css}_{files,chunks}
67 prelude_env = request.plugin_prelude.template_env()
68 template_env.update(prelude_env)
70 return render_to_response ('view-plugin.html',template_env,
71 context_instance=RequestContext(request))