diff --git a/aurweb/routers/pkgbase.py b/aurweb/routers/pkgbase.py index 4e018a64..6073aed5 100644 --- a/aurweb/routers/pkgbase.py +++ b/aurweb/routers/pkgbase.py @@ -293,8 +293,14 @@ async def pkgbase_comment_post( comment: str = Form(default=str()), enable_notifications: bool = Form(default=False), next: str = Form(default=None), + cancel: bool = Form(default=False), ): """Edit an existing comment.""" + if cancel: + return RedirectResponse( + f"/pkgbase/{name}#comment-{id}", status_code=HTTPStatus.SEE_OTHER + ) + pkgbase = get_pkg_or_base(name, PackageBase) db_comment = get_pkgbase_comment(pkgbase, id) diff --git a/po/aurweb.pot b/po/aurweb.pot index ff1bde8b..7e798a21 100644 --- a/po/aurweb.pot +++ b/po/aurweb.pot @@ -2354,3 +2354,7 @@ msgstr "" #: aurweb/routers/accounts.py msgid "The account has not been deleted, check the confirmation checkbox." msgstr "" + +#: templates/partials/packages/comment_form.html +msgid "Cancel" +msgstr "" diff --git a/templates/partials/packages/comment_form.html b/templates/partials/packages/comment_form.html index 9222d6e9..bf9a14d0 100644 --- a/templates/partials/packages/comment_form.html +++ b/templates/partials/packages/comment_form.html @@ -33,6 +33,11 @@ Routes: + {% if comment %} + + {% endif %} {% if not request.user.notified(pkgbase) %}