Make it clearer that creating a package is only the first step

Fixes #525
This commit is contained in:
rubenwardy 2024-03-27 17:47:15 +00:00
parent 0609176434
commit 6b9614314c
2 changed files with 11 additions and 3 deletions

@ -322,6 +322,8 @@ def create_edit(author=None, name=None):
package = None package = None
if author is None: if author is None:
form = PackageForm(formdata=request.form) form = PackageForm(formdata=request.form)
form.submit.label.text = lazy_gettext("Save draft")
author = request.args.get("author") author = request.args.get("author")
if author is None or author == current_user.username: if author is None or author == current_user.username:
author = current_user author = current_user
@ -340,7 +342,7 @@ def create_edit(author=None, name=None):
if package is None: if package is None:
abort(404) abort(404)
if not package.check_perm(current_user, Permission.EDIT_PACKAGE): if not package.check_perm(current_user, Permission.EDIT_PACKAGE):
return redirect(package.get_url("packages.view")) abort(403)
author = package.author author = package.author

@ -86,7 +86,7 @@
{{ render_field(form.desc, class_="pkg_meta", fieldclass="form-control markdown") }} {{ render_field(form.desc, class_="pkg_meta", fieldclass="form-control markdown") }}
</fieldset> </fieldset>
<fieldset class="mt-4"> <fieldset class="mt-4 mb-5">
<legend class="pkg_meta">{{ _("Repository and Links") }}</legend> <legend class="pkg_meta">{{ _("Repository and Links") }}</legend>
<div class="pkg_wiz_1 d-none"> <div class="pkg_wiz_1 d-none">
@ -122,6 +122,12 @@
{{ render_field(form.translation_url, class_="pkg_meta", hint=_("How can users translate your package? ie: weblate URL or a help page")) }} {{ render_field(form.translation_url, class_="pkg_meta", hint=_("How can users translate your package? ie: weblate URL or a help page")) }}
</fieldset> </fieldset>
<div class="pkg_meta mt-5">{{ render_submit_field(form.submit) }}</div> {% if not package %}
<p class="pkg_meta text-muted">
{{ _("You need to save a draft before you can add releases and screenshots. You'll be able to edit the package again before submitting for approval.") }}
</p>
{% endif %}
<div class="pkg_meta">{{ render_submit_field(form.submit) }}</div>
</form> </form>
{% endblock %} {% endblock %}