コード例 #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
ファイル: manage.py プロジェクト: JinsongBian/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))
         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
ファイル: manage.py プロジェクト: azziel149/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))
         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
ファイル: manage.py プロジェクト: yl849646685/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)
コード例 #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()