Allow submitting reviews with ctrl+enter

This commit is contained in:
rubenwardy 2023-08-26 13:41:32 +01:00
parent 8f52c67f0f
commit 416674e7ee
2 changed files with 3 additions and 3 deletions

@ -45,7 +45,7 @@ class ReviewForm(FlaskForm):
comment = TextAreaField(lazy_gettext("Comment"), [InputRequired(), Length(10, 2000)])
rating = RadioField(lazy_gettext("Rating"), [InputRequired()],
choices=[("5", lazy_gettext("Yes")), ("3", lazy_gettext("Neutral")), ("1", lazy_gettext("No"))])
submit = SubmitField(lazy_gettext("Save"))
btn_submit = SubmitField(lazy_gettext("Save"))
@bp.route("/packages/<author>/<name>/review/", methods=["GET", "POST"])

@ -42,8 +42,8 @@
</p>
{{ render_field(form.title) }}
{{ render_field(form.comment, label="", class_="m-0", fieldclass="form-control markdown") }} <br />
{{ render_submit_field(form.submit) }}
{{ render_field(form.comment, label="", class_="m-0", fieldclass="form-control markdown", data_enter_submit="1") }} <br />
{{ render_submit_field(form.btn_submit) }}
</div>
</div>
</div>