Ejemplo n.º 1
0
 def default_media(self, request):
     if not request.is_xhr:
         settings = self.settings
         m = media.Media(settings=settings)
         m.add_js(media.jquery_paths(settings))
         m.add_js(media.bootstrap(settings))
         m.add_js(settings.DEFAULT_JAVASCRIPT)
         if settings.DEFAULT_STYLE_SHEET:
             m.add_css(settings.DEFAULT_STYLE_SHEET)
         if settings.STYLING:
             target = media.site_media_file(settings)
             if target:
                 m.add_css({'all': (target, )})
         m.add(self.media(request))
         return m
Ejemplo n.º 2
0
 def default_media(self, request):
     if not request.is_xhr:
         settings = self.settings
         m = media.Media(settings=settings)
         m.add_js(media.jquery_paths(settings))
         m.add_js(media.bootstrap(settings))
         m.add_js(settings.DEFAULT_JAVASCRIPT)
         if settings.DEFAULT_STYLE_SHEET:
             m.add_css(settings.DEFAULT_STYLE_SHEET)
         if settings.STYLING:
             target = media.site_media_file(settings)
             if target:
                 m.add_css({"all": (target,)})
         m.add(self.media(request))
         return m
Ejemplo n.º 3
0
 def handle(self, options, dump=True):
     site = self.website(options)
     target = options.file
     mediaurl = options.mediaurl
     apps = options.apps
     self.theme = options.theme or site.settings.STYLING
     if not target and not options.variables:
         target = '{0}.css'.format(self.theme)
         target = site_media_file(site.settings, target, directory=True)\
                  or target
     data = render(site, self.theme, apps, mediaurl, options.variables)
     if dump:
         if target:
             with open(target, 'w') as f:
                 f.write(data)
         else:
             print(data)
     return data
Ejemplo n.º 4
0
 def handle(self, options, dump=True):
     site = self.website(options)
     target = options.file
     mediaurl = options.mediaurl
     apps = options.apps
     self.theme = options.theme or site.settings.STYLING
     if not target and not options.variables:
         target = '{0}.css'.format(self.theme)
         target = site_media_file(site.settings, target, directory=True)\
                  or target
     data = render(site, self.theme, apps, mediaurl, options.variables)
     if dump:
         if target:
             with open(target, 'w') as f:
                 f.write(data)
         else:
             print(data)
     return data