{% from "_helpers.html" import render_field, render_form_errors, copr_url, render_pypi_python_versions_field %} {# 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) %} {% if not hide_panels %}

3. Select chroots and other options

{% endif %}
{% for group_set, chs in form.chroots_sets.items() %} {% set outer_loop = loop %} {% for ch in chs %}
{% endfor %} {% endfor %}
{{ form.csrf_token }} {% if g.user.proven %} {{ render_field(form.memory_reqs) }} {{ render_field(form.timeout) }} {% else %} {# once we pass the hidden attribute, the field will just be hidden, it seems #} {{ render_field(form.memory_reqs, hidden = True) }} {{ render_field(form.timeout, hidden = True) }} {% endif %}
{{ form.enable_net(checked=copr.build_enable_net) }} Enable internet access during this build
{% 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(s) 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 SRPM 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 directly to Copr.")}}
{{ form.pkgs }}
{{ copr_build_form_end(form, view, copr) }} {% endmacro %} {% macro copr_build_form_tito(form, view, copr) %} {{ copr_build_form_begin(form, view, copr) }} {{ source_description('This method uses Tito in a Git repository to create the SRPM for you automatically. Please provide the Git URL.')}} {{ render_field(form.git_url, placeholder="Public clone URL of your git repository.") }} {{ render_field(form.git_directory, placeholder="Optional - A directory in the git containing the spec file.") }} {{ render_field(form.git_branch, placeholder="Optional - A Git branch you want to build from.") }}
{{ form.tito_test() }} Build with the --test option. (build the last commit instead of the last release tag)
{{ copr_build_form_end(form, view, copr) }} {% endmacro %} {% macro copr_build_form_mock(form, view, copr) %} {{ copr_build_form_begin(form, view, copr) }} {{ source_description('This method uses an SCM plugin for Mock in a Git or SVN repository to create the SRPM for you automatically. Please provide the Git or SVN URL.')}} {{ render_field(form.scm_type) }} {{ render_field(form.scm_url, placeholder="URL to your Git or SVN repository") }} {{ render_field(form.spec, placeholder="Path from repository root directory to your .spec file") }} {{ render_field(form.scm_branch, placeholder="Optional - A branch you want to build from.") }} {{ copr_build_form_end(form, view, copr) }} {% 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_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="") %} {% if build.repeatable %}
{% endif %} {% endmacro %} {% macro copr_build_delete_form(build, page, class="") %}
{% endmacro %}