Exemple #1
0
    def render(self, model=None, state=None):
        xsrf.set_xsrf_token(escape.xhtml_escape(self.handler.xsrf_token))

        self._set_current_person(model)

        background_tree = self._construct_background(model)
        main_header_tree = self._construct_main_header(model)
        content_section_tree = self._construct_content_section(model)
        content_wrapper_tree = self._construct_content_wrapper(
                content_section_tree)

        background_str = Element.to_string(background_tree)
        header_str = Element.to_string(main_header_tree)
        content_str = Element.to_string(content_wrapper_tree)

        return background_str + header_str + content_str
Exemple #2
0
    def render(self, model=None, state=None):
        """ Render a TabHeader. """
        context = model.context

        element_tree = TabHeader(context)

        return Element.to_string(element_tree)
Exemple #3
0
    def render(self, model=None, state=None):
        """ Render a Splash Page. """
        login_link = {
            "text": "Login",
            "href": "/login",
        }

        splash_tree = LandingPage(login_link)

        return Element.to_string(splash_tree)
Exemple #4
0
    def render(self, model=None, state=None):
        self._current_person = None
        for rival in model.rivals:
            if rival.id == self.current_user.person_id:
                self._current_person = rival

        xsrf.set_xsrf_token(escape.xhtml_escape(self.handler.xsrf_token))

        return Element.to_string(
            LeagueContentSection(model.context, model.aggregations, model.objects, self._current_person)
        )
Exemple #5
0
    def render(self, model=None, state=None):
        """ Render a Content Model View. """
        element_tree = PageModel(state)

        return Element.to_string(element_tree)
Exemple #6
0
    def render(self, model=None, state=None):
        """ Render a Session Model. """
        element_tree = SessionModel(model)

        return Element.to_string(element_tree)
Exemple #7
0
    def render(self, model=None, state=None):
        """ Render a Context Model. """
        context = model.context
        element_tree = ContextModel(context)

        return Element.to_string(element_tree)