コード例 #1
0
ファイル: uimodules.py プロジェクト: Acidburn0zzz/helloworld
 def render(self, content=None, edit=False, individual_content=True):
   self.handler.display["individual_content"] = individual_content
   self.handler.display["content"] = content
   self.handler.display["edit"] = self.handler.get_argument('edit', False)
   self.handler.display["default_username"] = \
       self.handler.get_author_username()
   self.handler.display["remote_users"] = \
       self.handler.models.users_remote.get(
       local_username=self.handler.display["default_username"])[:]
   self.handler.display["sections"] = content_logic.get_sections_with_albums(
       self.handler, profile=self.handler.display["default_username"])
   self.handler.display["section_template"] = self.handler.get_argument(
       'section_template', None)
   self.handler.display["templates"] = self.handler.constants['templates']
   self.handler.display["section_cookie"] = self.handler.get_cookie("section")
   self.handler.display["album_cookie"] = self.handler.get_cookie("album")
   return self.render_string("_create.html", **self.handler.display)
コード例 #2
0
ファイル: uimodules.py プロジェクト: randy-ran/helloworld
 def render(self, content=None, edit=False, individual_content=True):
     self.handler.display["individual_content"] = individual_content
     self.handler.display["content"] = content
     self.handler.display["edit"] = self.handler.get_argument('edit', False)
     self.handler.display["default_username"] = \
         self.handler.get_author_username()
     self.handler.display["remote_users"] = \
         self.handler.models.users_remote.get(
         local_username=self.handler.display["default_username"])[:]
     self.handler.display[
         "sections"] = content_logic.get_sections_with_albums(
             self.handler, profile=self.handler.display["default_username"])
     self.handler.display["section_template"] = self.handler.get_argument(
         'section_template', None)
     self.handler.display["templates"] = self.handler.constants['templates']
     self.handler.display["section_cookie"] = self.handler.get_cookie(
         "section")
     self.handler.display["album_cookie"] = self.handler.get_cookie("album")
     return self.render_string("_create.html", **self.handler.display)
コード例 #3
0
ファイル: uimodules.py プロジェクト: Acidburn0zzz/helloworld
  def render(self, content_owner, content=None, query=None):
    if type(content) is list and len(content):
      content = content[0]

    if content and content.section != 'main':
      profile = content.username
      section = content.section
      if content.album == 'main':
        album = content.name
      else:
        album = content.album
    else:
      profile = self.handler.breadcrumbs["profile"]
      section = self.handler.breadcrumbs["name"]
      album = None

    self.handler.display["sitemap"] = content_logic.get_sections_with_albums(
        self.handler, profile=profile, section=section, album=album)
    self.handler.display["content_owner"] = content_owner
    self.handler.display["content"] = content
    self.handler.display["query"] = query
    return self.render_string("_sitemap.html", **self.handler.display)
コード例 #4
0
ファイル: uimodules.py プロジェクト: randy-ran/helloworld
    def render(self, content_owner, content=None, query=None):
        if type(content) is list and len(content):
            content = content[0]

        if content and content.section != 'main':
            profile = content.username
            section = content.section
            if content.album == 'main':
                album = content.name
            else:
                album = content.album
        else:
            profile = self.handler.breadcrumbs["profile"]
            section = self.handler.breadcrumbs["name"]
            album = None

        self.handler.display[
            "sitemap"] = content_logic.get_sections_with_albums(
                self.handler, profile=profile, section=section, album=album)
        self.handler.display["content_owner"] = content_owner
        self.handler.display["content"] = content
        self.handler.display["query"] = query
        return self.render_string("_sitemap.html", **self.handler.display)