Exemple #1
0
    def render(self, request, url):
        """
        :type url: werkzeug.routing.MapAdapter
        :type request: werkzeug.wrappers.Request
        """

        # ifLogged = lambda fun: fun if self.isLogged else ''
        isTrusted = IGBRequest(request).isTrusted

        layout = (
            T.html(lang='en')[
                T.head[
                    T.meta(charset='utf-8'),
                    T.meta(content='IE=Edge', **{'http-equiv': "X-UA-Compatible"}),
                    T.meta(name='viewport', content='width=device-width, initial-scale=1'),

                    T.title['PyEve IGB'],

                    T.link(href='/static/css/bootstrap-black.min.css', rel='stylesheet'),
                    T.link(href='/static/css/igb.css', rel='stylesheet'),

                    T.script(src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'),
                    T.script(src='/static/js/bootstrap.js'),
                    T.script(src='/static/js/igbCore.js'),

                    self.getAdditionalJs()
                ],

                T.body[
                    # 'HOWDY',
                    # request.headers.get('EVE_TRUSTED', 'alo'),
                    T.div(class_='container-fluid')[
                        C.switch(isTrusted)[
                            C.case(True)[self.content],
                            C.case(False)[self.renderRequestTrust()]
                        ],

                        T.div(class_='text-center')[
                            T.small[
                                'PyEVE. Created by ',
                                T.a(href="#", onclick="CCPEVE.showInfo(1377, 93747896); return false")[
                                    'Rudykocur Maxwell'
                                ]
                            ]
                        ]
                    ],
                ]
            ]
        )

        return Response(flatten(layout), mimetype='text/html')
Exemple #2
0
    def render(self, request, url):
        """
        :type url: werkzeug.routing.MapAdapter
        """

        ifLogged = lambda fun: fun if self.isLogged else ''

        layout = (
            T.html(lang='en')[
                T.head[
                    T.meta(charset='utf-8'),
                    T.meta(content='IE=Edge', **{'http-equiv': "X-UA-Compatible"}),
                    T.meta(name='viewport', content='width=device-width, initial-scale=1'),

                    T.title['PyEve WSGI App'],

                    T.link(href='/static/css/bootstrap.min.css', rel='stylesheet')
                ],

                T.body[
                    T.div(class_="container-fluid")[
                        T.h1['PyEve'],
                        invisible(render=ifLogged(self.renderNavbar), data=(url, None)),
                        T.div(class_='row')[
                            T.div(class_='col-sm-3')[
                                invisible(render=ifLogged(self.renderModuleNav), data=(url, None))
                            ],
                            T.div(class_='col-sm-9')[
                                self.content
                            ]
                        ],
                    ],

                    T.script(src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'),
                    T.script(src='/static/js/bootstrap.js'),
                    T.inlineJS("""
                        $(document).ready(function() {
                            $(document.body).tooltip({
                                selector: ".withTooltip"
                            })
                        })
                    """)
                ]
            ]
        )

        return Response(flatten(layout), mimetype='text/html')
Exemple #3
0
 def getAdditionalJs(self):
     return [
         forEach(self.additionalJs, lambda path: [
             T.script(src='/static/js/%s' % path)
         ])
     ]