예제 #1
0
def register():
    if ANYONE_CAN_REGISTER or (current_user.username == "admin"):
        return render_template('auth/register_react.html',
                               css_source=css_source("register_react"),
                               module_source=js_source_dict["register_react"],
                               version_string=tstring)
    else:
        return render_template
예제 #2
0
def repository():
    return render_template(
        'library/library_home_react.html',
        version_string=tstring,
        develop=str(_develop),
        page_title="tactic repository",
        css_source=css_source("repository_home_react"),
        module_source=js_source_dict["repository_home_react"])
예제 #3
0
def library():
    print("*** in library ***")
    if current_user.get_id() == admin_user.get_id():
        return render_template(
            "library/library_home_react.html",
            version_string=tstring,
            develop=str(_develop),
            page_title="tactic admin",
            css_source=css_source("admin_home_react"),
            module_source=js_source_dict["admin_home_react"])
    else:
        return render_template(
            'library/library_home_react.html',
            develop=str(_develop),
            version_string=tstring,
            page_title="tactic resources",
            css_source=css_source("library_home_react"),
            module_source=js_source_dict["library_home_react"])
예제 #4
0
def user_duplicate(old_username):
    if ANYONE_CAN_REGISTER or (current_user.username == "admin"):
        return render_template(
            'auth/duplicate_user_react.html',
            css_source=css_source("duplicate_user_react"),
            module_source=js_source_dict["duplicate_user_react"],
            old_username=old_username,
            version_string=tstring)
    else:
        return render_template
예제 #5
0
def admin_interface():
    if current_user.get_id() == admin_user.get_id():
        return render_template("library/library_home_react.html",
                               develop=str(_develop),
                               version_string=tstring,
                               page_title="tactic admin",
                               css_source=css_source("admin_home_react"),
                               module_source=js_source_dict["admin_home_react"])
    else:
        return "not authorized"
예제 #6
0
def login_after_register():
    print("entering login view")
    javascript_source = url_for('static',
                                filename=js_source_dict["auth_react"])
    return render_template('auth/login_react.html',
                           show_message="yes",
                           javascript_source=javascript_source,
                           css_source=css_source("auth_react"),
                           message="You can now log in.",
                           alert_type="alert-success",
                           version_string=tstring)
예제 #7
0
def csrf_error(reason):
    javascript_source = url_for('static',
                                filename=js_source_dict["auth_react"])
    return render_template('auth/login_react.html',
                           develop=str(_develop),
                           javascript_source=javascript_source,
                           show_message="yes",
                           css_source=css_source("auth_react"),
                           after_register="no",
                           message=reason,
                           alert_type="",
                           next_view=next_view,
                           version_string=tstring), 400
예제 #8
0
def relogin():
    print("entering relogin view")
    next_view = request.args.get('next')
    if next_view is None:
        next_view = "/library"
    javascript_source = url_for('static',
                                filename=js_source_dict["auth_react"])
    return render_template('auth/login_react.html',
                           after_register="no",
                           message="",
                           javascript_source=javascript_source,
                           css_source=css_source("auth_react"),
                           alert_type="",
                           next_view=next_view,
                           version_string=tstring)
예제 #9
0
def login():
    print("entering login view")
    next_view = request.args.get('next')
    if next_view is None:
        if current_user.is_authenticated:
            return redirect(url_for("library"))
        next_view = "/library"
    javascript_source = url_for('static',
                                filename=js_source_dict["auth_react"])
    return render_template('auth/login_react.html',
                           develop=str(_develop),
                           javascript_source=javascript_source,
                           css_source=css_source("auth_react"),
                           after_register="no",
                           message="",
                           alert_type="",
                           next_view=next_view,
                           version_string=tstring)
예제 #10
0
def account_info():
    return render_template('account_react.html',
                           css_source=css_source("account_react"),
                           module_source=js_source_dict["account_react"],
                           version_string=tstring)
예제 #11
0
def new_world():
    return render_template("main_react.html",
                           version_string=tstring,
                           world_name="",
                           css_source=css_source("main_app"),
                           module_source=js_source_dict["main_app"])