Пример #1
0
    def GET(self, tag):
        tag = utils.url_unquote(tag)
        listed = modules.filter_by_tag(tag)

        sub_title = 'Tag: %s' % tag
        return render.layout(view.list_modules(listed, sub_title=sub_title),
                             title='%s - Google Modules' % sub_title)
Пример #2
0
 def GET(self):
     if web.input().has_key('q'):
        return web.seeother('/search/?' + utils.url_encode(web.input()))
         
     latest_modules, has_next = modules.get_latest()
     return render.layout(
         view.list_modules(latest_modules, next_page_url='/page/1/', sub_title='Latest Modules'))
Пример #3
0
    def GET(self, tag):
        tag = utils.url_unquote(tag)
        listed = modules.filter_by_tag(tag)

        sub_title = 'Tag: %s' % tag
        return render.layout(
            view.list_modules(listed, sub_title=sub_title),
            title = '%s - Google Modules' % sub_title)
Пример #4
0
    def GET(self):
        if web.input().has_key('q'):
            return web.seeother('/search/?' + utils.url_encode(web.input()))

        latest_modules, has_next = modules.get_latest()
        return render.layout(
            view.list_modules(latest_modules,
                              next_page_url='/page/1/',
                              sub_title='Latest Modules'))
Пример #5
0
    def GET(self, page_number):
        page_number = int(page_number)

        latest_modules, has_next = modules.get_latest(offset=page_number*10)
        
        next_page_url = ''
        if has_next:
            next_page_url = '/page/%s/' % (page_number + 1)
        
        sub_title = 'Latest Modules'
        if page_number:
             sub_title += ' - Page %s' % (page_number + 1)
        
        return render.layout(
            view.list_modules(latest_modules, next_page_url=next_page_url, sub_title=sub_title),
            title = page_number and 'Page %s - Google Modules' % (page_number + 1) or 'Google Modules')
Пример #6
0
    def GET(self, page_number):
        page_number = int(page_number)

        latest_modules, has_next = modules.get_latest(offset=page_number * 10)

        next_page_url = ''
        if has_next:
            next_page_url = '/page/%s/' % (page_number + 1)

        sub_title = 'Latest Modules'
        if page_number:
            sub_title += ' - Page %s' % (page_number + 1)

        return render.layout(view.list_modules(latest_modules,
                                               next_page_url=next_page_url,
                                               sub_title=sub_title),
                             title=page_number and 'Page %s - Google Modules' %
                             (page_number + 1) or 'Google Modules')
Пример #7
0
 def GET(self):
     i = web.input(q='', page_number=0)
     
     page_number = int(i.page_number)
     
     searched, has_next = modules.search(i.q, offset=page_number*10)
             
     next_page_url = ''
     if has_next:
         next_page_url = '/search?q=%s&page_number=%s' % (i.q, page_number + 1)
     
     sub_title = 'You searched for: %s' % i.q
     if page_number:
          sub_title += ' - Page %s' % (page_number + 1)
     
     return render.layout(
         view.list_modules(searched, next_page_url=next_page_url, sub_title=sub_title),
         title = '%s - Google Modules' % sub_title, query = i.q)
Пример #8
0
    def GET(self):
        i = web.input(q='', page_number=0)

        page_number = int(i.page_number)

        searched, has_next = modules.search(i.q, offset=page_number * 10)

        next_page_url = ''
        if has_next:
            next_page_url = '/search?q=%s&page_number=%s' % (i.q,
                                                             page_number + 1)

        sub_title = 'You searched for: %s' % i.q
        if page_number:
            sub_title += ' - Page %s' % (page_number + 1)

        return render.layout(view.list_modules(searched,
                                               next_page_url=next_page_url,
                                               sub_title=sub_title),
                             title='%s - Google Modules' % sub_title,
                             query=i.q)