Example #1
0
def static(request, filepath):
    body = ''
    content_type = 'test/plain'

    try:
        body = util.static(filepath)
        if filepath.endswith('.css'):
            content_type = 'text/css'
        elif filepath.endswith('.js'):
            content_type = 'text/javascript'
        elif filepath.endswith('.html'):
            content_type = 'text/html'
    except:
        pass

    return dream.Response(body=body, content_type=content_type)
Example #2
0
 def media(self):
     return forms.Media(js=[static('xadmin/js/bootstrap-timepicker.js'), static("xadmin/js/widgets/datetime.js")],
         css={'screen': [static('xadmin/css/timepicker.css')]})
Example #3
0
 def media(self):
     return forms.Media(
         js=[static("xadmin/js/bootstrap-datepicker.js"), static("xadmin//js/widgets/datetime.js")],
         css={"screen": [static("xadmin/css/datepicker.css")]},
     )