Example #1
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)
        )
Example #2
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