@find . -type f -name '*.js' | grep -v '/all-static/'
list-css: force
@find . -type f -name '*.css' | grep -v '/all-static/'
+list-img:
+ @find . -type f -name '*.png' | grep -v '/all-static/'
#################### manage static contents (extract from all the modules into the single all-static location)
static: force
def insert (self, plugin):
self.sons.append(plugin)
- def render_env (self, request):
+ def template_env (self, request):
# this is designed so as to support a template like
# {% for son in sons %} {{ son.rendered }} ...
return { 'sons':
# xxx need a way to select an active son, like e.g.
# Composite (active='some string')
# and we could then try to find that string in either title or uuid or some other place
- # in which case the corresponding 'son' entry in render_env above would son.active=True
+ # in which case the corresponding 'son' entry in template_env above would son.active=True
# you may redefine this completely, but if you don't we'll just use methods
# . template() to find out which template to use, and
- # . render_env() to compute a dictionary to pass along to the templating system
+ # . template_env() to compute a dictionary to pass along to the templating system
def render_content (self, request):
"""Should return an HTML fragment"""
template = self.template()
- env=self.render_env(request)
+ env=self.template_env(request)
if not isinstance (env,dict):
- raise Exception, "%s.render_env returns wrong type"%self.classname()
+ raise Exception, "%s.template_env returns wrong type"%self.classname()
# expose this class's settings to the template
# xxx we might need to check that this does not overwrite env..
env.update(self._settings)
# -- or --
# (*) def template(self) -> filename
# relative to STATIC
- # (*) def render_env (self, request) -> dict
+ # (*) def template_env (self, request) -> dict
# this is the variable->value association used to render the template
# in which case the html template will be used
# if you see this string somewhere your template() code is not kicking in
def template (self): return "undefined_template"
- def render_env (self, request): return {}
+ def template_env (self, request): return {}
# # tell the framework about requirements (for the document <header>)
# # the notion of 'Media' in django provides for medium-dependant
# probably insert_above is not powerful enough to handle that
#
# so a much simpler and safer approach is for use to compute the html header directly
- def render_env (self):
+ def template_env (self):
env={}
env['js_files']= self.js_files
env['css_files']= self.css_files
# request.plugin_prelude holds a summary of the requirements() for all plugins
# define {js,css}_{files,chunks}
- prelude_env = request.plugin_prelude.render_env()
+ prelude_env = request.plugin_prelude.template_env()
print 'prelude_env',prelude_env
template_env.update(prelude_env)
@login_required
def tab_view (request):
prelude=Prelude( js_files='bootstrap/js/bootstrap.js', css_files='bootstrap/css/bootstrap.css')
- prelude_env = prelude.render_env()
+ prelude_env = prelude.template_env()
tab_env = {'title':'Page for playing with Tabs',
'topmenu_items': topmenu_items('tab',request),
'username':the_user (request),