Skip to content
This repository was archived by the owner on Sep 13, 2022. It is now read-only.

More about homepage.py

Nicholas Pringle edited this page May 6, 2013 · 1 revision

homepage.py

Functions:

  • thumbnail_link_dict(video=None, exercise=None, thumb_url=None,
  • new_and_noteworthy_link_sets():

Classes:

  • ViewHomePage(request_handler.RequestHandler):

Template values and rendering:

    template_values = {
         'rssblog': RSSBlog.get(0, 4),
         'marquee_video': marquee_video,                                     
         'thumbnail_link_sets': thumbnail_link_sets,                         
         'library_content': library_content,                                 
         'DVD_list': DVD_list,                                               
         'is_mobile_allowed': True,                                          
         'approx_vid_count': video_models.Video.approx_count(),              
         'link_heat': self.request_bool("heat", default=False),              
         'version_number': version_number,                                   
         'donate_redirect_url': donate_redirect_url                          
         }                                                                   
                                                                             
     self.render_jinja2_template('homepage.html', template_values)  

library_content in homepage.html/homepage.py is library_content = library.library_content_html()
So we want to render library content on a different page, ie. not on the homepage.html...
So eg. browse_library.py/browse_library.html

    import library  
    #library_content = library.library_content_html(ajax=True)
    class ViewBrowsePage(request_handler.RequestHandler):
        @user_util.open_access
        def get(self):
            library_content = library.library_content_html(ajax=True)
            template_values {
                'library_content' = library_content,
            }
            self.render_jinja2_template('browse_library.html', template_values)

Clone this wiki locally