示例#1
0
文件: __init__.py 项目: tourist/lux
 def uiview(self, request, context):
     '''Wrap the ``main`` html with a ``ui-view`` container.
     Add animation class if specified in :setting:`ANGULAR_VIEW_ANIMATE`.
     '''
     app = request.app
     main = context.get('html_main', '')
     main = Html('div', main, cn='hidden', id="seo-view")
     div = Html('div', main, cn='angular-view')
     animate = app.config['ANGULAR_VIEW_ANIMATE']
     if animate:
         add_ng_modules(request.html_document, ('ngAnimate',))
         div.addClass(animate)
     div.data('ui-view', 'main')
     return div.render()
示例#2
0
 def uiview(self, request, context):
     '''Wrap the ``main`` html with a ``ui-view`` container.
     Add animation class if specified in :setting:`ANGULAR_VIEW_ANIMATE`.
     '''
     app = request.app
     main = context.get('html_main', '')
     main = Html('div', main, cn='hidden', id="seo-view")
     div = Html('div', main, cn='angular-view')
     animate = app.config['ANGULAR_VIEW_ANIMATE']
     if animate:
         add_ng_modules(request.html_document, ('ngAnimate', ))
         div.addClass(animate)
     div.data('ui-view', 'main')
     return div.render()
示例#3
0
 def get(self, request):
     """The home page of this router"""
     ul = Html("ul")
     for router in sorted(self.routes, key=lambda r: r.creation_count):
         a = router.link(escape(router.route.path))
         li = Html("li", a, " %s" % router.parameters.get("title", ""))
         ul.append(li)
     title = "Pulsar HttpBin"
     html = request.html_document
     html.head.title = title
     html.head.links.append("/media/httpbin.css")
     html.head.scripts.append("//code.jquery.com/jquery.min.js")
     html.head.scripts.append("/media/httpbin.js")
     ul = ul.render(request)
     body = template() % (title, version, ul, pyversion, JAPANESE)
     html.body.append(body)
     return html.http_response(request)
示例#4
0
 def get(self, request):
     '''The home page of this router'''
     ul = Html('ul')
     for router in sorted(self.routes, key=lambda r: r.creation_count):
         a = router.link(escape(router.route.path))
         li = Html('li', a, ' %s' % router.parameters.get('title', ''))
         ul.append(li)
     title = 'Pulsar HttpBin'
     html = request.html_document
     html.head.title = title
     html.head.links.append('/media/httpbin.css')
     html.head.scripts.append('//code.jquery.com/jquery.min.js')
     html.head.scripts.append('/media/httpbin.js')
     ul = ul.render(request)
     body = template() % (title, version, ul, pyversion, JAPANESE)
     html.body.append(body)
     return html.http_response(request)
示例#5
0
 def get(self, request):
     '''The home page of this router'''
     ul = Html('ul')
     for router in sorted(self.routes, key=lambda r: r.creation_count):
         a = router.link(escape(router.route.path))
         li = Html('li', a, ' %s' % router.parameters.get('title', ''))
         ul.append(li)
     title = 'Pulsar HttpBin'
     html = request.html_document
     html.head.title = title
     html.head.links.append('/media/httpbin.css')
     html.head.scripts.append('//code.jquery.com/jquery.min.js')
     html.head.scripts.append('/media/httpbin.js')
     ul = ul.render(request)
     body = template() % (title, version, ul, pyversion, JAPANESE)
     html.body.append(body)
     #html.meta.append()
     return html.http_response(request)
示例#6
0
 def get(self, request):
     '''The home page of this router'''
     ul = Html('ul')
     for router in sorted(self.routes, key=lambda r: r.creation_count):
         a = router.link(escape(router.route.path))
         a.addClass(router.name)
         for method in METHODS:
             if router.getparam(method):
                 a.addClass(method)
         li = Html('li', a, ' %s' % router.getparam('title', ''))
         ul.append(li)
     title = 'Pulsar'
     html = request.html_document
     html.head.title = title
     html.head.links.append('httpbin.css')
     html.head.links.append('favicon.ico', rel="icon", type='image/x-icon')
     html.head.scripts.append('httpbin.js')
     ul = ul.render(request)
     templ, _, _ = asset('template.html')
     body = templ % (title, JAPANESE, CHINESE, version, pyversion, ul)
     html.body.append(body)
     return html.http_response(request)
示例#7
0
文件: manage.py 项目: kwsy/pulsar
 def get(self, request):
     '''The home page of this router'''
     ul = Html('ul')
     for router in sorted(self.routes, key=lambda r: r.creation_count):
         a = router.link(escape(router.route.path))
         a.addClass(router.name)
         for method in METHODS:
             if router.getparam(method):
                 a.addClass(method)
         li = Html('li', a, ' %s' % router.getparam('title', ''))
         ul.append(li)
     title = 'Pulsar'
     html = request.html_document
     html.head.title = title
     html.head.links.append('httpbin.css')
     html.head.links.append('favicon.ico', rel="icon", type='image/x-icon')
     html.head.scripts.append('httpbin.js')
     ul = ul.render(request)
     templ, _, _ = asset('template.html')
     body = templ % (title, JAPANESE, CHINESE, version, pyversion, ul)
     html.body.append(body)
     return html.http_response(request)
示例#8
0
 def get(self, request):
     """The home page of this router"""
     ul = Html("ul")
     for router in sorted(self.routes, key=lambda r: r.creation_count):
         a = router.link(escape(router.route.path))
         a.addClass(router.name)
         for method in METHODS:
             if router.getparam(method):
                 a.addClass(method)
         li = Html("li", a, " %s" % router.getparam("title", ""))
         ul.append(li)
     title = "Pulsar"
     html = request.html_document
     html.head.title = title
     html.head.links.append("httpbin.css")
     html.head.links.append("favicon.ico", rel="icon", type="image/x-icon")
     html.head.scripts.append("httpbin.js")
     ul = ul.render(request)
     templ = asset("template.html")
     body = templ % (title, JAPANESE, CHINESE, version, pyversion, ul)
     html.body.append(body)
     return html.http_response(request)
示例#9
0
文件: routers.py 项目: SirZazu/lux
 def state_template(self, app):
     '''Template used when in html5 mode
     '''
     div = Html('div', cn=self.angular_view_class)
     div.data({'compile-html': ''})
     return div.render()
示例#10
0
def state_template(self, app):
    '''Template used when in html5 mode
        '''
    div = Html('div', cn=self.angular_view_class)
    div.data({'compile-html': ''})
    return div.render()