mirror of
https://github.com/simple-login/app.git
synced 2024-11-17 22:21:38 +08:00
Remove "set-note" post form
This commit is contained in:
parent
fb9dc23529
commit
1a081f87c4
2 changed files with 17 additions and 35 deletions
|
@ -248,29 +248,23 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<form method="post">
|
<div class="d-flex mt-2">
|
||||||
<div class="d-flex mt-2">
|
<div class="flex-grow-1 mr-2">
|
||||||
|
<textarea
|
||||||
<div class="flex-grow-1 mr-2">
|
id="note-{{ alias.id }}"
|
||||||
<textarea
|
name="note"
|
||||||
id="note-{{ alias.id }}"
|
class="form-control"
|
||||||
name="note"
|
rows="2"
|
||||||
class="form-control"
|
placeholder="Alias Note.">{{ alias.note or "" }}</textarea>
|
||||||
rows="2"
|
|
||||||
placeholder="Alias Note.">{{ alias.note or "" }}</textarea>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="">
|
|
||||||
<input type="hidden" name="form-name" value="set-note">
|
|
||||||
<input type="hidden" name="alias-id" value="{{ alias.id }}">
|
|
||||||
|
|
||||||
<a data-alias="{{ alias.id }}"
|
|
||||||
class="save-note btn btn-sm btn-outline-success w-100">
|
|
||||||
Save
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
|
<div class="">
|
||||||
|
<a data-alias="{{ alias.id }}"
|
||||||
|
class="save-note btn btn-sm btn-outline-success w-100">
|
||||||
|
Save
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row mt-3">
|
<div class="row mt-3">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
@ -459,7 +453,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
toastr.success(`Saved`);
|
toastr.success(`Note Saved`);
|
||||||
} else {
|
} else {
|
||||||
toastr.error("Sorry for the inconvenience! Could you refresh the page & retry please?", "Unknown Error");
|
toastr.error("Sorry for the inconvenience! Could you refresh the page & retry please?", "Unknown Error");
|
||||||
// reset to the original value
|
// reset to the original value
|
||||||
|
|
|
@ -87,18 +87,6 @@ def index():
|
||||||
LOG.error("alias %s has been added before to DeletedAlias", email)
|
LOG.error("alias %s has been added before to DeletedAlias", email)
|
||||||
db.session.rollback()
|
db.session.rollback()
|
||||||
|
|
||||||
elif request.form.get("form-name") == "set-note":
|
|
||||||
alias_id = request.form.get("alias-id")
|
|
||||||
alias: Alias = Alias.get(alias_id)
|
|
||||||
note = request.form.get("note")
|
|
||||||
|
|
||||||
alias.note = note
|
|
||||||
db.session.commit()
|
|
||||||
|
|
||||||
flash(f"Update note for alias {alias.email}", "success")
|
|
||||||
return redirect(
|
|
||||||
url_for("dashboard.index", highlight_alias_id=alias.id, query=query)
|
|
||||||
)
|
|
||||||
|
|
||||||
elif request.form.get("form-name") == "set-mailbox":
|
elif request.form.get("form-name") == "set-mailbox":
|
||||||
alias_id = request.form.get("alias-id")
|
alias_id = request.form.get("alias-id")
|
||||||
|
|
Loading…
Reference in a new issue