atr/templates/upload-selected.html (126 lines of code) (raw):
{% extends "layouts/base.html" %}
{% block title %}
Upload files to {{ release.short_display_name }} ~ ATR
{% endblock title %}
{% block description %}
Add files to a release candidate.
{% endblock description %}
{% block content %}
<p class="d-flex justify-content-between align-items-center">
<a href="{{ as_url(routes.compose.selected, project_name=release.project.name, version_name=release.version) }}"
class="atr-back-link">← Back to Compose {{ release.short_display_name }}</a>
<span>
<strong class="atr-phase-one atr-phase-symbol">①</strong>
<span class="atr-phase-one atr-phase-label">COMPOSE</span>
<span class="atr-phase-arrow">→</span>
<span class="atr-phase-symbol-other">②</span>
<span class="atr-phase-arrow">→</span>
<span class="atr-phase-symbol-other">③</span>
</span>
</p>
<h1>
Upload to <strong>{{ release.project.short_display_name }}</strong> <em>{{ release.version }}</em>
</h1>
<p>
<a href="#file-upload" class="btn btn-outline-primary me-2">Use the browser</a>
<a href="#svn-upload" class="btn btn-outline-primary me-2">Use SVN</a>
<a href="#rsync-upload" class="btn btn-outline-primary">Use rsync</a>
</p>
<h2 id="file-upload">File upload</h2>
<p>Use this form to add files to this candidate draft.</p>
<form method="post"
enctype="multipart/form-data"
class="atr-canary py-4 px-5"
novalidate>
{{ form.csrf_token }}
<div class="mb-3 pb-3 row border-bottom">
<label for="{{ form.file_data.id }}"
class="col-sm-3 col-form-label text-sm-end">{{ form.file_data.label.text }}:</label>
<div class="col-sm-8">
{{ form.file_data(class_="form-control" + (" is-invalid" if form.file_data.errors else "") ) }}
<span id="file_data-help" class="form-text text-muted">Select the files to upload</span>
{% if form.file_data.errors %}
{% for error in form.file_data.errors %}<div class="invalid-feedback">{{ error }}</div>{% endfor %}
{% endif %}
</div>
</div>
<div class="mb-3 pb-3 row border-bottom">
<label for="{{ form.file_name.id }}"
class="col-sm-3 col-form-label text-sm-end">{{ form.file_name.label.text }}:</label>
<div class="col-sm-8">
{{ form.file_name(class_="form-control" + (" is-invalid" if form.file_name.errors else "") ) }}
<span id="file_path-help" class="form-text text-muted">Enter a file name to use when saving the file in the release candidate, only available when uploading a single file</span>
{% if form.file_name.errors %}
{% for error in form.file_name.errors %}<div class="invalid-feedback">{{ error }}</div>{% endfor %}
{% endif %}
</div>
</div>
<div class="row">
<div class="col-sm-9 offset-sm-3">{{ form.submit(class_="btn btn-primary mt-3") }}</div>
</div>
</form>
<h2 id="svn-upload">SVN upload</h2>
<p>Import files from a publicly readable Subversion repository URL into this draft.</p>
<p>
The import will be processed in the background using the <code>svn export</code> command.
You can monitor progress on the <em>Evaluate files</em> page for this draft once the task is queued.
</p>
<div class="row">
<div class="col-md-8 w-100">
<form action="{{ as_url(routes.draft.svnload, project_name=project_name, version_name=version_name) }}"
method="post"
novalidate
class="atr-canary py-4 px-5">
{{ svn_form.hidden_tag() }}
<div class="mb-3 pb-3 row border-bottom">
<label for="{{ svn_form.svn_url.id }}"
class="col-sm-3 col-form-label text-sm-end">{{ svn_form.svn_url.label.text }}:</label>
<div class="col-sm-9">
{{ svn_form.svn_url(class_="form-control") }}
{% if svn_form.svn_url.description %}
<small class="form-text text-muted">{{ svn_form.svn_url.description }}</small>
{% endif %}
{% if svn_form.svn_url.errors -%}
<div class="invalid-feedback d-block">{{ svn_form.svn_url.errors[0] }}</div>
{%- endif %}
</div>
</div>
<div class="mb-3 pb-3 row border-bottom">
<label for="{{ svn_form.revision.id }}"
class="col-sm-3 col-form-label text-sm-end">{{ svn_form.revision.label.text }}:</label>
<div class="col-sm-9">
{{ svn_form.revision(class_="form-control") }}
{% if svn_form.revision.description %}
<small class="form-text text-muted">{{ svn_form.revision.description }}</small>
{% endif %}
{% if svn_form.revision.errors -%}
<div class="invalid-feedback d-block">{{ svn_form.revision.errors[0] }}</div>
{%- endif %}
</div>
</div>
<div class="mb-3 pb-3 row border-bottom">
<label for="{{ svn_form.target_subdirectory.id }}"
class="col-sm-3 col-form-label text-sm-end">{{ svn_form.target_subdirectory.label.text }}:</label>
<div class="col-sm-9">
{{ svn_form.target_subdirectory(class_="form-control") }}
{% if svn_form.target_subdirectory.description %}
<small class="form-text text-muted">{{ svn_form.target_subdirectory.description }}</small>
{% endif %}
{% if svn_form.target_subdirectory.errors -%}
<div class="invalid-feedback d-block">{{ svn_form.target_subdirectory.errors[0] }}</div>
{%- endif %}
</div>
</div>
<div class="row">
<div class="col-sm-9 offset-sm-3">{{ svn_form.submit(class_="btn btn-primary mt-3") }}</div>
</div>
</form>
</div>
</div>
<h2 id="rsync-upload">Rsync upload</h2>
<p>Import files from a remote server using rsync with the following command:</p>
<!-- TODO: Add a button to copy the command to the clipboard -->
<pre class="bg-light p-3 mb-3">
rsync -av -e 'ssh -p 2222' ${YOUR_FILES}/ {{ asf_id }}@{{ server_domain }}:/{{ release.project.name }}/{{ release.version }}/
</pre>
{% include "user-ssh-keys.html" %}
{% endblock content %}