Пример #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
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
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
def populate_feed(event):
    # TODO this needs date filter, limiting
    pages = get_recent_pages()
    event.add_feed_items(*pages)