コード例 #1
0
def render_current_page(request):
    # TODO it would be nice, in theory, if there were a little plugin-scoped
    # bucket for storing data in, in case there's something expensive that
    # multiple blocks need
    latest_page = get_recent_pages().first()

    adjacent_pages = get_adjacent_pages(latest_page, include_queued=False)

    return dict(
        page=latest_page,
        adjacent_pages=adjacent_pages,
    )
コード例 #2
0
ファイル: plugin.py プロジェクト: eevee/spline
def render_current_page(request):
    # TODO it would be nice, in theory, if there were a little plugin-scoped
    # bucket for storing data in, in case there's something expensive that
    # multiple blocks need
    latest_page = get_recent_pages().first()

    adjacent_pages = get_adjacent_pages(latest_page, include_queued=False)

    return dict(
        page=latest_page,
        adjacent_pages=adjacent_pages,
    )
コード例 #3
0
def offer_blocks(event):
    # TODO this used to get the most recent page from each comic, but that's a
    # concept that's going away.  is there still some useful way to have
    # multiple blocks like that?
    # TODO does this need a date filter too?  do something else if it's too
    # old...?
    recent_pages = get_recent_pages().limit(3)

    block = FrontPageBlock(
        renderer='spline_comic:templates/_lib#front_page_block.mako',
        recent_pages=recent_pages,
    )
    event.blocks.append(block)
コード例 #4
0
ファイル: plugin.py プロジェクト: eevee/spline
def offer_blocks(event):
    # TODO this used to get the most recent page from each comic, but that's a
    # concept that's going away.  is there still some useful way to have
    # multiple blocks like that?
    # TODO does this need a date filter too?  do something else if it's too
    # old...?
    recent_pages = get_recent_pages().limit(3)

    block = FrontPageBlock(
        renderer='spline_comic:templates/_lib#front_page_block.mako',
        recent_pages=recent_pages,
    )
    event.blocks.append(block)
コード例 #5
0
def populate_feed(event):
    # TODO this needs date filter, limiting
    pages = get_recent_pages()
    event.add_feed_items(*pages)
コード例 #6
0
ファイル: plugin.py プロジェクト: eevee/spline
def populate_feed(event):
    # TODO this needs date filter, limiting
    pages = get_recent_pages()
    event.add_feed_items(*pages)