Example #1
0
def show_edit(show):
    s = Show.query.get(show)
    if s is None:
        return 'no show found'
        # TODO: proper error page
    if request.args.get('inline'):
        template = '/shows/showform-inline.html'
    else:
        template = '/shows/showform.html'

    tags = []
    for tag in s.tags:
        tags.append(tag.tag.name)

    return render_template(template,
                           show={'name': s.name,
                                 'description': s.description,
                                 'series': s.series,
                                 'users': s.users,
                                 'tags': ",".join(tags),
                                 'begin': to_user_timezone(s.begin).strftime('%s'),
                                 'logo': s.logo,
                                 'show': s.show,
                                 'duration': (s.end - s.begin).total_seconds() / 60},
                           imgur={'client': CONFIG.get('site', 'imgur-client')},
                           format=get_datetime_format())
Example #2
0
File: show.py Project: keios/PyRfK
def show_edit(show):
    s = Show.query.get(show)
    if s is None:
        return "no show found"
    if request.args.get("inline"):
        template = "/shows/showform-inline.html"
    else:
        template = "/shows/showform.html"

    tags = []
    for tag in s.tags:
        tags.append(tag.tag.name)

    return render_template(
        template,
        show={
            "name": s.name,
            "description": s.description,
            "series": s.series,
            "users": s.users,
            "tags": ",".join(tags),
            "begin": to_user_timezone(s.begin).strftime("%s"),
            "logo": s.logo,
            "show": s.show,
            "duration": (s.end - s.begin).total_seconds() / 60,
        },
        imgur={"client": CONFIG.get("site", "imgur-client")},
        format=get_datetime_format(),
    )
Example #3
0
def new_show_form():
    if request.args.get('inline'):
        template = '/shows/showform-inline.html'
    else:
        template = '/shows/showform.html'
    return render_template(template,
                           imgur={'client': CONFIG.get('site', 'imgur-client')},
                           format=get_datetime_format())
Example #4
0
File: show.py Project: keios/PyRfK
def new_show_form():
    if request.args.get("inline"):
        template = "/shows/showform-inline.html"
    else:
        template = "/shows/showform.html"
    return render_template(template, imgur={"client": CONFIG.get("site", "imgur-client")}, format=get_datetime_format())