From 0f431c5da2aa69baf8ba7fc91d819872783cd060 Mon Sep 17 00:00:00 2001 From: Antoine Lambert <anlambert@softwareheritage.org> Date: Tue, 27 Jun 2023 15:29:40 +0200 Subject: [PATCH] templates: Reformat with latest djLint version --- mirror_demo/templates/mirror-footer.html | 2 +- .../templates/add-forge-common.html | 12 +- .../templates/add-forge-creation-form.html | 10 +- .../add-forge-request-dashboard.html | 7 +- swh/web/api/templates/api-endpoints.html | 4 +- swh/web/api/templates/api.html | 90 ++-- swh/web/api/templates/apidoc.html | 31 +- .../templates/archive-coverage.html | 16 +- swh/web/auth/templates/profile.html | 10 +- swh/web/banners/templates/banner-iframe.html | 8 +- .../banners/templates/fundraising-banner.html | 13 +- swh/web/browse/templates/browse-branches.html | 4 +- swh/web/browse/templates/browse-help.html | 10 +- swh/web/browse/templates/browse-iframe.html | 12 +- .../templates/browse-origin-visits.html | 14 +- swh/web/browse/templates/browse-release.html | 2 +- swh/web/browse/templates/browse-releases.html | 4 +- .../browse/templates/browse-revision-log.html | 18 +- swh/web/browse/templates/browse-revision.html | 6 +- swh/web/browse/templates/browse-search.html | 6 +- .../templates/includes/branch-search.html | 2 +- .../templates/includes/content-display.html | 10 +- .../templates/includes/directory-display.html | 4 +- .../includes/origin-search-form.html | 30 +- .../templates/includes/revision-info.html | 2 +- .../templates/includes/show-swhids.html | 14 +- .../templates/includes/snapshot-context.html | 4 +- .../templates/includes/top-navigation.html | 9 +- swh/web/browse/tests/views/test_content.py | 2 +- swh/web/deposit/templates/deposit-admin.html | 2 +- swh/web/jslicenses/templates/jslicenses.html | 12 +- swh/web/mailmap/templates/admin/mailmap.html | 4 +- .../templates/admin/origin-save-filters.html | 20 +- .../templates/admin/origin-save-requests.html | 20 +- .../templates/includes/take-new-snapshot.html | 10 +- .../templates/origin-save-help.html | 10 +- .../save_code_now/templates/origin-save.html | 18 +- .../includes/vault-create-tasks.html | 20 +- swh/web/vault/templates/vault-ui.html | 2 +- .../webapp/templates/includes/favicon.html | 10 +- swh/web/webapp/templates/includes/footer.html | 6 +- .../templates/includes/global-modals.html | 4 +- .../webapp/templates/includes/http-error.html | 4 +- .../webapp/templates/includes/top-bar.html | 6 +- swh/web/webapp/templates/layout.html | 406 +++++++++--------- 45 files changed, 383 insertions(+), 527 deletions(-) diff --git a/mirror_demo/templates/mirror-footer.html b/mirror_demo/templates/mirror-footer.html index 89c67dd54..b70cb00d0 100644 --- a/mirror_demo/templates/mirror-footer.html +++ b/mirror_demo/templates/mirror-footer.html @@ -2,7 +2,7 @@ Copyright (C), [mirror partner]. License: <a href="https://www.gnu.org/licenses/agpl.html">GNU AGPLv3+</a>. -<br/> +<br /> {% if "swh.web.jslicenses" in SWH_DJANGO_APPS %} <a href="{% url 'jslicenses' %}" rel="jslicense">JavaScript license information</a>- {% endif %} diff --git a/swh/web/add_forge_now/templates/add-forge-common.html b/swh/web/add_forge_now/templates/add-forge-common.html index cb72d5da8..b73aa1ec7 100644 --- a/swh/web/add_forge_now/templates/add-forge-common.html +++ b/swh/web/add_forge_now/templates/add-forge-common.html @@ -41,23 +41,17 @@ See top-level LICENSE file for more information <li class="nav-item"> <a class="nav-link {% if request.resolver_match.view_name == 'forge-add-create' %}active{% endif %}" href="{% url 'forge-add-create' %}" - id="swh-add-forge-tab"> - Submit a Request - </a> + id="swh-add-forge-tab">Submit a Request</a> </li> <li class="nav-item"> <a class="nav-link {% if request.resolver_match.view_name == 'forge-add-list' %}active{% endif %}" href="{% url 'forge-add-list' %}" - id="swh-add-forge-requests-list-tab"> - Browse Requests - </a> + id="swh-add-forge-requests-list-tab">Browse Requests</a> </li> <li class="nav-item"> <a class="nav-link {% if request.resolver_match.view_name == 'forge-add-help' %}active{% endif %}" href="{% url 'forge-add-help' %}" - id="swh-add-forge-requests-help-tab"> - Help - </a> + id="swh-add-forge-requests-help-tab">Help</a> </li> </ul> <div class="tab-content"> diff --git a/swh/web/add_forge_now/templates/add-forge-creation-form.html b/swh/web/add_forge_now/templates/add-forge-creation-form.html index 303a29242..805845bdd 100644 --- a/swh/web/add_forge_now/templates/add-forge-creation-form.html +++ b/swh/web/add_forge_now/templates/add-forge-creation-form.html @@ -43,7 +43,7 @@ See top-level LICENSE file for more information id="swh-input-forge-url" name="forge_url" oninput="swh.add_forge_now.validateForgeUrl(this)" - required/> + required /> <small class="form-text text-muted">Remote URL of the forge.</small> </div> </div> @@ -54,7 +54,7 @@ See top-level LICENSE file for more information class="form-control" name="forge_contact_name" id="swh-input-forge-contact-name" - required/> + required /> <small class="form-text text-muted">Name of the forge administrator.</small> </div> <div class="form-group col-md-7"> @@ -63,7 +63,7 @@ See top-level LICENSE file for more information class="form-control" name="forge_contact_email" id="swh-input-forge-contact-email" - required/> + required /> <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. @@ -75,7 +75,7 @@ See top-level LICENSE file for more information <input class="form-check-input" type="checkbox" id="swh-input-consent-check" - name="submitter_forward_username"/> + name="submitter_forward_username" /> <label for="swh-input-consent-check"> I consent to add my username in the communication with the forge. </label> @@ -94,7 +94,7 @@ See top-level LICENSE file for more information <input id="swh-input-form-submit" type="submit" value="Submit Add Request" - class="btn btn-default float-right"/> + class="btn btn-default float-right" /> </div> </div> <div class="form-row"> diff --git a/swh/web/add_forge_now/templates/add-forge-request-dashboard.html b/swh/web/add_forge_now/templates/add-forge-request-dashboard.html index 6740b6a28..c7a9b1aec 100644 --- a/swh/web/add_forge_now/templates/add-forge-request-dashboard.html +++ b/swh/web/add_forge_now/templates/add-forge-request-dashboard.html @@ -42,8 +42,7 @@ See top-level LICENSE file for more information <div class="form-row"> <div class="form-group col-md-6"> <label for="decisionOptions" class="swh-required-label">Choose your decision</label> - <select class="form-control" id="decisionOptions" name="new_status"> - </select> + <select class="form-control" id="decisionOptions" name="new_status"></select> </div> </div> <div class="form-row"> @@ -109,9 +108,7 @@ See top-level LICENSE file for more information id="contactForgeAdmin" emailSubject="" emailTo="" - emailCc=""> - Send message to the forge - </button> + emailCc="">Send message to the forge</button> </div> </div> </div> diff --git a/swh/web/api/templates/api-endpoints.html b/swh/web/api/templates/api-endpoints.html index 03a823f37..55aa1e355 100644 --- a/swh/web/api/templates/api-endpoints.html +++ b/swh/web/api/templates/api-endpoints.html @@ -54,14 +54,14 @@ See top-level LICENSE file for more information {% for category, routes in doc_routes %} <h2 id="{{ category | slugify }}">{{ category }}</h2> <table class="table table-striped search-res swh-table" width="100%"> - <col width="320"/> + <col width="320" /> <thead class="thead-default"> <th>Endpoint</th> <th class="d-none d-sm-table-cell">Description</th> </thead> <tbody> {% for doc in routes %} - <tr class="swh-api-1-doc-route swh-tr-hover-highlight {% for tag in doc.tags %} swh-api-1-doc-route-{{ tag }}{% endfor %}"> + <tr class="swh-api-1-doc-route swh-tr-hover-highlight {% for tag in doc.tags %}swh-api-1-doc-route-{{ tag }}{% endfor %}"> {% if "upcoming" in doc.tags %} <td id="{{ doc.route_view_name }}">{% url doc.route_view_name %}</td> {% else %} diff --git a/swh/web/api/templates/api.html b/swh/web/api/templates/api.html index 025f441b1..72d65a7a0 100644 --- a/swh/web/api/templates/api.html +++ b/swh/web/api/templates/api.html @@ -127,55 +127,37 @@ See top-level LICENSE file for more information <strong>Warning:</strong> this version of the API is not to be considered stable yet. Non-backward compatible changes might happen even without changing the API version number. </p> - <h4 id="schema"> - Schema - </h4> - <p> - API access is over HTTPS. - </p> + <h4 id="schema">Schema</h4> + <p>API access is over HTTPS.</p> <p> All API endpoints are rooted at <a href="https://archive.softwareheritage.org/api/1/" class="uri">https://archive.softwareheritage.org/api/1/</a>. </p> - <p> - Data is sent and received as JSON by default. - </p> - <p> - Example: - </p> + <p>Data is sent and received as JSON by default.</p> + <p>Example:</p> <ul> <li> - <p> - from the command line: - </p> + <p>from the command line:</p> <pre><code class="shell">curl -i https://archive.softwareheritage.org/api/1/stat/counters/</code></pre> </li> </ul> - <h4 id="response-format-override"> - Response format override - </h4> + <h4 id="response-format-override">Response format override</h4> <p> The response format can be overridden using the <code>Accept</code> request header. In particular, <code>Accept: text/html</code> (that web browsers send by default) requests HTML pretty-printing, whereas <code>Accept: application/yaml</code> requests YAML-encoded responses. </p> - <p> - Example: - </p> + <p>Example:</p> <ul> <li> <a href="{% url 'api-1-stat-counters' %}" class="uri">/api/1/stat/counters/</a> </li> <li> - <p> - from the command line: - </p> + <p>from the command line:</p> <pre><code class="shell">curl -i -H 'Accept: application/yaml' https://archive.softwareheritage.org/api/1/stat/counters/</code></pre> </li> </ul> - <h4 id="parameters"> - Parameters - </h4> + <h4 id="parameters">Parameters</h4> <p> Some API endpoints can be tweaked by passing optional parameters. For GET requests, optional parameters can be passed as an HTTP query string. @@ -185,24 +167,18 @@ See top-level LICENSE file for more information and can be used to restrict the list of fields returned by the API, in case you are not interested in all of them. By default, all available fields are returned. </p> - <p> - Example: - </p> + <p>Example:</p> <ul> <li> <a href="{% url 'api-1-stat-counters' %}?fields=content,directory,revision" class="uri">{% url 'api-1-stat-counters' %}?fields=content,directory,revision</a> </li> <li> - <p> - from the command line: - </p> + <p>from the command line:</p> <pre><code class="shell">curl https://archive.softwareheritage.org/api/1/stat/counters/?fields=content,directory,revision</code></pre> </li> </ul> - <h4 id="errors"> - Errors - </h4> + <h4 id="errors">Errors</h4> <p> While API endpoints will return different kinds of errors depending on their own semantics, some error patterns are common across all endpoints. @@ -217,9 +193,7 @@ See top-level LICENSE file for more information Invalid hash deadbeef for algorithm sha1) </li> <li> - <p> - from the command line: - </p> + <p>from the command line:</p> <pre><code class="shell">curl -i https://archive.softwareheritage.org/api/1/content/sha1:deadbeef/</code></pre> </li> </ul> @@ -234,9 +208,7 @@ See top-level LICENSE file for more information (error: Content with sha1 checksum equals to 0123456789abcdef0123456789abcdef01234567 not found!) </li> <li> - <p> - from the command line: - </p> + <p>from the command line:</p> <pre><code class="shell">curl -i https://archive.softwareheritage.org/api/1/content/04740277a81c5be6c16f6c9da488ca073b770d7f/</code></pre> </li> </ul> @@ -244,9 +216,7 @@ See top-level LICENSE file for more information Unavailability of the underlying storage backend will result in a <code>503 Service Unavailable</code> HTTP response. </p> - <h4 id="utf8-decoding-errors"> - UTF-8 decoding errors - </h4> + <h4 id="utf8-decoding-errors">UTF-8 decoding errors</h4> <p> While attempting to decode UTF-8 strings from raw bytes stored in the archive, some errors might happen when generating an API response. In that case, an extra field @@ -257,12 +227,8 @@ See top-level LICENSE file for more information A string that could not be decoded will have the bytes of its invalid UTF-8 sequences escaped as <code>\\x<hex value></code>. </p> - <h4 id="pagination"> - Pagination - </h4> - <p> - Requests that might potentially return many items will be paginated. - </p> + <h4 id="pagination">Pagination</h4> + <p>Requests that might potentially return many items will be paginated.</p> <p> Page size is set to a default (usually: 10 items), but might be overridden with the <code>per_page</code> query parameter up to a maximum (usually: 50 items). Example: @@ -274,15 +240,13 @@ See top-level LICENSE file for more information </p> <pre><code class="shell">curl -i https://archive.softwareheritage.org/api/1/origin/1/visits/?per_page=2 | grep ^Link: Link: </api/1/origin/1/visits/?last_visit=2&per_page=2>; rel="next",</code></pre> - <h4 id="rate-limiting"> - Rate limiting - </h4> + <h4 id="rate-limiting">Rate limiting</h4> <p> Due to limited resource availability on the back end side, API usage is currently rate limited. API users can be either anonymous or authenticated. For rate-limiting purposes, anonymous users are identified by their origin IP address; authenticated users identify themselves via user-specific credentials, like <a href="#authentication">authentication tokens</a>. - <br/> + <br /> A higher rate-limit quota is available by default for authenticated users. </p> <p> @@ -304,24 +268,20 @@ Link: </api/1/origin/1/visits/?last_visit=2&per_page=2>; rel="next",</ rate limiting will expire, resetting to a fresh <code>X-RateLimit-Limit</code> </li> </ul> - <p> - Example: - </p> + <p>Example:</p> <pre><code class="shell">curl -i https://archive.softwareheritage.org/api/1/stat/counters/ | grep ^X-RateLimit X-RateLimit-Limit: 120 X-RateLimit-Remaining: 119 X-RateLimit-Reset: 1620639052</code></pre> {% if oidc_enabled %} - <h4 id="authentication"> - Authentication - </h4> + <h4 id="authentication">Authentication</h4> <p> It is possible to perform authenticated requests to the Web API through the use of a bearer token sent in HTTP Authorization headers. - <br/> + <br /> To obtain such a token, an account to the <a href="{% url 'oidc-login' %}">Software Heritage Authentication service</a> must be created. - <br/> + <br /> To generate and manage bearer tokens, a dedicated interface is available on the <a href="{% url 'oidc-profile' %}#tokens">user profile page</a> once logged in. </p> @@ -338,7 +298,5 @@ curl -H "Authorization: Bearer ${TOKEN}" {{ site_base_url }}/api/...</pre> </p> {% endif %} </div> - <script> - swh.webapp.initPage('api'); - </script> + <script>swh.webapp.initPage('api');</script> {% endblock content %} diff --git a/swh/web/api/templates/apidoc.html b/swh/web/api/templates/apidoc.html index e683f8a9e..d4358c429 100644 --- a/swh/web/api/templates/apidoc.html +++ b/swh/web/api/templates/apidoc.html @@ -100,9 +100,7 @@ See top-level LICENSE file for more information <h4>Arguments</h4> {% for arg in args %} <dl class="row"> - <dt class="col col-md-2 text-right"> - {{ arg.name }} ({{ arg.type }}) - </dt> + <dt class="col col-md-2 text-right">{{ arg.name }} ({{ arg.type }})</dt> <dd class="col col-md-9"> {{ arg.doc | docstring_display | safe }} </dd> @@ -116,9 +114,7 @@ See top-level LICENSE file for more information <h4>Query parameters</h4> {% for param in params %} <dl class="row"> - <dt class="col col-md-2 text-right"> - {{ param.name }} ({{ param.type }}) - </dt> + <dt class="col col-md-2 text-right">{{ param.name }} ({{ param.type }})</dt> <dd class="col col-md-9"> {{ param.doc | docstring_display | safe }} </dd> @@ -132,9 +128,7 @@ See top-level LICENSE file for more information <h4>Request headers</h4> {% for header in reqheaders %} <dl class="row"> - <dt class="col col-md-2 text-right"> - {{ header.name }} - </dt> + <dt class="col col-md-2 text-right">{{ header.name }}</dt> <dd class="col col-md-9"> {{ header.doc | docstring_display | safe }} </dd> @@ -147,9 +141,7 @@ See top-level LICENSE file for more information <div> <h4>Request data</h4> <dl class="row"> - <dt class="col col-md-2 text-right"> - {{ input_type }} - </dt> + <dt class="col col-md-2 text-right">{{ input_type }}</dt> <dd class="col col-md-9"> <p> {% if input_type == 'array' and inputs_list == '' %} @@ -173,9 +165,7 @@ See top-level LICENSE file for more information <h4>Response headers</h4> {% for header in resheaders %} <dl class="row"> - <dt class="col col-md-2 text-right"> - {{ header.name }} - </dt> + <dt class="col col-md-2 text-right">{{ header.name }}</dt> <dd class="col col-md-9"> {{ header.doc | docstring_display | safe }} </dd> @@ -188,9 +178,7 @@ See top-level LICENSE file for more information <div> <h4>Returns</h4> <dl class="row"> - <dt class="col col-md-2 text-right"> - {{ return_type }} - </dt> + <dt class="col col-md-2 text-right">{{ return_type }}</dt> <dd class="col col-md-9"> <p> {% if return_type == 'array' and returns_list == '' %} @@ -214,9 +202,7 @@ See top-level LICENSE file for more information <h4>HTTP status codes</h4> {% for status in status_codes %} <dl class="row"> - <dt class="col col-md-2 text-right"> - {{ status.code }} - </dt> + <dt class="col col-md-2 text-right">{{ status.code }}</dt> <dd class="col col-md-9"> {{ status.doc | docstring_display | safe }} </dd> @@ -230,8 +216,7 @@ See top-level LICENSE file for more information <h4>Examples</h4> {% for example in examples %} <dl class="row"> - <dt class="col col-md-2"> - </dt> + <dt class="col col-md-2"></dt> <dd class="col col-md-9"> <a href="{{ example }}">{{ example }}</a> </dd> diff --git a/swh/web/archive_coverage/templates/archive-coverage.html b/swh/web/archive_coverage/templates/archive-coverage.html index e1398dc80..43b406291 100644 --- a/swh/web/archive_coverage/templates/archive-coverage.html +++ b/swh/web/archive_coverage/templates/archive-coverage.html @@ -12,10 +12,10 @@ See top-level LICENSE file for more information <!DOCTYPE html> <html lang="en"> <head> - <meta charset="utf-8"/> - <meta http-equiv="X-UA-Compatible" content="IE=edge"/> + <meta charset="utf-8" /> + <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" - content="width=device-width, initial-scale=1, shrink-to-fit=no"/> + content="width=device-width, initial-scale=1, shrink-to-fit=no" /> {% include "includes/favicon.html" %} <title>Software Heritage archive coverage</title> {% render_bundle 'vendors' %} @@ -38,13 +38,13 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License -along with this program. If not, see <https://www.gnu.org/licenses/>. +along with this program. If not, see <https://www.gnu.org/licenses />. @licend The above is the entire license notice for the JavaScript code in this page. */ </script> <script src="{% url 'js-reverse' %}" type="text/javascript"></script> - <base target="_parent"/> + <base target="_parent" /> </head> <body style="padding-bottom: 0;"> <div class="wrapper" style="margin-left: 0;" data-iframe-height> @@ -57,7 +57,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. target="_blank" rel="noopener noreferrer">Archive Changelog</a> for notable changes to the archive over time. - <br/> + <br /> It currently includes the following software origins. </p> {% for origins_type, origins_data in origins.items %} @@ -75,7 +75,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. {% with "img/logos/"|add:origins.type.lower|add:".png" as png_logo %} <img class="card-img-top swh-coverage-logo" src="{% static png_logo %}" - alt="{{ origins.type }}"/> + alt="{{ origins.type }}" /> {% endwith %} </a> <div class="card-header swh-coverage-header"> @@ -91,7 +91,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. {% if "count" in origins and origins.count %} {{ origins.count }} origins {% else %} - <br/> + <br /> {% endif %} </div> </a> diff --git a/swh/web/auth/templates/profile.html b/swh/web/auth/templates/profile.html index 20744ebc5..38b3d1f51 100644 --- a/swh/web/auth/templates/profile.html +++ b/swh/web/auth/templates/profile.html @@ -69,7 +69,7 @@ See top-level LICENSE file for more information <td> {% for perm in user.get_all_permissions %} {{ perm }} - <br/> + <br /> {% endfor %} </td> </tr> @@ -88,13 +88,9 @@ See top-level LICENSE file for more information <div class="mt-3"> <div class="float-right"> <button class="btn btn-default" - onclick="swh.auth.applyTokenAction('generate')"> - Generate new token - </button> + onclick="swh.auth.applyTokenAction('generate')">Generate new token</button> <button class="btn btn-default float-right" - onclick="swh.auth.applyTokenAction('revokeAll')"> - Revoke all tokens - </button> + onclick="swh.auth.applyTokenAction('revokeAll')">Revoke all tokens</button> </div> <table id="swh-bearer-tokens-table" class="table swh-table swh-table-striped" diff --git a/swh/web/banners/templates/banner-iframe.html b/swh/web/banners/templates/banner-iframe.html index 11b3e21e4..6656dba27 100644 --- a/swh/web/banners/templates/banner-iframe.html +++ b/swh/web/banners/templates/banner-iframe.html @@ -11,10 +11,10 @@ See top-level LICENSE file for more information <html class="swh-banner" lang="en"> <head> - <meta charset="utf-8"/> - <meta http-equiv="X-UA-Compatible" content="IE=edge"/> + <meta charset="utf-8" /> + <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" - content="width=device-width, initial-scale=1, shrink-to-fit=no"/> + content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <title>Software Heritage fundraising banner</title> {% render_bundle 'vendors' %} <script> @@ -34,7 +34,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License -along with this program. If not, see <https://www.gnu.org/licenses/>. +along with this program. If not, see <https://www.gnu.org/licenses />. @licend The above is the entire license notice for the JavaScript code in this page. */ diff --git a/swh/web/banners/templates/fundraising-banner.html b/swh/web/banners/templates/fundraising-banner.html index 87a664aff..70e024d9d 100644 --- a/swh/web/banners/templates/fundraising-banner.html +++ b/swh/web/banners/templates/fundraising-banner.html @@ -11,10 +11,10 @@ See top-level LICENSE file for more information <html class="swh-fundraising-banner" lang="en"> <head> - <meta charset="utf-8"/> - <meta http-equiv="X-UA-Compatible" content="IE=edge"/> + <meta charset="utf-8" /> + <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" - content="width=device-width, initial-scale=1, shrink-to-fit=no"/> + content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <title>Software Heritage fundraising banner</title> {% render_bundle 'vendors' %} <script> @@ -34,7 +34,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License -along with this program. If not, see <https://www.gnu.org/licenses/>. +along with this program. If not, see <https://www.gnu.org/licenses />. @licend The above is the entire license notice for the JavaScript code in this page. */ @@ -94,7 +94,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. <div class="row align-items-center justify-content-end d-none d-xl-flex"> <img id="swh-fundraising-img" src="{% static 'img/swh-donor.png' %}" - alt="Software Heritage fundraising"/> + alt="Software Heritage fundraising" /> <div class="col-8 text-right align-middle pr-3"> <a target="_blank" rel="noopener noreferrer" @@ -117,8 +117,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. style="width: {{ goal_percent }}%" aria-valuenow="{{ nb_donations }}" aria-valuemin="0" - aria-valuemax="{{ donations_goal }}"> - </div> + aria-valuemax="{{ donations_goal }}"></div> <small class="justify-content-center d-flex position-absolute w-100"> {% if lang == "en" %} Goal: {{ donations_goal }} donations diff --git a/swh/web/browse/templates/browse-branches.html b/swh/web/browse/templates/browse-branches.html index 3b9952b8f..b6f307923 100644 --- a/swh/web/browse/templates/browse-branches.html +++ b/swh/web/browse/templates/browse-branches.html @@ -45,9 +45,7 @@ See top-level LICENSE file for more information </a> </td> <td class="swh-branch-message swh-table-cell-text-overflow" - title="{{ branch.message }}"> - {{ branch.message }} - </td> + title="{{ branch.message }}">{{ branch.message }}</td> <td class="swh-branch-date">{{ branch.date }}</td> </tr> {% endfor %} diff --git a/swh/web/browse/templates/browse-help.html b/swh/web/browse/templates/browse-help.html index 4243fc73a..a4d1dd0e6 100644 --- a/swh/web/browse/templates/browse-help.html +++ b/swh/web/browse/templates/browse-help.html @@ -60,7 +60,7 @@ See top-level LICENSE file for more information <a href="{% url 'browse-directory' '977fc4b98c0e85816348cebd3b12026407c368b6' %}"> {% url 'browse-directory' '977fc4b98c0e85816348cebd3b12026407c368b6' %} </a> - <br/> + <br /> (see the <a href="https://docs.softwareheritage.org/devel/apidoc/swh.model.git_objects.html#swh.model.git_objects.directory_git_object"> documentation @@ -73,7 +73,7 @@ See top-level LICENSE file for more information <a href="{% url 'browse-revision' 'f1b94134a4b879bc55c3dacdb496690c8ebdc03f' %}"> {% url 'browse-revision' 'f1b94134a4b879bc55c3dacdb496690c8ebdc03f' %} </a> - <br/> + <br /> (see the <a href="https://docs.softwareheritage.org/devel/apidoc/swh.model.git_objects.html#swh.model.git_objects.revision_git_object"> documentation @@ -86,7 +86,7 @@ See top-level LICENSE file for more information <a href="{% url 'browse-snapshot' 'baebc2109e4a2ec22a1129a3859647e191d04df4' %}"> {% url 'browse-snapshot' 'baebc2109e4a2ec22a1129a3859647e191d04df4' %} </a> - <br/> + <br /> (see the <a href="https://docs.softwareheritage.org/devel/apidoc/swh.model.git_objects.html#swh.model.git_objects.snapshot_git_object"> documentation @@ -168,7 +168,5 @@ See top-level LICENSE file for more information In order to facilitate the browsing of the archive and generate relevant entry points to it, a <a href="{% url 'browse-search' %}">search interface</a> is available. Currently, it enables to search software origins from the URLs they were retrieved from. More search criteria will be added in the future. - <script> - swh.webapp.initPage('help'); - </script> + <script>swh.webapp.initPage('help');</script> {% endblock browse-content %} diff --git a/swh/web/browse/templates/browse-iframe.html b/swh/web/browse/templates/browse-iframe.html index 016e8b517..a1aa167a7 100644 --- a/swh/web/browse/templates/browse-iframe.html +++ b/swh/web/browse/templates/browse-iframe.html @@ -12,10 +12,10 @@ See top-level LICENSE file for more information <html lang="en"> <head> - <meta charset="utf-8"/> - <meta http-equiv="X-UA-Compatible" content="IE=edge"/> + <meta charset="utf-8" /> + <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" - content="width=device-width, initial-scale=1, shrink-to-fit=no"/> + content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <title>Software Heritage archived object</title> <script src="{% url 'js-reverse' %}" type="text/javascript"></script> {% render_bundle 'vendors' %} @@ -38,7 +38,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License -along with this program. If not, see <https://www.gnu.org/licenses/>. +along with this program. If not, see <https://www.gnu.org/licenses />. @licend The above is the entire license notice for the JavaScript code in this page. */ @@ -121,14 +121,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. <div class="brand-text sitename"> <img src="{% static 'img/swh-logo.svg' %}" style="height: 40px" - alt="swh logo"/> + alt="swh logo" /> <span class="first-word pl-1">Software</span> <span class="second-word">Heritage</span> </div> </a> <div class="d-none d-md-block"> Navigating in - <img src="{% url 'swh-badge-swhid' swhid %}" alt="{{ swhid }}"/> + <img src="{% url 'swh-badge-swhid' swhid %}" alt="{{ swhid }}" /> </div> <div class="ml-auto d-flex align-items-center"> {% if swhid != focus_swhid %} diff --git a/swh/web/browse/templates/browse-origin-visits.html b/swh/web/browse/templates/browse-origin-visits.html index ba9bcef2e..9456e1d6b 100644 --- a/swh/web/browse/templates/browse-origin-visits.html +++ b/swh/web/browse/templates/browse-origin-visits.html @@ -47,19 +47,17 @@ See top-level LICENSE file for more information id="swh-all-visits" name="swh-visits" value="option3" - checked/> + checked /> <label class="custom-control-label font-weight-normal" for="swh-all-visits" - onclick="swh.origin_visits.showAllVisits(event)"> - Show all visits - </label> + onclick="swh.origin_visits.showAllVisits(event)">Show all visits</label> </div> <div class="custom-control custom-radio custom-control-inline"> <input class="custom-control-input" type="radio" id="swh-full-visits-different-snapshots" name="swh-visits" - value="option1"/> + value="option1" /> <label class="custom-control-label font-weight-normal" for="swh-full-visits-different-snapshots" onclick="swh.origin_visits.showFullVisitsDifferentSnapshots(event)"> @@ -71,12 +69,10 @@ See top-level LICENSE file for more information type="radio" id="swh-full-visits" name="swh-visits" - value="option2"/> + value="option2" /> <label class="custom-control-label font-weight-normal" for="swh-full-visits" - onclick="swh.origin_visits.showFullVisits(event)"> - Show all full visits - </label> + onclick="swh.origin_visits.showFullVisits(event)">Show all full visits</label> </div> </form> <h5>Timeline</h5> diff --git a/swh/web/browse/templates/browse-release.html b/swh/web/browse/templates/browse-release.html index e8332baa6..c4e952c50 100644 --- a/swh/web/browse/templates/browse-release.html +++ b/swh/web/browse/templates/browse-release.html @@ -27,7 +27,7 @@ See top-level LICENSE file for more information </i> {{ release.target_link }} {% if release.directory_link %} - <br/> + <br /> <b>Directory:</b> <i class="{{ swh_object_icons|key_value:'directory' }} mdi-fw" aria-hidden="true"> diff --git a/swh/web/browse/templates/browse-releases.html b/swh/web/browse/templates/browse-releases.html index 6be97f003..24f4ffba7 100644 --- a/swh/web/browse/templates/browse-releases.html +++ b/swh/web/browse/templates/browse-releases.html @@ -54,9 +54,7 @@ See top-level LICENSE file for more information </a> </td> <td class="swh-log-entry-message swh-release-message swh-table-cell-text-overflow" - title="{{ release.message }}"> - {{ release.message }} - </td> + title="{{ release.message }}">{{ release.message }}</td> <td class="swh-release-date">{{ release.date }}</td> </tr> {% endfor %} diff --git a/swh/web/browse/templates/browse-revision-log.html b/swh/web/browse/templates/browse-revision-log.html index 769a0842f..0df11901f 100644 --- a/swh/web/browse/templates/browse-revision-log.html +++ b/swh/web/browse/templates/browse-revision-log.html @@ -22,7 +22,7 @@ See top-level LICENSE file for more information {% if snapshot_context and snapshot_context.is_empty %} {% include "./includes/empty-snapshot.html" %} {% else %} - <hr class="mt-0 mb-0"/> + <hr class="mt-0 mb-0" /> <form class="text-center"> sort by: <div class="custom-control custom-radio custom-control-inline" @@ -33,11 +33,9 @@ See top-level LICENSE file for more information id="revs-ordering-date" value="" onclick="swh.revision.revsOrderingTypeClicked(event)" - checked/> + checked /> <label class="custom-control-label font-weight-normal" - for="revs-ordering-date"> - revision date - </label> + for="revs-ordering-date">revision date</label> </div> <div class="custom-control custom-radio custom-control-inline" title="pre-order, depth-first visit on the revision graph"> @@ -46,7 +44,7 @@ See top-level LICENSE file for more information name="revs-ordering" id="revs-ordering-dfs" value="dfs" - onclick="swh.revision.revsOrderingTypeClicked(event)"/> + onclick="swh.revision.revsOrderingTypeClicked(event)" /> <label class="custom-control-label font-weight-normal" for="revs-ordering-dfs">DFS</label> </div> @@ -57,11 +55,9 @@ See top-level LICENSE file for more information name="revs-ordering" id="revs-ordering-dfs-post" value="dfs_post" - onclick="swh.revision.revsOrderingTypeClicked(event)"/> + onclick="swh.revision.revsOrderingTypeClicked(event)" /> <label class="custom-control-label font-weight-normal" - for="revs-ordering-dfs-post"> - DFS post-ordering - </label> + for="revs-ordering-dfs-post">DFS post-ordering</label> </div> <div class="custom-control custom-radio custom-control-inline" title="breadth-first visit on the revision graph"> @@ -70,7 +66,7 @@ See top-level LICENSE file for more information name="revs-ordering" id="revs-ordering-bfs" value="bfs" - onclick="swh.revision.revsOrderingTypeClicked(event)"/> + onclick="swh.revision.revsOrderingTypeClicked(event)" /> <label class="custom-control-label font-weight-normal" for="revs-ordering-bfs">BFS</label> </div> diff --git a/swh/web/browse/templates/browse-revision.html b/swh/web/browse/templates/browse-revision.html index 8dac63ecb..b762041d3 100644 --- a/swh/web/browse/templates/browse-revision.html +++ b/swh/web/browse/templates/browse-revision.html @@ -101,16 +101,14 @@ See top-level LICENSE file for more information onclick="swh.revision.computeAllDiffs(event)" id="swh-compute-all-diffs" title="By default, diffs will be computed as the view is scrolled. Pushing that button will request the immediate computation of all diffs." - style="visibility: hidden"> - Compute all diffs - </button> + style="visibility: hidden">Compute all diffs</button> </div> <div class="clearfix"></div> </a> </div> <div id="swh-revision-changes-list" class="collapse show"> <div id="swh-revision-changes-loading" class="text-center"> - <img src="{% static 'img/swh-spinner.gif' %}" alt="swh spinner"/> + <img src="{% static 'img/swh-spinner.gif' %}" alt="swh spinner" /> <p>Computing file changes ...</p> </div> <pre style="background: none; border: none; display: none;"></pre> diff --git a/swh/web/browse/templates/browse-search.html b/swh/web/browse/templates/browse-search.html index 9ecc78d05..9bfe02013 100644 --- a/swh/web/browse/templates/browse-search.html +++ b/swh/web/browse/templates/browse-search.html @@ -15,7 +15,7 @@ See top-level LICENSE file for more information {% block browse-content %} {% include "./includes/origin-search-form.html" %} - <hr/> + <hr /> <div id="swh-origin-search-results" class="mb-3" style="display: none;"> <div class="table-responsive"> <table class="table swh-table swh-table-striped" id="origin-search-results"> @@ -32,11 +32,11 @@ See top-level LICENSE file for more information </div> </div> <div class="swh-loading"> - <img src="{% static 'img/swh-spinner.gif' %}" alt="swh spinner"/> + <img src="{% static 'img/swh-spinner.gif' %}" alt="swh spinner" /> <p>Searching origins ...</p> </div> <p id="swh-no-result" style="display: none; white-space: pre;"> - <br/> + <br /> No origins matching the search criteria were found. </p> <ul class="pagination justify-content-center swh-search-pagination"> diff --git a/swh/web/browse/templates/includes/branch-search.html b/swh/web/browse/templates/includes/branch-search.html index ce18eceb4..162878555 100644 --- a/swh/web/browse/templates/includes/branch-search.html +++ b/swh/web/browse/templates/includes/branch-search.html @@ -11,7 +11,7 @@ See top-level LICENSE file for more information placeholder="Search in names" id="swh-branch-search-string" value="{{ search_string }}" - type="text"/> + type="text" /> <div class="input-group-append"> <button class="btn btn-primary" type="submit" id="swh-branch-serach-button"> <i class="swh-search-icon mdi mdi-24px mdi-magnify" aria-hidden="true"></i> diff --git a/swh/web/browse/templates/includes/content-display.html b/swh/web/browse/templates/includes/content-display.html index 010035d0a..560c8b1b9 100644 --- a/swh/web/browse/templates/includes/content-display.html +++ b/swh/web/browse/templates/includes/content-display.html @@ -23,7 +23,7 @@ See top-level LICENSE file for more information {% elif "inode/x-empty" == mimetype %} <i>File is empty</i> {% elif mimetype in browsers_supported_image_mimes and content %} - <img src="data:{{ mimetype }};base64,{{ content }}" alt="image"/> + <img src="data:{{ mimetype }};base64,{{ content }}" alt="image" /> {% elif "application/pdf" == mimetype %} <div class="text-center"> <div class="py-2"> @@ -46,8 +46,8 @@ See top-level LICENSE file for more information {% endif %} </div> {% if not iframe_mode %}</div>{% endif %} - {% if content %} - <script> + {% if content %} + <script> {% if "application/pdf" == mimetype %} swh.webapp.renderPdf({{ top_right_link.url|jsonify }}); {% elif filename and filename|default:""|slice:"-5:" == "ipynb" %} @@ -73,6 +73,6 @@ See top-level LICENSE file for more information } {% endif %} - </script> - {% endif %} + </script> {% endif %} +{% endif %} diff --git a/swh/web/browse/templates/includes/directory-display.html b/swh/web/browse/templates/includes/directory-display.html index 93ff891d6..2494d3e5f 100644 --- a/swh/web/browse/templates/includes/directory-display.html +++ b/swh/web/browse/templates/includes/directory-display.html @@ -46,10 +46,10 @@ See top-level LICENSE file for more information </tbody> </table> </div> - {% if not iframe_mode %}<hr class="mt-0 mb-2"/>{% endif %} + {% if not iframe_mode %}<hr class="mt-0 mb-2" />{% endif %} {% elif "revision_found" in swh_object_metadata and swh_object_metadata.revision_found is False %} <i>Revision {{ swh_object_metadata.revision }} could not be found in the archive.</i> - <br/> + <br /> <i>Its associated directory can not be displayed.</i> {% elif error_code != 200 %} {% include "includes/http-error.html" %} diff --git a/swh/web/browse/templates/includes/origin-search-form.html b/swh/web/browse/templates/includes/origin-search-form.html index 7821cc9c5..0402e1bba 100644 --- a/swh/web/browse/templates/includes/origin-search-form.html +++ b/swh/web/browse/templates/includes/origin-search-form.html @@ -14,7 +14,7 @@ See top-level LICENSE file for more information type="text" id="swh-origins-url-patterns" oninput="swh.webapp.validateSWHIDInput(this)" - autofocus/> + autofocus /> <div class="input-group-append"> <button class="btn btn-primary" type="submit"> <i class="swh-search-icon mdi mdi-24px mdi-magnify" aria-hidden="true"></i> @@ -28,13 +28,9 @@ See top-level LICENSE file for more information <label class="control-label mr-1" style="font-weight: inherit">visit type:</label> <select id="swh-search-visit-type" class="custom-select form-control custom-select-sm"> - <option selected value="any"> - any - </option> + <option selected value="any">any</option> {% for visit_type in visit_types %} - <option value="{{ visit_type }}"> - {{ visit_type }} - </option> + <option value="{{ visit_type }}">{{ visit_type }}</option> {% endfor %} </select> </div> @@ -44,39 +40,33 @@ See top-level LICENSE file for more information value="option-origins-with-visit" type="checkbox" id="swh-search-origins-with-visit" - checked/> + checked /> <label class="custom-control-label font-weight-normal" - for="swh-search-origins-with-visit"> - only show origins visited at least once - </label> + for="swh-search-origins-with-visit">only show origins visited at least once</label> </div> <div class="custom-control custom-checkbox swhid-option"> <input class="custom-control-input" value="option-filter-empty-visits" type="checkbox" id="swh-filter-empty-visits" - checked/> + checked /> <label class="custom-control-label font-weight-normal" - for="swh-filter-empty-visits"> - filter out origins with no archived content - </label> + for="swh-filter-empty-visits">filter out origins with no archived content</label> </div> <div class="custom-control custom-checkbox swhid-option"> <input class="custom-control-input" value="option-filter-empty-visits" type="checkbox" - id="swh-search-origin-metadata"/> + id="swh-search-origin-metadata" /> <label class="custom-control-label font-weight-normal" - for="swh-search-origin-metadata"> - search in metadata (instead of URL) - </label> + for="swh-search-origin-metadata">search in metadata (instead of URL)</label> </div> {% if user.is_authenticated and user.is_staff or "swh.web.search_ql" in user.get_all_permissions %} <div class="custom-control custom-checkbox swhid-option"> <input class="custom-control-input" value="option-use-ql" type="checkbox" - id="swh-search-use-ql"/> + id="swh-search-use-ql" /> <label class="custom-control-label font-weight-normal" for="swh-search-use-ql"> search using the diff --git a/swh/web/browse/templates/includes/revision-info.html b/swh/web/browse/templates/includes/revision-info.html index 86fa8a147..ca975c322 100644 --- a/swh/web/browse/templates/includes/revision-info.html +++ b/swh/web/browse/templates/includes/revision-info.html @@ -24,7 +24,7 @@ See top-level LICENSE file for more information {% endif %} </b> on <b>{{ snapshot_context.revision_info.date }}</b> - <br/> + <br /> <b>{{ snapshot_context.revision_info.message_header }}</b> </div> </div> diff --git a/swh/web/browse/templates/includes/show-swhids.html b/swh/web/browse/templates/includes/show-swhids.html index 4f10e2c08..1f7060cfd 100644 --- a/swh/web/browse/templates/includes/show-swhids.html +++ b/swh/web/browse/templates/includes/show-swhids.html @@ -35,8 +35,8 @@ See top-level LICENSE file for more information SoftWare Heritage persistent IDentifiers (SWHIDs) </a> must be used. - <br/> - <br/> + <br /> + <br /> Select below a type of object currently browsed in order to display its associated SWHID and permalink. </p> <ul id="swhid-object-types" class="nav nav-pills ml-auto p-2"> @@ -75,16 +75,14 @@ See top-level LICENSE file for more information {% if "swh.web.badges" in SWH_DJANGO_APPS %} <div class="swh-badges"> {% if snapshot_context and snapshot_context.origin_info %} - <img class="swh-badge swh-badge-origin" - src="{% url 'swh-badge' 'origin' snapshot_context.origin_info.url %}" - onclick="swh.badges.showBadgeInfoModal('origin', '{{ snapshot_context.origin_info.url|urlencode:"/?:@&" }}')" - title="Click to display badge integration info"/> + <img class="swh-badge swh-badge-origin" alt="origin badge" src="{% url 'swh-badge' 'origin' snapshot_context.origin_info.url %}" onclick="swh.badges.showBadgeInfoModal('origin', '{{ snapshot_context.origin_info.url|urlencode:"/?:@&" }}')" title="Click to display badge integration info" /> {% endif %} {% if swhid_info.object_id %} <img class="swh-badge swh-badge-{{ swhid_info.object_type.name.lower }}" + alt="{{ swhid_info.object_type.name.lower }} badge" src="{% url 'swh-badge' swhid_info.object_type.name.lower swhid_info.object_id %}" onclick="swh.badges.showBadgeInfoModal('{{ swhid_info.object_type.name.lower }}', $(this).closest('.swhid-ui').find('.swhid').text())" - title="Click to display badge integration info"/> + title="Click to display badge integration info" /> {% endif %} </div> {% endif %} @@ -110,7 +108,7 @@ See top-level LICENSE file for more information id="swhid-context-option-{{ swhid_info.object_type.name.lower }}" data-swhid-with-context="{{ swhid_info.swhid_with_context }}" data-swhid-with-context-url="{{ swhid_info.swhid_with_context_url }}" - onclick="swh.browse.swhIdContextOptionToggled(event)"/> + onclick="swh.browse.swhIdContextOptionToggled(event)" /> <label class="custom-control-label font-weight-normal" for="swhid-context-option-{{ swhid_info.object_type.name.lower }}"> Add contextual information diff --git a/swh/web/browse/templates/includes/snapshot-context.html b/swh/web/browse/templates/includes/snapshot-context.html index 858daf43d..67d8df9b5 100644 --- a/swh/web/browse/templates/includes/snapshot-context.html +++ b/swh/web/browse/templates/includes/snapshot-context.html @@ -9,9 +9,7 @@ See top-level LICENSE file for more information <h5> {% if snapshot_context.origin_info %} - <a id="swh-origin-url" - class="swh-heading-color" - href="{% url 'browse-origin' %}?origin_url={{ snapshot_context.origin_info.url|urlencode:"/?:@&" }}"> + <a id="swh-origin-url" class="swh-heading-color" href="{% url 'browse-origin' %}?origin_url={{ snapshot_context.origin_info.url|urlencode:"/?:@&" }}"> <i class="{{ swh_object_icons.origin }} mdi-fw" aria-hidden="true" title="Origin"></i> diff --git a/swh/web/browse/templates/includes/top-navigation.html b/swh/web/browse/templates/includes/top-navigation.html index 463da8852..88b8b285b 100644 --- a/swh/web/browse/templates/includes/top-navigation.html +++ b/swh/web/browse/templates/includes/top-navigation.html @@ -123,13 +123,8 @@ See top-level LICENSE file for more information {% if available_languages %} <select data-placeholder="Select Language" class="language-select chosen-select"> - <option value=""> - </option> - {% for lang in available_languages %} - <option value="{{ lang }}"> - {{ lang }} - </option> - {% endfor %} + <option value=""></option> + {% for lang in available_languages %}<option value="{{ lang }}">{{ lang }}</option>{% endfor %} </select> {% endif %} {% if show_actions %} diff --git a/swh/web/browse/tests/views/test_content.py b/swh/web/browse/tests/views/test_content.py index 6e907d04e..0cfead5ed 100644 --- a/swh/web/browse/tests/views/test_content.py +++ b/swh/web/browse/tests/views/test_content.py @@ -133,7 +133,7 @@ def test_content_view_image(client, archive_data, content_image_type): mimetype = content_display["mimetype"] content_data = content_display["content_data"] assert_contains( - resp, f'<img src="data:{mimetype};base64,{content_data}" alt="image"/>' + resp, f'<img src="data:{mimetype};base64,{content_data}" alt="image" />' ) assert_contains(resp, url_raw) diff --git a/swh/web/deposit/templates/deposit-admin.html b/swh/web/deposit/templates/deposit-admin.html index 1a8420854..be895ca1e 100644 --- a/swh/web/deposit/templates/deposit-admin.html +++ b/swh/web/deposit/templates/deposit-admin.html @@ -40,7 +40,7 @@ See top-level LICENSE file for more information <a class="toggle-col col-hidden" href="#" data-column="7">directory</a> - <a class="toggle-col col-hidden" href="#" data-column="8">directory with context</a> </div> - <br/> + <br /> <table id="swh-admin-deposit-list" class="table swh-table swh-table-striped" width="100%"> diff --git a/swh/web/jslicenses/templates/jslicenses.html b/swh/web/jslicenses/templates/jslicenses.html index 35ae13359..4dd37430a 100644 --- a/swh/web/jslicenses/templates/jslicenses.html +++ b/swh/web/jslicenses/templates/jslicenses.html @@ -48,11 +48,11 @@ See top-level LICENSE file for more information {% for js_license in js_src.licenses %} <a href="{{ js_license.url }}">{{ js_license.name }}</a> {% if js_license.copy_url %}(<a href="{{ js_license.copy_url }}">view</a>){% endif %} - {% if not forloop.last %}<br/>{% endif %} + {% if not forloop.last %}<br />{% endif %} {% endfor %} {% if not forloop.last %} - <br/> - <hr style="margin: 0.25rem"/> + <br /> + <hr style="margin: 0.25rem" /> {% endif %} {% endfor %} </td> @@ -60,11 +60,11 @@ See top-level LICENSE file for more information {% for js_src in bundled_js_srcs %} <a href="{{ js_src.src_url }}">{{ js_src.id }}</a> {% for js_license in js_src.licenses %} - {% if not forloop.last %}<br/>{% endif %} + {% if not forloop.last %}<br />{% endif %} {% endfor %} {% if not forloop.last %} - <br/> - <hr style="margin: 0.25rem"/> + <br /> + <hr style="margin: 0.25rem" /> {% endif %} {% endfor %} </td> diff --git a/swh/web/mailmap/templates/admin/mailmap.html b/swh/web/mailmap/templates/admin/mailmap.html index 64ebeb8c6..6eac3224d 100644 --- a/swh/web/mailmap/templates/admin/mailmap.html +++ b/swh/web/mailmap/templates/admin/mailmap.html @@ -31,9 +31,7 @@ See top-level LICENSE file for more information <div class="float-right"> <button class="btn btn-default" id="swh-add-new-mailmap" - onclick="swh.mailmap.addNewMailmap()"> - Add new mailmap - </button> + onclick="swh.mailmap.addNewMailmap()">Add new mailmap</button> </div> <div style="padding-top: 3rem;"> <table id="swh-mailmaps-table" diff --git a/swh/web/save_code_now/templates/admin/origin-save-filters.html b/swh/web/save_code_now/templates/admin/origin-save-filters.html index 57a8ed2e8..06c3ff723 100644 --- a/swh/web/save_code_now/templates/admin/origin-save-filters.html +++ b/swh/web/save_code_now/templates/admin/origin-save-filters.html @@ -49,13 +49,11 @@ See top-level LICENSE file for more information <input class="form-control" placeholder="Enter authorized origin url prefix to add" type="text" - id="swh-authorized-url-prefix"/> + id="swh-authorized-url-prefix" /> <div class="input-group-append"> <button id="swh-add-authorized-origin-url" class="btn btn-default" - onclick="swh.save_code_now.addAuthorizedOriginUrl()"> - Add new - </button> + onclick="swh.save_code_now.addAuthorizedOriginUrl()">Add new</button> </div> </div> </div> @@ -63,9 +61,7 @@ See top-level LICENSE file for more information <button id="swh-remove-authorized-origin-url" class="btn btn-default swh-action-need-selection" onclick="swh.save_code_now.removeAuthorizedOriginUrl()" - disabled> - Remove selected - </button> + disabled>Remove selected</button> </div> </div> <div class="row mt-3 swh-add-authorized-origin-status"></div> @@ -89,13 +85,11 @@ See top-level LICENSE file for more information <input class="form-control" placeholder="Enter unauthorized origin url prefix to add" type="text" - id="swh-unauthorized-url-prefix"/> + id="swh-unauthorized-url-prefix" /> <div class="input-group-append"> <button id="swh-add-unauthorized-origin-url" class="btn btn-default" - onclick="swh.save_code_now.addUnauthorizedOriginUrl()"> - Add new - </button> + onclick="swh.save_code_now.addUnauthorizedOriginUrl()">Add new</button> </div> </div> </div> @@ -103,9 +97,7 @@ See top-level LICENSE file for more information <button id="swh-remove-unauthorized-origin-url" class="btn btn-default swh-action-need-selection" onclick="swh.save_code_now.removeUnauthorizedOriginUrl()" - disabled> - Remove selected - </button> + disabled>Remove selected</button> </div> </div> <div class="row mt-3 swh-add-unauthorized-origin-status"></div> diff --git a/swh/web/save_code_now/templates/admin/origin-save-requests.html b/swh/web/save_code_now/templates/admin/origin-save-requests.html index 154c9970f..dc14f5d04 100644 --- a/swh/web/save_code_now/templates/admin/origin-save-requests.html +++ b/swh/web/save_code_now/templates/admin/origin-save-requests.html @@ -61,25 +61,19 @@ See top-level LICENSE file for more information <button id="swh-accept-save-origin-request" class="btn btn-default swh-action-need-selection" onclick="swh.save_code_now.acceptOriginSaveRequest()" - disabled> - Accept selected - </button> + disabled>Accept selected</button> </div> <div class="col-md-2"> <button id="swh-reject-save-origin-request" class="btn btn-default swh-action-need-selection" onclick="swh.save_code_now.rejectOriginSaveRequest()" - disabled> - Reject selected - </button> + disabled>Reject selected</button> </div> <div class="col-md-2"> <button id="swh-remove-save-origin-request" class="btn btn-default swh-action-need-selection" onclick="swh.save_code_now.removePendingOriginSaveRequest()" - disabled> - Remove selected - </button> + disabled>Remove selected</button> </div> </div> </div> @@ -107,9 +101,7 @@ See top-level LICENSE file for more information <button id="swh-remove-accepted-save-origin-request" class="btn btn-default swh-action-need-selection" onclick="swh.save_code_now.removeAcceptedOriginSaveRequest()" - disabled> - Remove selected - </button> + disabled>Remove selected</button> </div> </div> </div> @@ -136,9 +128,7 @@ See top-level LICENSE file for more information <button id="swh-remove-rejected-save-origin-request" class="btn btn-default swh-action-need-selection" onclick="swh.save_code_now.removeRejectedOriginSaveRequest()" - disabled> - Remove selected - </button> + disabled>Remove selected</button> </div> </div> </div> diff --git a/swh/web/save_code_now/templates/includes/take-new-snapshot.html b/swh/web/save_code_now/templates/includes/take-new-snapshot.html index 6d1d5c79c..207627fc5 100644 --- a/swh/web/save_code_now/templates/includes/take-new-snapshot.html +++ b/swh/web/save_code_now/templates/includes/take-new-snapshot.html @@ -56,7 +56,7 @@ See top-level LICENSE file for more information <input id="swh-input-visit-type" class="form-control" value="{{ snapshot_context.visit_info.type }}" - disabled/> + disabled /> </div> <div class="form-group col-md-9"> <label for="swh-input-origin-url">Origin url</label> @@ -64,7 +64,7 @@ See top-level LICENSE file for more information class="form-control" id="swh-input-origin-url" value="{{ snapshot_context.origin_info.url }}" - disabled/> + disabled /> </div> </div> <div class="form-row"> @@ -74,9 +74,7 @@ See top-level LICENSE file for more information <label for="swh-take-new-snapshot-submit">​</label> <button type="submit" id="swh-take-new-snapshot-save-submit" - class="btn btn-default btn-block"> - Submit - </button> + class="btn btn-default btn-block">Submit</button> {% elif SWH_MIRROR_CONFIG %} <a class="btn btn-default btn-block" href="https://archive.softwareheritage.org/save?origin_url={{ snapshot_context.origin_info.url }}" @@ -91,7 +89,7 @@ See top-level LICENSE file for more information </form> {% if not SWH_MIRROR_CONFIG %} <div class="swh-processing-save-request text-center" style="display: none"> - <img src="{% static 'img/swh-spinner.gif' %}" alt="swh spinner"/> + <img src="{% static 'img/swh-spinner.gif' %}" alt="swh spinner" /> <p>Processing "take a new snapshot" request ...</p> </div> <div id="swh-take-new-snapshot-request-status"></div> diff --git a/swh/web/save_code_now/templates/origin-save-help.html b/swh/web/save_code_now/templates/origin-save-help.html index 2f33a9582..de8526329 100644 --- a/swh/web/save_code_now/templates/origin-save-help.html +++ b/swh/web/save_code_now/templates/origin-save-help.html @@ -38,16 +38,16 @@ See top-level LICENSE file for more information </li> <li> <b>Origin url:</b> the url of the remote repository for the software origin. - <br/> + <br /> In order to avoid saving errors from Software Heritage, you should provide the clone/checkout url as given by the provider hosting the software origin. - <br/> + <br /> It can easily be found in the web interface used to browse the software origin. - <br/> + <br /> For instance, if you want to save a <code>git</code> origin into the archive, you should check that the command <code>$ git clone <origin_url></code> - <br/> + <br /> does not return an error before submitting a request. </li> </ul> @@ -69,7 +69,7 @@ See top-level LICENSE file for more information Once a save request has been accepted, you can follow its current status in the <a id="swh-show-origin-save-requests-list" href="{% url 'origin-save-list' %}">submitted save requests list</a>. - <br/> + <br /> If you submitted requests while <a href="{% url login_url %}">authenticated</a>, you will be able to only display your own requests. </p> diff --git a/swh/web/save_code_now/templates/origin-save.html b/swh/web/save_code_now/templates/origin-save.html index a58eb484d..7dfef5a7b 100644 --- a/swh/web/save_code_now/templates/origin-save.html +++ b/swh/web/save_code_now/templates/origin-save.html @@ -38,9 +38,7 @@ See top-level LICENSE file for more information required onchange="swh.save_code_now.maybeRequireExtraInputs();"> {% for visit_type in visit_types %} - <option value="{{ visit_type }}"> - {{ visit_type }} - </option> + <option value="{{ visit_type }}">{{ visit_type }}</option> {% endfor %} </select> <div class="invalid-feedback">The origin type must be specified</div> @@ -52,7 +50,7 @@ See top-level LICENSE file for more information id="swh-input-origin-url" oninput="swh.save_code_now.validateSaveOriginUrl(this)" value="{{ origin_url }}" - required/> + required /> <div class="invalid-feedback"> The origin url is not valid or does not reference a code repository </div> @@ -62,9 +60,7 @@ See top-level LICENSE file for more information <label for="swh-input-origin-save-submit">​</label> <button type="submit" id="swh-input-origin-save-submit" - class="btn btn-default btn-block"> - Submit - </button> + class="btn btn-default btn-block">Submit</button> </div> </div> </div> @@ -74,18 +70,18 @@ See top-level LICENSE file for more information style="display: none"> The <code>archives</code> visit type enables to save multiple source code archive files (*.tar.gz, *.zip) under a same software origin. - <br/> + <br /> For each archive file to save, the source code will then be available inside a branch named <code>releases/<version></code> from the snapshot generated by Software Heritage. - <br/> + <br /> All archive files previously saved under the software origin will always be available in each snapshot generated by a new visit. - <br/> + <br /> Please use the form below to add such artifacts to save before submitting a request. </p> </form> <div class="swh-processing-save-request text-center" style="display: none"> - <img src="{% static 'img/swh-spinner.gif' %}" alt="swh spinner"/> + <img src="{% static 'img/swh-spinner.gif' %}" alt="swh spinner" /> <p>Processing "save code now" request ...</p> </div> <div id="swh-origin-save-request-status"></div> diff --git a/swh/web/vault/templates/includes/vault-create-tasks.html b/swh/web/vault/templates/includes/vault-create-tasks.html index 86eb1de1b..43e27ea64 100644 --- a/swh/web/vault/templates/includes/vault-create-tasks.html +++ b/swh/web/vault/templates/includes/vault-create-tasks.html @@ -74,7 +74,7 @@ See top-level LICENSE file for more information <label for="email"> (Optional) Send download link once it is available to that email address: </label> - <input type="email" class="form-control" id="swh-vault-directory-email"/> + <input type="email" class="form-control" id="swh-vault-directory-email" /> </div> </form> </div> @@ -150,7 +150,7 @@ See top-level LICENSE file for more information <label for="email"> (Optional) Send download link once it is available to that email address: </label> - <input type="email" class="form-control" id="swh-vault-revision-email"/> + <input type="email" class="form-control" id="swh-vault-revision-email" /> </div> </form> </div> @@ -208,22 +208,14 @@ See top-level LICENSE file for more information <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> - <h4 class="modal-title" id="invalid-email-modal-label"> - Invalid Email ! - </h4> - <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> - × - </button> + <h4 class="modal-title" id="invalid-email-modal-label">Invalid Email !</h4> + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> </div> <div class="modal-body"> - <p> - The provided email is not well-formed. - </p> + <p>The provided email is not well-formed.</p> </div> <div class="modal-footer"> - <button type="button" class="btn btn-default btn-sm" data-dismiss="modal"> - Ok - </button> + <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">Ok</button> </div> </div> </div> diff --git a/swh/web/vault/templates/vault-ui.html b/swh/web/vault/templates/vault-ui.html index 74e514e59..6cb7525aa 100644 --- a/swh/web/vault/templates/vault-ui.html +++ b/swh/web/vault/templates/vault-ui.html @@ -32,7 +32,7 @@ See top-level LICENSE file for more information <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input" - id="vault-tasks-toggle-selection"/> + id="vault-tasks-toggle-selection" /> <label class="custom-control-label" for="vault-tasks-toggle-selection"></label> </div> </th> diff --git a/swh/web/webapp/templates/includes/favicon.html b/swh/web/webapp/templates/includes/favicon.html index 8eb64021b..62c624ca1 100644 --- a/swh/web/webapp/templates/includes/favicon.html +++ b/swh/web/webapp/templates/includes/favicon.html @@ -9,15 +9,15 @@ See top-level LICENSE file for more information <link rel="icon" href="{% static 'img/icons/swh-logo-32x32.png' %}" - sizes="32x32"/> + sizes="32x32" /> <link rel="icon" href="{% static 'img/icons/swh-logo-archive-192x192.png' %}" - sizes="192x192"/> + sizes="192x192" /> <link rel="apple-touch-icon-precomposed" - href="{% static 'img/icons/swh-logo-archive-180x180.png' %}"/> + href="{% static 'img/icons/swh-logo-archive-180x180.png' %}" /> <link rel="search" type="application/opensearchdescription+xml" title="Software Heritage archive of public source code" - href="{% static 'xml/swh-opensearch.xml' %}"/> + href="{% static 'xml/swh-opensearch.xml' %}" /> <meta name="msapplication-TileImage" - content="{% static 'img/icons/swh-logo-archive-270x270.png' %}"/> + content="{% static 'img/icons/swh-logo-archive-270x270.png' %}" /> diff --git a/swh/web/webapp/templates/includes/footer.html b/swh/web/webapp/templates/includes/footer.html index 7dcc7256c..5dfe4c6ba 100644 --- a/swh/web/webapp/templates/includes/footer.html +++ b/swh/web/webapp/templates/includes/footer.html @@ -9,15 +9,15 @@ See top-level LICENSE file for more information Copyright (C) 2015–{% now "Y" %}, The Software Heritage developers. License: <a href="https://www.gnu.org/licenses/agpl.html">GNU AGPLv3+</a>. -<br/> +<br /> The source code of Software Heritage <em>itself</em> is available on our <a href="https://gitlab.softwareheritage.org">development forge</a>. -<br/> +<br /> The source code files <em>archived</em> by Software Heritage are available under their own copyright and licenses. -<br/> +<br /> <span class="link-color">Terms of use:</span> <a href="https://www.softwareheritage.org/legal/bulk-access-terms-of-use/">Archive access</a>, <a href="https://www.softwareheritage.org/legal/api-terms-of-use/">API</a>- diff --git a/swh/web/webapp/templates/includes/global-modals.html b/swh/web/webapp/templates/includes/global-modals.html index 3592f7f8e..55edbfde5 100644 --- a/swh/web/webapp/templates/includes/global-modals.html +++ b/swh/web/webapp/templates/includes/global-modals.html @@ -50,9 +50,7 @@ See top-level LICENSE file for more information <button type="button" id="swh-web-modal-confirm-ok-btn" class="btn btn-default btn-sm" - data-dismiss="modal"> - Ok - </button> + data-dismiss="modal">Ok</button> </div> </div> </div> diff --git a/swh/web/webapp/templates/includes/http-error.html b/swh/web/webapp/templates/includes/http-error.html index 88ef75859..4c686947c 100644 --- a/swh/web/webapp/templates/includes/http-error.html +++ b/swh/web/webapp/templates/includes/http-error.html @@ -12,11 +12,11 @@ See top-level LICENSE file for more information <div class="swh-http-error-code"> <img class="hidden-xs swh-image-error" src="{% static 'img/swh-logo.svg' %}" - alt="swh logo"/> + alt="swh logo" /> {{ error_code }} <img class="hidden-xs swh-image-error" src="{% static 'img/swh-logo.svg' %}" - alt="swh logo"/> + alt="swh logo" /> </div> <h3>{{ error_message }}</h3> <div class="swh-http-error-desc"> diff --git a/swh/web/webapp/templates/includes/top-bar.html b/swh/web/webapp/templates/includes/top-bar.html index 5a2da2b55..11cbf7b3c 100644 --- a/swh/web/webapp/templates/includes/top-bar.html +++ b/swh/web/webapp/templates/includes/top-bar.html @@ -13,11 +13,9 @@ See top-level LICENSE file for more information <input type="checkbox" class="custom-control-input" id="swh-full-width-switch" - onclick="swh.webapp.fullWidthToggled(event)"/> + onclick="swh.webapp.fullWidthToggled(event)" /> <label class="custom-control-label font-weight-normal" - for="swh-full-width-switch"> - Full width - </label> + for="swh-full-width-switch">Full width</label> </div> </li> {% for text, url in top_bar.links.items %} diff --git a/swh/web/webapp/templates/layout.html b/swh/web/webapp/templates/layout.html index 9354f08ba..f3b040111 100644 --- a/swh/web/webapp/templates/layout.html +++ b/swh/web/webapp/templates/layout.html @@ -13,10 +13,10 @@ See top-level LICENSE file for more information <!DOCTYPE html> <html lang="en"> <head> - <meta charset="utf-8"/> - <meta http-equiv="X-UA-Compatible" content="IE=edge"/> + <meta charset="utf-8" /> + <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" - content="width=device-width, initial-scale=1, shrink-to-fit=no"/> + content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <title> {% block title %} {% block page_title %} @@ -51,7 +51,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License -along with this program. If not, see <https://www.gnu.org/licenses/>. +along with this program. If not, see <https://www.gnu.org/licenses />. @licend The above is the entire license notice for the JavaScript code in this page. */ @@ -85,14 +85,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. <!-- End Matomo Code --> {% endif %} </head> - <body class="hold-transition layout-fixed sidebar-mini {% if sidebar_state == 'collapsed' %} sidebar-collapse{% endif %}"> + <body class="hold-transition layout-fixed sidebar-mini {% if sidebar_state == 'collapsed' %}sidebar-collapse{% endif %}"> <a id="top"></a> <div class="wrapper"> {% include "./includes/top-bar.html" %} {% if "swh.web.banners" in SWH_DJANGO_APPS %} <div class="swh-banner">{% include "downtime-banner.html" %}</div> {% endif %} - <nav class="main-header navbar navbar-expand-lg navbar-light navbar-static-top swh-navbar {% if 'swh.web.banners' in SWH_DJANGO_APPS %} swh-navbar-banner{% endif %}"> + <nav class="main-header navbar navbar-expand-lg navbar-light navbar-static-top swh-navbar {% if 'swh.web.banners' in SWH_DJANGO_APPS %}swh-navbar-banner{% endif %}"> <div class="navbar-header"> <a class="nav-link swh-push-menu" data-widget="pushmenu" @@ -117,234 +117,234 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. {% if request.resolver_match.url_name != 'swh-web-homepage' and request.resolver_match.url_name != 'browse-search' %} <img class="swh-mirror-partner-logo" src="{% static mirror_partner_logo %}" - alt="swh mirror partner logo"/> + alt="swh mirror partner logo" /> {% else %} <img class="swh-mirror-partner-logo swh-mirror-partner-logo-no-search" src="{% static mirror_partner_logo %}" - alt="swh mirror partner logo"/> + alt="swh mirror partner logo" /> {% endif %} {% if "partner_url" in SWH_MIRROR_CONFIG %}</a>{% endif %} - {% endwith %} - {% endif %} - {% if request.resolver_match.url_name != 'swh-web-homepage' and request.resolver_match.url_name != 'browse-search' %} - <form class="form-horizontal d-none d-md-flex input-group swh-search-navbar needs-validation" - id="swh-origins-search-top"> - <input class="form-control" - placeholder="Enter a SWHID to resolve or keyword(s) to search for in origin URLs" - type="text" - id="swh-origins-search-top-input" - oninput="swh.webapp.validateSWHIDInput(this)" - required/> - <div class="input-group-append"> - <button class="btn btn-primary" type="submit"> - <i class="swh-search-icon mdi mdi-24px mdi-magnify" aria-hidden="true"></i> - </button> - </div> - </form> - {% endif %} - </div> + {% endwith %} + {% endif %} + {% if request.resolver_match.url_name != 'swh-web-homepage' and request.resolver_match.url_name != 'browse-search' %} + <form class="form-horizontal d-none d-md-flex input-group swh-search-navbar needs-validation" + id="swh-origins-search-top"> + <input class="form-control" + placeholder="Enter a SWHID to resolve or keyword(s) to search for in origin URLs" + type="text" + id="swh-origins-search-top-input" + oninput="swh.webapp.validateSWHIDInput(this)" + required /> + <div class="input-group-append"> + <button class="btn btn-primary" type="submit"> + <i class="swh-search-icon mdi mdi-24px mdi-magnify" aria-hidden="true"></i> + </button> + </div> + </form> + {% endif %} </div> - </nav> - </div> - <aside class="swh-sidebar main-sidebar {% if 'swh.web.banners' in SWH_DJANGO_APPS %} main-sidebar-banner{% endif %} sidebar-no-expand sidebar-light-primary elevation-4 swh-sidebar-{{ sidebar_state }}"> - <a href="{% url 'swh-web-homepage' %}" class="brand-link"> + </div> + </nav> + </div> + <aside class="swh-sidebar main-sidebar {% if 'swh.web.banners' in SWH_DJANGO_APPS %}main-sidebar-banner{% endif %} sidebar-no-expand sidebar-light-primary elevation-4 swh-sidebar-{{ sidebar_state }}"> + <a href="{% url 'swh-web-homepage' %}" class="brand-link"> + {% if not SWH_MIRROR_CONFIG %} + <img class="brand-image" + src="{% static 'img/swh-logo.png' %}" + alt="swh logo" /> + {% else %} + <img class="brand-image" + src="{% static 'img/swh-mirror.png' %}" + alt="swh logo" /> + {% endif %} + <div class="brand-text sitename" href="{% url 'swh-web-homepage' %}"> + <span class="first-word">Software</span> <span class="second-word">Heritage</span> + </div> + </a> + <a href="{% url 'swh-web-homepage' %}" class="swh-words-logo"> + <div class="swh-words-logo-swh"> + <span class="first-word">Software</span> + <span class="second-word">Heritage</span> + </div> + <span class="swh-text-under-logo"> {% if not SWH_MIRROR_CONFIG %} - <img class="brand-image" - src="{% static 'img/swh-logo.png' %}" - alt="swh logo"/> + Archive {% else %} - <img class="brand-image" - src="{% static 'img/swh-mirror.png' %}" - alt="swh logo"/> + Mirror {% endif %} - <div class="brand-text sitename" href="{% url 'swh-web-homepage' %}"> - <span class="first-word">Software</span> <span class="second-word">Heritage</span> - </div> - </a> - <a href="{% url 'swh-web-homepage' %}" class="swh-words-logo"> - <div class="swh-words-logo-swh"> - <span class="first-word">Software</span> - <span class="second-word">Heritage</span> - </div> - <span class="swh-text-under-logo"> - {% if not SWH_MIRROR_CONFIG %} - Archive - {% else %} - Mirror - {% endif %} - </span> - </a> - <div class="sidebar"> - <nav class="mt-2"> - <ul class="nav nav-pills nav-sidebar flex-column" - data-widget="treeview" - role="menu" - data-accordion="false"> - <li class="nav-header">Features</li> - <li class="nav-item swh-search-item" title="Search archived software"> - <a href="{% url 'browse-search' %}" class="nav-link swh-search-link"> - <i style="color: #e20026;" class="nav-icon mdi mdi-24px mdi-magnify"></i> - <p>Search</p> + </span> + </a> + <div class="sidebar"> + <nav class="mt-2"> + <ul class="nav nav-pills nav-sidebar flex-column" + data-widget="treeview" + role="menu" + data-accordion="false"> + <li class="nav-header">Features</li> + <li class="nav-item swh-search-item" title="Search archived software"> + <a href="{% url 'browse-search' %}" class="nav-link swh-search-link"> + <i style="color: #e20026;" class="nav-icon mdi mdi-24px mdi-magnify"></i> + <p>Search</p> + </a> + </li> + {% if "swh.web.vault" in SWH_DJANGO_APPS %} + <li class="nav-item swh-vault-item" + title="Download archived software from the Vault"> + <a href="{% url 'vault' %}" class="nav-link swh-vault-link"> + <i style="color: #e20026;" class="nav-icon mdi mdi-24px mdi-download"></i> + <p>Downloads</p> </a> </li> - {% if "swh.web.vault" in SWH_DJANGO_APPS %} - <li class="nav-item swh-vault-item" - title="Download archived software from the Vault"> - <a href="{% url 'vault' %}" class="nav-link swh-vault-link"> - <i style="color: #e20026;" class="nav-icon mdi mdi-24px mdi-download"></i> - <p>Downloads</p> + {% endif %} + {% if "swh.web.save_code_now" in SWH_DJANGO_APPS or SWH_MIRROR_CONFIG %} + <li class="nav-item swh-origin-save-item" + title="Request the saving of a software origin into the archive"> + {% if "swh.web.save_code_now" in SWH_DJANGO_APPS %} + <a class="nav-link swh-origin-save-link" href="{% url 'origin-save' %}"> + <i style="color: #e20026;" class="nav-icon mdi mdi-24px mdi-camera"></i> + <p>Save code now</p> + </a> + {% elif SWH_MIRROR_CONFIG %} + <a class="nav-link swh-origin-save-link" + href="https://archive.softwareheritage.org/save/" + target="_blank" + rel="noopener noreferrer"> + <i style="color: #e20026;" class="nav-icon mdi mdi-24px mdi-camera"></i> + <p>Save code now</p> + <i class="nav-icon mdi mdi-open-in-new"></i> + </a> + {% endif %} + </li> + {% endif %} + {% if "swh.web.add_forge_now" in SWH_DJANGO_APPS or SWH_MIRROR_CONFIG %} + <li class="nav-item swh-add-forge-now-item" + title="Request adding a new forge listing"> + {% if "swh.web.add_forge_now" in SWH_DJANGO_APPS %} + <a href="{% url 'forge-add-create' %}" + class="nav-link swh-add-forge-now-link"> + <i style="color: #e20026;" class="nav-icon mdi mdi-24px mdi-anvil"></i> + <p>Add forge now</p> + </a> + {% elif SWH_MIRROR_CONFIG %} + <a href="https://archive.softwareheritage.org/add-forge/request/create/" + class="nav-link swh-add-forge-now-link" + target="_blank" + rel="noopener noreferrer"> + <i style="color: #e20026;" class="nav-icon mdi mdi-24px mdi-anvil"></i> + <p>Add forge now</p> + <i class="nav-icon mdi mdi-open-in-new"></i> + </a> + {% endif %} + </li> + {% endif %} + <li class="nav-item swh-help-item" title="How to browse the archive ?"> + <a href="#" + class="nav-link swh-help-link" + onclick="swh.guided_tour.guidedTourButtonClick(event)"> + <i style="color: #e20026;" class="nav-icon mdi mdi-24px mdi-help-circle"></i> + <p>Help</p> + </a> + </li> + {% if user.is_authenticated and not SWH_MIRROR_CONFIG %} + <li class="nav-header">Administration</li> + {% if "swh.web.save_code_now" in SWH_DJANGO_APPS and user.is_staff %} + <li class="nav-item swh-origin-save-admin-item" + title="Save code now administration"> + <a href="{% url 'admin-origin-save-requests' %}" + class="nav-link swh-origin-save-admin-link"> + <i style="color: #fecd1b;" class="nav-icon mdi mdi-24px mdi-camera"></i> + <p>Save code now</p> </a> </li> {% endif %} - {% if "swh.web.save_code_now" in SWH_DJANGO_APPS or SWH_MIRROR_CONFIG %} - <li class="nav-item swh-origin-save-item" - title="Request the saving of a software origin into the archive"> - {% if "swh.web.save_code_now" in SWH_DJANGO_APPS %} - <a class="nav-link swh-origin-save-link" href="{% url 'origin-save' %}"> - <i style="color: #e20026;" class="nav-icon mdi mdi-24px mdi-camera"></i> - <p>Save code now</p> - </a> - {% elif SWH_MIRROR_CONFIG %} - <a class="nav-link swh-origin-save-link" - href="https://archive.softwareheritage.org/save/" - target="_blank" - rel="noopener noreferrer"> - <i style="color: #e20026;" class="nav-icon mdi mdi-24px mdi-camera"></i> - <p>Save code now</p> - <i class="nav-icon mdi mdi-open-in-new"></i> - </a> - {% endif %} - </li> - {% endif %} - {% if "swh.web.add_forge_now" in SWH_DJANGO_APPS or SWH_MIRROR_CONFIG %} - <li class="nav-item swh-add-forge-now-item" - title="Request adding a new forge listing"> - {% if "swh.web.add_forge_now" in SWH_DJANGO_APPS %} - <a href="{% url 'forge-add-create' %}" - class="nav-link swh-add-forge-now-link"> - <i style="color: #e20026;" class="nav-icon mdi mdi-24px mdi-anvil"></i> - <p>Add forge now</p> - </a> - {% elif SWH_MIRROR_CONFIG %} - <a href="https://archive.softwareheritage.org/add-forge/request/create/" - class="nav-link swh-add-forge-now-link" - target="_blank" - rel="noopener noreferrer"> - <i style="color: #e20026;" class="nav-icon mdi mdi-24px mdi-anvil"></i> + {% if "swh.web.add_forge_now" in SWH_DJANGO_APPS %} + {% if user.is_staff or ADD_FORGE_MODERATOR_PERMISSION in user.get_all_permissions %} + <li class="nav-item swh-add-forge-now-moderation-item" + title="Add forge now moderation"> + <a href="{% url 'add-forge-now-requests-moderation' %}" + class="nav-link swh-add-forge-now-moderation-link"> + <i style="color: #fecd1b;" class="nav-icon mdi mdi-24px mdi-anvil"></i> <p>Add forge now</p> - <i class="nav-icon mdi mdi-open-in-new"></i> - </a> - {% endif %} - </li> - {% endif %} - <li class="nav-item swh-help-item" title="How to browse the archive ?"> - <a href="#" - class="nav-link swh-help-link" - onclick="swh.guided_tour.guidedTourButtonClick(event)"> - <i style="color: #e20026;" class="nav-icon mdi mdi-24px mdi-help-circle"></i> - <p>Help</p> - </a> - </li> - {% if user.is_authenticated and not SWH_MIRROR_CONFIG %} - <li class="nav-header">Administration</li> - {% if "swh.web.save_code_now" in SWH_DJANGO_APPS and user.is_staff %} - <li class="nav-item swh-origin-save-admin-item" - title="Save code now administration"> - <a href="{% url 'admin-origin-save-requests' %}" - class="nav-link swh-origin-save-admin-link"> - <i style="color: #fecd1b;" class="nav-icon mdi mdi-24px mdi-camera"></i> - <p>Save code now</p> </a> </li> {% endif %} - {% if "swh.web.add_forge_now" in SWH_DJANGO_APPS %} - {% if user.is_staff or ADD_FORGE_MODERATOR_PERMISSION in user.get_all_permissions %} - <li class="nav-item swh-add-forge-now-moderation-item" - title="Add forge now moderation"> - <a href="{% url 'add-forge-now-requests-moderation' %}" - class="nav-link swh-add-forge-now-moderation-link"> - <i style="color: #fecd1b;" class="nav-icon mdi mdi-24px mdi-anvil"></i> - <p>Add forge now</p> - </a> - </li> - {% endif %} - {% endif %} - {% if "swh.web.deposit" in SWH_DJANGO_APPS %} - {% if user.is_staff or ADMIN_LIST_DEPOSIT_PERMISSION in user.get_all_permissions %} - <li class="nav-item swh-deposit-admin-item" - title="Deposit administration"> - <a href="{% url 'admin-deposit' %}" - class="nav-link swh-deposit-admin-link"> - <i style="color: #fecd1b" - class="nav-icon mdi mdi-24px mdi-folder-upload"></i> - <p>Deposit</p> - </a> - </li> - {% endif %} - {% endif %} - {% if "swh.web.mailmap" in SWH_DJANGO_APPS and MAILMAP_ADMIN_PERMISSION in user.get_all_permissions %} - <li class="nav-item swh-mailmap-admin-item" - title="Mailmap administration"> - <a href="{% url 'admin-mailmap' %}" - class="nav-link swh-mailmap-admin-link"> - <i style="color: #fecd1b;" class="nav-icon mdi mdi-24px mdi-email"></i> - <p>Mailmap</p> + {% endif %} + {% if "swh.web.deposit" in SWH_DJANGO_APPS %} + {% if user.is_staff or ADMIN_LIST_DEPOSIT_PERMISSION in user.get_all_permissions %} + <li class="nav-item swh-deposit-admin-item" + title="Deposit administration"> + <a href="{% url 'admin-deposit' %}" + class="nav-link swh-deposit-admin-link"> + <i style="color: #fecd1b" + class="nav-icon mdi mdi-24px mdi-folder-upload"></i> + <p>Deposit</p> </a> </li> {% endif %} {% endif %} - </ul> - </nav> - </div> - </aside> - <div class="content-wrapper"> - <section class="content"> - <div class="container" id="swh-web-content"> - {% if show_corner_ribbon %} - {% if swh_web_staging %} - <div class="swh-corner-ribbon {% if 'swh.web.banners' in SWH_DJANGO_APPS %} swh-corner-ribbon-banner{% endif %}"> - Staging - <br/> - v{{ swh_web_version }} - </div> - {% elif swh_web_dev %} - <div class="swh-corner-ribbon {% if 'swh.web.banners' in SWH_DJANGO_APPS %} swh-corner-ribbon-banner{% endif %}"> - Development - <br/> - v{{ swh_web_version|split:"+"|first }} - </div> + {% if "swh.web.mailmap" in SWH_DJANGO_APPS and MAILMAP_ADMIN_PERMISSION in user.get_all_permissions %} + <li class="nav-item swh-mailmap-admin-item" + title="Mailmap administration"> + <a href="{% url 'admin-mailmap' %}" + class="nav-link swh-mailmap-admin-link"> + <i style="color: #fecd1b;" class="nav-icon mdi mdi-24px mdi-email"></i> + <p>Mailmap</p> + </a> + </li> {% endif %} {% endif %} - {% block content %} - {% endblock content %} - - </div> - </section> + </ul> + </nav> </div> - {% include "includes/global-modals.html" %} - <footer class="footer"> - <div class="container text-center"> - {% if not SWH_MIRROR_CONFIG %} - {% include "./includes/footer.html" %} - {% else %} - {% include "mirror-footer.html" %} + </aside> + <div class="content-wrapper"> + <section class="content"> + <div class="container" id="swh-web-content"> + {% if show_corner_ribbon %} + {% if swh_web_staging %} + <div class="swh-corner-ribbon {% if 'swh.web.banners' in SWH_DJANGO_APPS %}swh-corner-ribbon-banner{% endif %}"> + Staging + <br /> + v{{ swh_web_version }} + </div> + {% elif swh_web_dev %} + <div class="swh-corner-ribbon {% if 'swh.web.banners' in SWH_DJANGO_APPS %}swh-corner-ribbon-banner{% endif %}"> + Development + <br /> + v{{ swh_web_version|split:"+"|first }} + </div> + {% endif %} {% endif %} - <br/> - {% if "production" not in DJANGO_SETTINGS_MODULE %}swh-web v{{ swh_web_version }}{% endif %} + {% block content %} + {% endblock content %} + </div> - </footer> - <div id="back-to-top"> - <a href="#top"> - <img alt="back to top" src="{% static 'img/arrow-up-small.png' %}" /> - </a> + </section> + </div> + {% include "includes/global-modals.html" %} + <footer class="footer"> + <div class="container text-center"> + {% if not SWH_MIRROR_CONFIG %} + {% include "./includes/footer.html" %} + {% else %} + {% include "mirror-footer.html" %} + {% endif %} + <br /> + {% if "production" not in DJANGO_SETTINGS_MODULE %}swh-web v{{ swh_web_version }}{% endif %} </div> - <script> + </footer> + <div id="back-to-top"> + <a href="#top"> + <img alt="back to top" src="{% static 'img/arrow-up-small.png' %}" /> + </a> + </div> + <script> swh.webapp.setContainerFullWidth(); {% if "server_url" in status and "json_path" in status %} var statusServerURL = {{ status.server_url|jsonify }}; var statusJsonPath = {{ status.json_path|jsonify }}; swh.webapp.initStatusWidget(statusServerURL + statusJsonPath); {% endif %} - </script> - </body> - </html> + </script> + </body> +</html> -- GitLab