Beispiel #1
0
def user():
    arena = ArenaPy()

    user_string = 'john-michael-boling';
    user_channel = arena.get_channel(user_string);
    profile_channel = arena.get_user_channel(user_string);
    nav_channels = arena.get_channel_channels(profile_channel);

    # get the requested channel if one
    request_channel = request.args.get('channel');

    if request_channel:
        content_channel = arena.get_channel(request_channel);
        content_blocks = arena.get_channel_blocks(content_channel);
        connections = arena.get_channel_connections(content_channel);
    else: 
        content_blocks = arena.get_channel_blocks(user_channel);
        connections = arena.get_channel_connections(user_channel);
    

    # get sorted blocks to use as content
    sorted_blocks = arena.sort_blocks_by_created(content_blocks)

    return render_template('user.html', 
            profile_channel = profile_channel,
            nav_channels = nav_channels,
            sorted_blocks = sorted_blocks,
            connections = connections,
            )
Beispiel #2
0
def user():
    arena = ArenaPy()

    user_string = 'john-michael-boling'
    user_channel = arena.get_channel(user_string)
    profile_channel = arena.get_user_channel(user_string)
    nav_channels = arena.get_channel_channels(profile_channel)

    # get the requested channel if one
    request_channel = request.args.get('channel')

    if request_channel:
        content_channel = arena.get_channel(request_channel)
        content_blocks = arena.get_channel_blocks(content_channel)
        connections = arena.get_channel_connections(content_channel)
    else:
        content_blocks = arena.get_channel_blocks(user_channel)
        connections = arena.get_channel_connections(user_channel)

    # get sorted blocks to use as content
    sorted_blocks = arena.sort_blocks_by_created(content_blocks)

    return render_template(
        'user.html',
        profile_channel=profile_channel,
        nav_channels=nav_channels,
        sorted_blocks=sorted_blocks,
        connections=connections,
    )