Ejemplo n.º 1
0
def related_bands(slug):
    related_bands = get_related_bands(get_band(slug), max=10, user=get_current_user())
    result = ""

    for slug in related_bands:
        result += slug + "\n"
        result += get_band(slug).name + "\n"

    return result
Ejemplo n.º 2
0
def related_bands(slug):
    related_bands = get_related_bands(get_band(slug),
                                      max=10,
                                      user=get_current_user())
    result = ""

    for slug in related_bands:
        result += slug + "\n"
        result += get_band(slug).name + "\n"

    return result
Ejemplo n.º 3
0
def get_band_timeline_json(band_timeline_id):
    band_slug = band_timeline_id.replace("-timeline", "")

    path_to_band_json = '%s/bands/static/json/%s-timeline.json' % (project_root, band_slug)

    timeline = get_band(slug=band_slug).timeline_as_dict()

    if os.path.exists(path_to_band_json):
        timeline = json.loads(open(path_to_band_json).read())["timeline"]

    return jsonify(timeline=timeline)
Ejemplo n.º 4
0
def get_band_timeline_json(band_timeline_id):
    band_slug = band_timeline_id.replace("-timeline", "")

    path_to_band_json = '%s/bands/static/json/%s-timeline.json' % (
        project_root, band_slug)

    timeline = get_band(slug=band_slug).timeline_as_dict()

    if os.path.exists(path_to_band_json):
        timeline = json.loads(open(path_to_band_json).read())["timeline"]

    return jsonify(timeline=timeline)
Ejemplo n.º 5
0
def novo():
    if has_cookie_login(request) and not user_logged():
        make_login(oauth_token=get_cookie_login(request))

    current_user = get_current_user()
    current_city = current_user.city if current_user and current_user.city else "Rio de Janeiro"

    minhas_bandas_shows = []
    if current_user:
        minhas_bandas = get_user_bands(user=current_user)

        if request.args.get('band'):
            minhas_bandas.insert(0, get_band(slug=request.args.get('band')))

        minhas_bandas_shows.extend(
            get_shows_from_bands(minhas_bandas, 1, city=current_city))
    else:
        top_bands = [
            get_band("legiao-urbana"),
            get_band("the-beatles"),
            get_band("linkin-park"),
            get_band("queen"),
            get_band("guns-n-roses")
        ]

        if request.args.get('band'):
            top_bands.insert(0, get_band(slug=request.args.get('band')))

        minhas_bandas_shows = get_shows_from_bands(top_bands,
                                                   1,
                                                   city=current_city,
                                                   force_to_include_band=True)
        los_bife_band = get_band(slug="los-bife")
        minhas_bandas_shows.append((los_bife_band, los_bife_band.shows[:1]))

    return render_template("novo.html",
                           current_user=current_user,
                           minhas_bandas_shows=minhas_bandas_shows,
                           notas=range(11),
                           BANDAS_CAMISAS=BANDAS_CAMISAS,
                           formulario_pag_seguro=formulario_pag_seguro,
                           range_tamanhos=range_tamanhos)
Ejemplo n.º 6
0
def novo():
    if has_cookie_login(request) and not user_logged():
        make_login(oauth_token=get_cookie_login(request))

    current_user = get_current_user()
    current_city = current_user.city if current_user and current_user.city else "Rio de Janeiro"

    minhas_bandas_shows = []
    if current_user:
        minhas_bandas = get_user_bands(user=current_user)

        if request.args.get('band'):
            minhas_bandas.insert(0, get_band(slug=request.args.get('band')))

        minhas_bandas_shows.extend(get_shows_from_bands(minhas_bandas, 1, city=current_city))
    else:
        top_bands = [
                        get_band("legiao-urbana"),
                        get_band("the-beatles"),
                        get_band("linkin-park"),
                        get_band("queen"),
                        get_band("guns-n-roses")
        ]

        if request.args.get('band'):
            top_bands.insert(0, get_band(slug=request.args.get('band')))

        minhas_bandas_shows = get_shows_from_bands(top_bands, 1, city=current_city, force_to_include_band=True)
        los_bife_band = get_band(slug="los-bife")
        minhas_bandas_shows.append((los_bife_band, los_bife_band.shows[:1]))



    return render_template("novo.html", current_user=current_user,
        minhas_bandas_shows=minhas_bandas_shows, notas=range(11), BANDAS_CAMISAS=BANDAS_CAMISAS,
        formulario_pag_seguro=formulario_pag_seguro, range_tamanhos=range_tamanhos)
Ejemplo n.º 7
0
def get_band_timeline_html(band_timeline_id):
    band_slug = band_timeline_id.replace("-timeline", "")
    return render_template("timelinejs.html", band=get_band(slug=band_slug))
Ejemplo n.º 8
0
def get_band_timeline_html(band_timeline_id):
    band_slug = band_timeline_id.replace("-timeline", "")
    return render_template("timelinejs.html", band=get_band(slug=band_slug))