Example #1
0
def home():
    #Load banner
    list_banner = common.load_banner_image()
    #Load event
    list_event = common.load_event_data('home')
    #Load band thumbnail
    list_band = common.load_band_thumbnail()
    #Load room thumbnail
    list_room_thumbnail = common.load_music_room_thumbnail('0')
    #Load room description
    list_room_description = common.load_music_room_description()
    #Load room general description
    list_room_general_description = common.load_room_general()
    #Load band general description
    list_band_general_description = common.load_band_general()
    """Renders the home page."""
    return render_template(
        'Home/home.html',
        title='Home Page',
        banner = list_banner,
        event = list_event,
        band_thumbnail = list_band,
        list_room_thumbnail = list_room_thumbnail,
        list_room_description = list_room_description,
        list_room_general_description = list_room_general_description,
        list_band_general_description = list_band_general_description,
        year=datetime.now().year,
    )
Example #2
0
def music_room_thumbnail(room_type):
    if current_user.role != 'admin':
        return render_template('Admin/error-permission.html')
    list_thumbnail = common.load_music_room_thumbnail(room_type)
    room_type_name = common.get_room_type_name(room_type)
    return render_template('Admin/music-room.html',
                           music_thumbnail_data=list_thumbnail,
                           room_type_name=room_type_name,
                           room_type=room_type,
                           year=datetime.now().year)
Example #3
0
def refesh_room_thumbnail():
    room_type = request.form['room_type']
    list_thumbnail = common.load_music_room_thumbnail(room_type)
    return simplejson.dumps({'music_thumbnail_data': list_thumbnail})