{% from "_helpers.html" import render_field, render_form_errors, copr_url, render_pypi_python_versions_field, render_additional_build_options, render_srpm_build_method_box %} {% from "coprs/detail/_method_forms.html" import copr_method_form_fileds_custom %} {# 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, hide_panels=False) %} {{ render_form_errors(form) }}
{% if not hide_panels %}

2. Provide the source

{% endif %} {% endmacro %} {% macro copr_build_form_end(form, view, copr, hide_panels=False, numbering=3) %} {% if not hide_panels %}

{{ numbering }}. Select chroots and other options

{% endif %} {{ render_additional_build_options(form, copr) }} {% if not hide_panels %}
{% endif %}

You agree to build only allowed content in Copr. Check if your license is allowed.

{% endmacro %} {% macro source_description(description) %}
{{ description | safe }}
{% endmacro %} {##### SPECIFIC FORMS #####} {% macro copr_build_form_url(form, view, copr) %} {{ copr_build_form_begin(form, view, copr) }} {{ source_description('Please upload your SRPM or .spec files on a public server and provide link(s) to the form below. This is the only option to submit more builds at once.')}} {{ render_field(form.pkgs, label='URLs to files', 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) }} {{ source_description("Upload your SRPM or .spec directly to Copr.")}}
{{ form.pkgs }}
{{ copr_build_form_end(form, view, copr) }} {% endmacro %} {% macro copr_build_form_scm(form, view, copr) %} {{ copr_build_form_begin(form, view, copr) }} {{ source_description('Build from Git or SVN repository. Please provide the Git or SVN URL.')}} {{ render_field(form.scm_type) }} {{ render_field(form.clone_url, placeholder="URL to your Git or SVN repository.") }} {{ render_field(form.committish, placeholder="Optional - Specific branch, tag, or commit that you want to build.") }} {{ render_field(form.subdirectory, placeholder="Optional - Subdirectory where source files and .spec are located.") }} {{ render_field(form.spec, placeholder="Optional - Path to your .spec file under the specified subdirectory.") }} {{ render_srpm_build_method_box(form) }} {{ copr_build_form_end(form, view, copr, numbering=4) }} {% endmacro %} {% macro copr_build_form_pypi(form, view, copr) %} {{ copr_build_form_begin(form, view, copr) }} {{ source_description('This method uses pyp2rpm to create the RPM for you automatically from PyPI - the Python Package Index. Please provide the package name.')}} {{ render_field(form.pypi_package_name, placeholder="Package name in the Python Package Index.") }} {{ render_field(form.pypi_package_version, placeholder="Optional - Version of the package PyPI") }} {{ render_pypi_python_versions_field(form.python_versions) }} {{ copr_build_form_end(form, view, copr) }} {% endmacro %} {% macro copr_build_form_rubygems(form, view, copr) %} {{ copr_build_form_begin(form, view, copr) }} {{ source_description('This method uses gem2rpm to create the RPM for you automatically from RubyGems.org. Please provide the gem name.')}} {{ render_field(form.gem_name, placeholder="Gem name from RubyGems.org") }} {{ copr_build_form_end(form, view, copr) }} {% endmacro %} {% macro copr_build_form_custom(form, view, copr) %} {{ copr_build_form_begin(form, view, copr) }} {{ source_description('Provide custom script to build sources.')}} {{ copr_method_form_fileds_custom(form) }} {{ copr_build_form_end(form, view, copr) }} {% endmacro %} {% macro copr_build_form_rebuild(form, view, copr, build) %} {{ copr_build_form_begin(form, view, copr, build, hide_panels=True) }} {{ copr_build_form_end(form, view, copr, hide_panels=True) }} {% endmacro %} {% macro copr_build_cancel_form(build, page, class="") %} {% if build.cancelable %}
{% endif %} {% endmacro %} {% macro copr_build_repeat_form(build, page, class="") %}
{% endmacro %} {% macro copr_build_delete_form(build, page, class="") %}
{% endmacro %}