Ejemplo n.º 1
0
def channel():

    arena = ArenaPy()

    #get the channel you want to show
    page_channel = arena.get_channel('arena-influences')
    nav_items = arena.get_channel_content(page_channel)
    
    requested_item = None

    if request.args.get('block'):
        requested_item = request.args.get('block')
        current_item = arena.get_block(requested_item)
        blocks = [current_item]
        connections = arena.get_connections_for_block(current_item)
    
    if request.args.get('channel'):
        requested_item = request.args.get('channel')
        current_item = arena.get_channel(requested_item)
        connections = arena.get_channel_connections(current_item)
        blocks =  arena.get_channel_blocks(current_item)
    
    if not requested_item:
        # if nothing requested, get first item
        current_item = nav_items[0]
        blocks = [current_item]
        connections = arena.get_connections_for_block(current_item)
    
    return render_template('channel.html', 
            page_channel = page_channel,
            nav_items = nav_items,
            blocks = blocks,
            connections = connections,
            )
Ejemplo n.º 2
0
def channel():

    arena = ArenaPy()

    #get the channel you want to show
    page_channel = arena.get_channel('arena-influences')
    nav_items = arena.get_channel_content(page_channel)

    requested_item = None

    if request.args.get('block'):
        requested_item = request.args.get('block')
        current_item = arena.get_block(requested_item)
        blocks = [current_item]
        connections = arena.get_connections_for_block(current_item)

    if request.args.get('channel'):
        requested_item = request.args.get('channel')
        current_item = arena.get_channel(requested_item)
        connections = arena.get_channel_connections(current_item)
        blocks = arena.get_channel_blocks(current_item)

    if not requested_item:
        # if nothing requested, get first item
        current_item = nav_items[0]
        blocks = [current_item]
        connections = arena.get_connections_for_block(current_item)

    return render_template(
        'channel.html',
        page_channel=page_channel,
        nav_items=nav_items,
        blocks=blocks,
        connections=connections,
    )