#1128 frontend: display chroot comments on create project page
Merged 4 years ago by praiskup. Opened 4 years ago by dturecek.
copr/ dturecek/copr master  into  master

@@ -23,6 +23,6 @@ 

  <p>

  You agree to build only <a href="https://docs.pagure.org/copr.copr/user_documentation.html#what-i-can-build-in-copr">allowed content</a> in Copr. Check if your <a href="https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses">license</a> is allowed.

  </p>

-   {{ copr_form(form, view = 'coprs_ns.copr_new', username=g.user.name) }}

+   {{ copr_form(form, view = 'coprs_ns.copr_new', username=g.user.name, comments=comments) }}

  

  {% endblock %}

@@ -26,6 +26,6 @@ 

  <p>

  You agree to build only <a href="https://docs.pagure.org/copr.copr/user_documentation.html#what-i-can-build-in-copr">allowed content</a> in Copr. Check if your <a href="https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses">license</a> is allowed.

  </p>

-   {{ copr_form(form, view = 'coprs_ns.copr_new', username=g.user.name, group=group) }}

+   {{ copr_form(form, view = 'coprs_ns.copr_new', username=g.user.name, group=group, comments=comments) }}

  

  {% endblock %}

@@ -148,10 +148,13 @@ 

  @login_required

  def copr_add(username=None, group_name=None):

      form = forms.CoprFormFactory.create_form_cls()()

+     comments = {}

+     for chroot in MockChrootsLogic.get_multiple(active_only=True):

+         comments[chroot.name] = chroot.comment

      if group_name:

          group = ComplexLogic.get_group_by_name_safe(group_name)

-         return flask.render_template("coprs/group_add.html", form=form, group=group)

-     return flask.render_template("coprs/add.html", form=form)

+         return flask.render_template("coprs/group_add.html", form=form, group=group, comments=comments)

+     return flask.render_template("coprs/add.html", form=form, comments=comments)

  

  

  @coprs_ns.route("/<username>/new/", methods=["POST"])