{% from "_helpers.html" import render_field, render_form_errors %} {# This file contains forms for the "New Build" action General Form Helpers: (contain everything except build source) - copr_build_form_begin - copr_build_form_end Specific Forms: (contain only build source) - copr_build_form_url - copr_build_form_upload One Button Forms: - copr_build_repeat_form - copr_build_cancel_form - copr_build_delete_form How to create a Specific Form: 1. include copr_build_form_begin 2. render all the fields that specify the build source 3. include copr_build_form_end #} {##### GENERAL FORM HELPERS #####} {% macro copr_build_form_begin(form, view, copr, build=None) %} {{ render_form_errors(form, [form._mock_chroots_error]) }} {% if not build %}
{% endmacro %} {##### SPECIFIC FORMS #####} {% macro copr_build_form_url(form, view, copr) %} {{ copr_build_form_begin(form, view, copr) }} {{ render_field(form.pkgs, label='URLs of packages to build', rows = 10, cols = 50) }} {{ copr_build_form_end(form, view, copr) }} {% endmacro %} {% macro copr_build_form_upload(form, view, copr) %} {{ copr_build_form_begin(form, view, copr) }}