Changeset View
Changeset View
Standalone View
Standalone View
swh/web/templates/add_forge_now/creation_form.html
{% extends "./common.html" %} | {% extends "./common.html" %} | ||||
{% comment %} | {% comment %} | ||||
Copyright (C) 2022 The Software Heritage developers | Copyright (C) 2022 The Software Heritage developers | ||||
See the AUTHORS file at the top-level directory of this distribution | See the AUTHORS file at the top-level directory of this distribution | ||||
License: GNU Affero General Public License version 3, or any later version | License: GNU Affero General Public License version 3, or any later version | ||||
See top-level LICENSE file for more information | See top-level LICENSE file for more information | ||||
{% endcomment %} | {% endcomment %} | ||||
{% block tab_content %} | {% block tab_content %} | ||||
<div id="swh-add-forge-submit-request" class="tab-pane active" style="padding-top: 10px;"> | <div id="swh-add-forge-submit-request" class="tab-pane active mt-3"> | ||||
{% if not user.is_authenticated %} | {% if not user.is_authenticated %} | ||||
<h3> | |||||
<p class="text-primary"> | <p class="text-primary"> | ||||
You must be logged in to submit an add forge request. Please | You must be logged in to submit an add forge request. Please | ||||
<a id="loginLink" class="link-primary" | <a id="loginLink" class="link-primary" | ||||
{% if oidc_enabled and 'remote_user' in request.GET %} | {% if oidc_enabled and 'remote_user' in request.GET %} | ||||
href="{% url 'oidc-login' %}?next={% url 'forge-add-create' %}" | href="{% url 'oidc-login' %}?next={% url 'forge-add-create' %}" | ||||
{% else %} | {% else %} | ||||
href="{% url 'login' %}?next={% url 'forge-add-create' %}" | href="{% url 'login' %}?next={% url 'forge-add-create' %}" | ||||
{% endif %} | {% endif %}>log in</a> | ||||
>log in</a> | |||||
</p> | </p> | ||||
</h3> | |||||
{% else %} | {% else %} | ||||
<form method="POST" action="{% url 'api-1-add-forge-request-create' %}" | <form method="POST" action="{% url 'api-1-add-forge-request-create' %}" | ||||
id="requestCreateForm" class="collapse show"> | id="requestCreateForm" class="collapse show"> | ||||
{% csrf_token %} | {% csrf_token %} | ||||
<div class="form-row"> | <div class="form-row"> | ||||
<div class="form-group col-md-5"> | <div class="form-group col-md-5"> | ||||
<label for="swh-input-forge-type" class="swh-required-label">Forge type</label> | <label for="swh-input-forge-type" class="swh-required-label"> | ||||
<select class="form-control" id="swh-input-forge-type" name="forge_type" autofocus> | Forge type | ||||
</label> | |||||
<select class="form-control" id="swh-input-forge-type" | |||||
name="forge_type" autofocus> | |||||
{% for forge_type in forge_types %} | {% for forge_type in forge_types %} | ||||
<option value={{ forge_type }}>{{ forge_type}}</option> | <option value={{ forge_type }}>{{ forge_type}}</option> | ||||
{% endfor %} | {% endfor %} | ||||
</select> | </select> | ||||
<small class="form-text text-muted"> | <small class="form-text text-muted"> | ||||
Supported forge types in software archive. | Supported forge types in software archive. | ||||
</small> | </small> | ||||
</div> | </div> | ||||
<div class="form-group col-md-7"> | <div class="form-group col-md-7"> | ||||
<label for="swh-input-forge-url" class="swh-required-label">Forge URL</label> | <label for="swh-input-forge-url" class="swh-required-label"> | ||||
<input type="text" class="form-control" id="swh-input-forge-url" name="forge_url" required> | Forge URL | ||||
</label> | |||||
<input type="text" class="form-control" id="swh-input-forge-url" | |||||
name="forge_url" required> | |||||
<small class="form-text text-muted"> | <small class="form-text text-muted"> | ||||
Remote URL of the forge. | Remote URL of the forge. | ||||
</small> | </small> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="form-row"> | <div class="form-row"> | ||||
<div class="form-group col-md-5"> | <div class="form-group col-md-5"> | ||||
<label for="swh-input-forge-contact-name" class="swh-required-label">Forge contact name</label> | <label for="swh-input-forge-contact-name" class="swh-required-label"> | ||||
<input type="text" class="form-control" name="forge_contact_name" id="swh-input-forge-contact-name" required> | Forge contact name | ||||
</label> | |||||
<input type="text" class="form-control" name="forge_contact_name" | |||||
id="swh-input-forge-contact-name" required> | |||||
<small class="form-text text-muted"> | <small class="form-text text-muted"> | ||||
Name of the forge administrator. | Name of the forge administrator. | ||||
</small> | </small> | ||||
</div> | </div> | ||||
<div class="form-group col-md-7"> | <div class="form-group col-md-7"> | ||||
<label for="swh-input-forge-contact-email" class="swh-required-label">Forge contact email</label> | <label for="swh-input-forge-contact-email" class="swh-required-label"> | ||||
<input type="email" class="form-control" name="forge_contact_email" id="swh-input-forge-contact-email" required> | Forge contact email | ||||
</label> | |||||
<input type="email" class="form-control" name="forge_contact_email" | |||||
id="swh-input-forge-contact-email" required> | |||||
<small class="form-text text-muted"> | <small class="form-text text-muted"> | ||||
Email of the forge administrator. The given email address will not be used for any purpose outside the “add forge now” process. | Email of the forge administrator. The given email address will not be used | ||||
for any purpose outside the “add forge now” process. | |||||
</small> | </small> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="form-row"> | <div class="form-row"> | ||||
<div class="form-group form-check"> | <div class="form-group form-check"> | ||||
<input class="form-check-input" type="checkbox" | <input class="form-check-input" type="checkbox" | ||||
id="swh-input-consent-check" name="submitter_forward_username"> | id="swh-input-consent-check" name="submitter_forward_username"> | ||||
<label for="swh-input-consent-check"> | <label for="swh-input-consent-check"> | ||||
I consent to add my username in the communication with the forge. | I consent to add my username in the communication with the forge. | ||||
</label> | </label> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="form-row"> | <div class="form-row"> | ||||
<div class="form-group col-md-12"> | <div class="form-group col-md-12"> | ||||
<label for="swh-input-forge-comment">Comment</label> | <label for="swh-input-forge-comment">Comment</label> | ||||
<textarea class="form-control" id="swh-input-forge-comment" name="forge_contact_comment" rows="3"></textarea> | <textarea class="form-control" id="swh-input-forge-comment" | ||||
name="forge_contact_comment" rows="3"> | |||||
</textarea> | |||||
<small class="form-text text-muted"> | <small class="form-text text-muted"> | ||||
Optionally, leave a comment to the moderator regarding your request. | Optionally, leave a comment to the moderator regarding your request. | ||||
</small> | </small> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="form-row"> | <div class="form-row"> | ||||
<div class="col-md-12"> | <div class="col-md-12"> | ||||
<input id="swh-input-form-submit" type="submit" value="Submit Add Request" class="btn btn-default float-right"> | <input id="swh-input-form-submit" type="submit" value="Submit Add Request" | ||||
class="btn btn-default float-right"> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="form-row"> | <div class="form-row"> | ||||
<div class="col-md-12"> | <div class="col-md-12"> | ||||
<h3 class="text-center"> | <h3 class="text-center"> | ||||
<span id="userMessage" class="badge"></span> | <span id="userMessage" class="badge"></span> | ||||
</h3> | </h3> | ||||
<p class="text-center"> | <p class="text-center"> | ||||
<span id="userMessageDetail"></span> | <span id="userMessageDetail"></span> | ||||
</p> | </p> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</form> | </form> | ||||
<p> | <p> | ||||
Once an add-forge-request is submitted, its status can be viewed in | Once an add-forge-request is submitted, its status can be viewed in | ||||
the <a id="swh-show-forge-add-requests-list" href="#browse-requests"> | the <a id="swh-show-forge-add-requests-list" href="#browse-requests"> | ||||
submitted requests list</a>. This process involves a moderator approval and | submitted requests list</a>. This process involves a moderator approval and | ||||
might take a few days to handle (it primarily depends on the response | might take a few days to handle (it primarily depends on the response | ||||
time from the forge). | time from the forge). | ||||
</p> | </p> | ||||
{% endif %} | {% endif %} | ||||
</div> | </div> | ||||
{% endblock %} | {% endblock %} |