rename /quick -> /extra
This commit is contained in:
parent
52ae0acf8a
commit
39a7295849
1 changed files with 6 additions and 4 deletions
|
@ -126,8 +126,10 @@ def edit_time(alarmid):
|
||||||
"add_time_kind.html", form=form, kind=kind, mode="edit", alarmid=alarmid
|
"add_time_kind.html", form=form, kind=kind, mode="edit", alarmid=alarmid
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def is_xhr():
|
def is_xhr():
|
||||||
return request.headers.get('x-requested-with') is not None
|
return request.headers.get("x-requested-with") is not None
|
||||||
|
|
||||||
|
|
||||||
@db.route("/add/time/<kind>", methods=["GET", "POST"])
|
@db.route("/add/time/<kind>", methods=["GET", "POST"])
|
||||||
def addtime_kind(kind):
|
def addtime_kind(kind):
|
||||||
|
@ -249,9 +251,9 @@ def delete_alarm(alarmid):
|
||||||
return redirect(url_for("db.events_list"))
|
return redirect(url_for("db.events_list"))
|
||||||
|
|
||||||
|
|
||||||
@db.route("/quick/<path:relpath>")
|
@db.route("/extra/<path:relpath>")
|
||||||
def static_custom(relpath):
|
def static_custom(relpath):
|
||||||
basepath = get_conf()['EXTRA_STATIC_PATH']
|
basepath = get_conf()["EXTRA_STATIC_PATH"]
|
||||||
if not basepath:
|
if not basepath:
|
||||||
abort(405)
|
abort(405)
|
||||||
fpath = os.path.join(basepath, relpath)
|
fpath = os.path.join(basepath, relpath)
|
||||||
|
@ -259,4 +261,4 @@ def static_custom(relpath):
|
||||||
if not os.path.isfile(fpath):
|
if not os.path.isfile(fpath):
|
||||||
abort(404, "File non trovato")
|
abort(404, "File non trovato")
|
||||||
mime, _encoding = mimetypes.guess_type(fpath)
|
mime, _encoding = mimetypes.guess_type(fpath)
|
||||||
return Response(open(fpath, 'rb').read(), mimetype=mime)
|
return Response(open(fpath, "rb").read(), mimetype=mime)
|
||||||
|
|
Loading…
Reference in a new issue