swh.web 0.16.3__py3-none-any.whl → 0.16.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- swh/web/add_forge_now/templates/add-forge-request-dashboard.html +5 -2
- swh/web/api/views/origin.py +2 -2
- swh/web/archive_coverage/views.py +4 -7
- swh/web/badges/__init__.py +1 -1
- swh/web/badges/assets/index.js +40 -14
- swh/web/browse/assets/browse/browse.css +5 -0
- swh/web/browse/assets/browse/sidetabs.js +3 -16
- swh/web/browse/templates/browse-iframe.html +9 -7
- swh/web/browse/templates/browse-origin-visits.html +2 -2
- swh/web/browse/templates/browse-revision.html +5 -3
- swh/web/browse/templates/includes/content-display.html +10 -5
- swh/web/browse/templates/includes/readme-display.html +3 -2
- swh/web/browse/templates/includes/show-metadata.html +3 -2
- swh/web/browse/templates/includes/sidetabs.html +9 -7
- swh/web/browse/templates/includes/top-navigation.html +2 -1
- swh/web/browse/tests/views/test_origin.py +3 -1
- swh/web/deposit/templates/deposit-admin.html +6 -1
- swh/web/static/css/{archive_coverage.70eba3d32ed75472d638.css → archive_coverage.df54ae8fe40453ecd972.css} +2 -2
- swh/web/static/css/archive_coverage.df54ae8fe40453ecd972.css.map +1 -0
- swh/web/static/css/browse.633076034514e6a3977d.css +2 -0
- swh/web/static/css/browse.633076034514e6a3977d.css.map +1 -0
- swh/web/static/css/guided_tour.d496a0c252e1bb193496.css +2 -0
- swh/web/static/css/{guided_tour.62c03630e944b8b8d9ad.css.map → guided_tour.d496a0c252e1bb193496.css.map} +1 -1
- swh/web/static/css/{highlightjs.0c1b181eb006699a4c3e.css → highlightjs.37238c93749cb449800d.css} +2 -2
- swh/web/static/css/highlightjs.37238c93749cb449800d.css.map +1 -0
- swh/web/static/css/origin_visits.9a796c4df6606bd9905f.css +2 -0
- swh/web/static/css/origin_visits.9a796c4df6606bd9905f.css.map +1 -0
- swh/web/static/css/vendors.a4844da6ce54cbc04960.css +24 -0
- swh/web/static/css/vendors.a4844da6ce54cbc04960.css.map +1 -0
- swh/web/static/css/{webapp.4655323082740f1a4862.css → webapp.e995faa24f8c84db0d06.css} +2 -2
- swh/web/static/css/webapp.e995faa24f8c84db0d06.css.map +1 -0
- swh/web/static/js/add_forge_now.e85d09463e38c1e19632.js +3 -0
- swh/web/static/js/add_forge_now.e85d09463e38c1e19632.js.map +1 -0
- swh/web/static/js/auth.06c697ab58b81d08ebce.js +3 -0
- swh/web/static/js/auth.06c697ab58b81d08ebce.js.map +1 -0
- swh/web/static/js/badges.50941e27bf5e4453b0e0.js +3 -0
- swh/web/static/js/badges.50941e27bf5e4453b0e0.js.LICENSE.txt +6 -0
- swh/web/static/js/badges.50941e27bf5e4453b0e0.js.map +1 -0
- swh/web/static/js/browse.3f22819b69002c8b6407.js +3 -0
- swh/web/static/js/browse.3f22819b69002c8b6407.js.map +1 -0
- swh/web/static/js/deposit.d47e18177b16ccdbdb84.js.map +1 -1
- swh/web/static/js/{highlightjs.14fc09414685bf90c554.js → highlightjs.516e784a1e62011c7605.js} +3 -3
- swh/web/static/js/highlightjs.516e784a1e62011c7605.js.map +1 -0
- swh/web/static/js/mailmap.de04f685e56eff5b627f.js +3 -0
- swh/web/static/js/mailmap.de04f685e56eff5b627f.js.map +1 -0
- swh/web/static/js/mathjax.98ef576f318f1a0b0c4a.js.map +1 -1
- swh/web/static/js/pdf.worker.min.js +1 -1
- swh/web/static/js/pdfjs.018d9890c044b3612ece.js +3 -0
- swh/web/static/js/pdfjs.018d9890c044b3612ece.js.map +1 -0
- swh/web/static/js/{revision.61c9277f4a4c63df0f45.js → revision.122a31614a5f9abffc3c.js} +3 -3
- swh/web/static/js/revision.122a31614a5f9abffc3c.js.map +1 -0
- swh/web/static/js/save_code_now.d4d8fc47420a4badb683.js +3 -0
- swh/web/static/js/save_code_now.d4d8fc47420a4badb683.js.map +1 -0
- swh/web/static/js/vault.d2ec3dd1d84a8d038a6c.js +3 -0
- swh/web/static/js/vault.d2ec3dd1d84a8d038a6c.js.map +1 -0
- swh/web/static/js/vendors.f62cb86cf3b92ae280ee.js +3 -0
- swh/web/static/js/{vendors.9fc5b97b8e4691b7272e.js.LICENSE.txt → vendors.f62cb86cf3b92ae280ee.js.LICENSE.txt} +5 -1
- swh/web/static/js/vendors.f62cb86cf3b92ae280ee.js.map +1 -0
- swh/web/static/js/webapp.e93873983e400db67bf8.js +3 -0
- swh/web/static/js/{webapp.c5e37f8f7bfc8bb87ad8.js.map → webapp.e93873983e400db67bf8.js.map} +1 -1
- swh/web/static/jssources/assets/src/utils/functions.js +4 -4
- swh/web/static/jssources/datatables.net/js/dataTables.mjs +108 -44
- swh/web/static/jssources/datatables.net-fixedheader/js/dataTables.fixedHeader.mjs +10 -4
- swh/web/static/jssources/datatables.net-fixedheader/node_modules/datatables.net/js/dataTables.mjs +14027 -0
- swh/web/static/jssources/datatables.net-fixedheader-bs5/node_modules/datatables.net/js/dataTables.mjs +14027 -0
- swh/web/static/jssources/datatables.net-fixedheader-bs5/node_modules/datatables.net-bs5/js/dataTables.bootstrap5.mjs +81 -0
- swh/web/static/jssources/highlightjs-macaulay2/dist/macaulay2.min.js +3 -3
- swh/web/static/jssources/jslicenses.json +1 -1
- swh/web/static/jssources/pdfjs-dist/build/pdf.worker.mjs +885 -596
- swh/web/static/jssources/pdfjs-dist/legacy/build/pdf.mjs +4982 -4566
- swh/web/static/jssources/swh/web/badges/assets/index.js +40 -14
- swh/web/static/jssources/swh/web/browse/assets/browse/sidetabs.js +3 -16
- swh/web/static/jssources/swh/web/vault/assets/vault-ui.js +6 -4
- swh/web/static/jssources/swh/web/webapp/assets/webapp/webapp-utils.js +18 -1
- swh/web/static/security.txt +3 -0
- swh/web/static/webpack-stats.json +240 -235
- swh/web/utils/swh_templatetags.py +8 -13
- swh/web/vault/assets/vault-ui.js +6 -4
- swh/web/webapp/assets/webapp/webapp-utils.js +18 -1
- swh/web/webapp/assets/webapp/webapp.css +8 -0
- swh/web/webapp/templates/layout.html +13 -10
- swh/web/webapp/tests/test_views.py +16 -1
- {swh_web-0.16.3.dist-info → swh_web-0.16.4.dist-info}/METADATA +2 -3
- {swh_web-0.16.3.dist-info → swh_web-0.16.4.dist-info}/RECORD +98 -93
- swh/web/static/css/archive_coverage.70eba3d32ed75472d638.css.map +0 -1
- swh/web/static/css/browse.0a250d3b07ce628588a5.css +0 -2
- swh/web/static/css/browse.0a250d3b07ce628588a5.css.map +0 -1
- swh/web/static/css/guided_tour.62c03630e944b8b8d9ad.css +0 -2
- swh/web/static/css/highlightjs.0c1b181eb006699a4c3e.css.map +0 -1
- swh/web/static/css/origin_visits.88099d68a63f86af2f8e.css +0 -2
- swh/web/static/css/origin_visits.88099d68a63f86af2f8e.css.map +0 -1
- swh/web/static/css/vendors.1cfc8080eed63af482cf.css +0 -24
- swh/web/static/css/vendors.1cfc8080eed63af482cf.css.map +0 -1
- swh/web/static/css/webapp.4655323082740f1a4862.css.map +0 -1
- swh/web/static/js/add_forge_now.e25d1ad2ab6c45e60b67.js +0 -3
- swh/web/static/js/add_forge_now.e25d1ad2ab6c45e60b67.js.map +0 -1
- swh/web/static/js/auth.bd2f475f49caa9f84e99.js +0 -3
- swh/web/static/js/auth.bd2f475f49caa9f84e99.js.map +0 -1
- swh/web/static/js/badges.f02607179ad0264e7522.js +0 -2
- swh/web/static/js/badges.f02607179ad0264e7522.js.map +0 -1
- swh/web/static/js/browse.fc5d5fafca71e03d2add.js +0 -3
- swh/web/static/js/browse.fc5d5fafca71e03d2add.js.map +0 -1
- swh/web/static/js/highlightjs.14fc09414685bf90c554.js.map +0 -1
- swh/web/static/js/mailmap.631c53127ba5511ebda7.js +0 -3
- swh/web/static/js/mailmap.631c53127ba5511ebda7.js.map +0 -1
- swh/web/static/js/pdfjs.40675676ebcbdde8baab.js +0 -3
- swh/web/static/js/pdfjs.40675676ebcbdde8baab.js.map +0 -1
- swh/web/static/js/revision.61c9277f4a4c63df0f45.js.map +0 -1
- swh/web/static/js/save_code_now.4211098f5dd740dc49b4.js +0 -3
- swh/web/static/js/save_code_now.4211098f5dd740dc49b4.js.map +0 -1
- swh/web/static/js/vault.4eaa8dbf376ebe9cdc7f.js +0 -3
- swh/web/static/js/vault.4eaa8dbf376ebe9cdc7f.js.map +0 -1
- swh/web/static/js/vendors.9fc5b97b8e4691b7272e.js +0 -3
- swh/web/static/js/vendors.9fc5b97b8e4691b7272e.js.map +0 -1
- swh/web/static/js/webapp.c5e37f8f7bfc8bb87ad8.js +0 -3
- /swh/web/static/js/{add_forge_now.e25d1ad2ab6c45e60b67.js.LICENSE.txt → add_forge_now.e85d09463e38c1e19632.js.LICENSE.txt} +0 -0
- /swh/web/static/js/{auth.bd2f475f49caa9f84e99.js.LICENSE.txt → auth.06c697ab58b81d08ebce.js.LICENSE.txt} +0 -0
- /swh/web/static/js/{browse.fc5d5fafca71e03d2add.js.LICENSE.txt → browse.3f22819b69002c8b6407.js.LICENSE.txt} +0 -0
- /swh/web/static/js/{highlightjs.14fc09414685bf90c554.js.LICENSE.txt → highlightjs.516e784a1e62011c7605.js.LICENSE.txt} +0 -0
- /swh/web/static/js/{mailmap.631c53127ba5511ebda7.js.LICENSE.txt → mailmap.de04f685e56eff5b627f.js.LICENSE.txt} +0 -0
- /swh/web/static/js/{pdfjs.40675676ebcbdde8baab.js.LICENSE.txt → pdfjs.018d9890c044b3612ece.js.LICENSE.txt} +0 -0
- /swh/web/static/js/{revision.61c9277f4a4c63df0f45.js.LICENSE.txt → revision.122a31614a5f9abffc3c.js.LICENSE.txt} +0 -0
- /swh/web/static/js/{save_code_now.4211098f5dd740dc49b4.js.LICENSE.txt → save_code_now.d4d8fc47420a4badb683.js.LICENSE.txt} +0 -0
- /swh/web/static/js/{vault.4eaa8dbf376ebe9cdc7f.js.LICENSE.txt → vault.d2ec3dd1d84a8d038a6c.js.LICENSE.txt} +0 -0
- /swh/web/static/js/{webapp.c5e37f8f7bfc8bb87ad8.js.LICENSE.txt → webapp.e93873983e400db67bf8.js.LICENSE.txt} +0 -0
- {swh_web-0.16.3.dist-info → swh_web-0.16.4.dist-info}/WHEEL +0 -0
- {swh_web-0.16.3.dist-info → swh_web-0.16.4.dist-info}/licenses/AUTHORS +0 -0
- {swh_web-0.16.3.dist-info → swh_web-0.16.4.dist-info}/licenses/LICENSE +0 -0
- {swh_web-0.16.3.dist-info → swh_web-0.16.4.dist-info}/top_level.txt +0 -0
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
# License: GNU Affero General Public License version 3, or any later version
|
|
4
4
|
# See top-level LICENSE file for more information
|
|
5
5
|
|
|
6
|
-
import json
|
|
7
6
|
import re
|
|
8
7
|
from typing import Optional
|
|
9
8
|
|
|
10
9
|
from django import template
|
|
11
10
|
from django.contrib.staticfiles.finders import find
|
|
12
|
-
from django.utils.
|
|
11
|
+
from django.utils.html import json_script
|
|
13
12
|
|
|
14
13
|
from swh.web.save_code_now.origin_save import get_savable_visit_types
|
|
15
14
|
from swh.web.utils import rst_to_html
|
|
@@ -72,19 +71,15 @@ def urlize_header_links(text):
|
|
|
72
71
|
return ret[:-1]
|
|
73
72
|
|
|
74
73
|
|
|
75
|
-
@register.filter
|
|
76
|
-
def
|
|
77
|
-
"""
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
Args
|
|
81
|
-
obj: Any django template context variable
|
|
82
|
-
|
|
83
|
-
Returns:
|
|
84
|
-
JSON representation of the variable.
|
|
74
|
+
@register.filter(safe=True)
|
|
75
|
+
def swh_json_script(value, element_id):
|
|
76
|
+
"""Safely outputs a Python object as JSON, wrapped in a <script> tag,
|
|
77
|
+
ready for use with JavaScript.
|
|
85
78
|
|
|
79
|
+
Same as ``json_script`` template filter from django but using a custom
|
|
80
|
+
JSON encoder.
|
|
86
81
|
"""
|
|
87
|
-
return
|
|
82
|
+
return json_script(value, element_id, encoder=SWHDjangoJSONEncoder)
|
|
88
83
|
|
|
89
84
|
|
|
90
85
|
@register.filter
|
swh/web/vault/assets/vault-ui.js
CHANGED
|
@@ -181,15 +181,17 @@ async function checkVaultCookingTasks() {
|
|
|
181
181
|
});
|
|
182
182
|
try {
|
|
183
183
|
const responses = await Promise.all(cookingTaskRequests);
|
|
184
|
-
handleFetchErrors(responses);
|
|
184
|
+
handleFetchErrors(responses, [404]);
|
|
185
185
|
const cookingTasks = await Promise.all(responses.map(r => r.json()));
|
|
186
186
|
|
|
187
187
|
const table = $('#vault-cooking-tasks tbody');
|
|
188
188
|
for (let i = 0; i < cookingTasks.length; ++i) {
|
|
189
189
|
const cookingTask = tasks[cookingTasks[i].swhid];
|
|
190
|
-
cookingTask
|
|
191
|
-
|
|
192
|
-
|
|
190
|
+
if (cookingTask) {
|
|
191
|
+
cookingTask.status = cookingTasks[i].status;
|
|
192
|
+
cookingTask.fetch_url = cookingTasks[i].fetch_url;
|
|
193
|
+
cookingTask.progress_message = cookingTasks[i].progress_message;
|
|
194
|
+
}
|
|
193
195
|
}
|
|
194
196
|
for (let i = 0; i < vaultCookingTasks.length; ++i) {
|
|
195
197
|
const cookingTask = vaultCookingTasks[i];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (C) 2018-
|
|
2
|
+
* Copyright (C) 2018-2025 The Software Heritage developers
|
|
3
3
|
* See the AUTHORS file at the top-level directory of this distribution
|
|
4
4
|
* License: GNU Affero General Public License version 3, or any later version
|
|
5
5
|
* See top-level LICENSE file for more information
|
|
@@ -399,3 +399,20 @@ export function mirrorConfig() {
|
|
|
399
399
|
export function resizeIframe() {
|
|
400
400
|
return iframeResize.apply(null, arguments)[0].iframeResizer;
|
|
401
401
|
}
|
|
402
|
+
|
|
403
|
+
export function parseJsonScript(scriptElementId) {
|
|
404
|
+
return JSON.parse($(`#${scriptElementId}`).text());
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export function toggleButtonText(button, text) {
|
|
408
|
+
const currentLabel = button.innerHTML;
|
|
409
|
+
|
|
410
|
+
if (currentLabel === text) {
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
button.innerHTML = text;
|
|
415
|
+
setTimeout(function() {
|
|
416
|
+
button.innerHTML = currentLabel;
|
|
417
|
+
}, 1000);
|
|
418
|
+
};
|
|
@@ -18,6 +18,14 @@ body {
|
|
|
18
18
|
overflow-y: clip;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
/* Prevent scrolling of background when modal is opened */
|
|
22
|
+
body.modal-open {
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
position: fixed;
|
|
25
|
+
width: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
21
29
|
/* The Alegreya font used in swh-web ships some ligatures producing
|
|
22
30
|
confusing text rendering, for instance the ligatures for `~` and some
|
|
23
31
|
characters like e, y, u, ... so disable font common ligatures */
|
|
@@ -56,9 +56,9 @@ along with this program. If not, see <https://www.gnu.org/licenses />.
|
|
|
56
56
|
@licend The above is the entire license notice for the JavaScript code in this page.
|
|
57
57
|
*/
|
|
58
58
|
</script>
|
|
59
|
-
<script>SWH_CONFIG = {{swh_client_config|jsonify}};</script>
|
|
60
59
|
<script src="{% url 'js-reverse' %}" type="text/javascript"></script>
|
|
61
|
-
|
|
60
|
+
{{ swh_object_icons|swh_json_script:"swh_object_icons" }}
|
|
61
|
+
<script>swh.webapp.setSwhObjectIcons(swh.webapp.parseJsonScript('swh_object_icons'));</script>
|
|
62
62
|
{{ request.user.is_authenticated|json_script:"swh_user_logged_in" }}
|
|
63
63
|
{{ request.user.is_staff|json_script:"swh_user_is_staff" }}
|
|
64
64
|
{{ user_is_ambassador|json_script:"swh_user_is_ambassador" }}
|
|
@@ -187,13 +187,16 @@ along with this program. If not, see <https://www.gnu.org/licenses />.
|
|
|
187
187
|
</main>
|
|
188
188
|
{% include "./includes/footer.html" %}
|
|
189
189
|
</div>
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
{
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
swh.webapp.initStatusWidget(
|
|
196
|
-
|
|
197
|
-
|
|
190
|
+
{% if "server_url" in status and "json_path" in status %}
|
|
191
|
+
{{ status.server_url|swh_json_script:"status_server_url" }}
|
|
192
|
+
{{ status.json_path|swh_json_script:"status_json_path" }}
|
|
193
|
+
<script>
|
|
194
|
+
swh.webapp.setContainerFullWidth();
|
|
195
|
+
swh.webapp.initStatusWidget(
|
|
196
|
+
swh.webapp.parseJsonScript('status_server_url') +
|
|
197
|
+
swh.webapp.parseJsonScript('status_json_path')
|
|
198
|
+
);
|
|
199
|
+
</script>
|
|
200
|
+
{% endif %}
|
|
198
201
|
</body>
|
|
199
202
|
</html>
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
# Copyright (C) 2022 The Software Heritage developers
|
|
1
|
+
# Copyright (C) 2022-2025 The Software Heritage developers
|
|
2
2
|
# See the AUTHORS file at the top-level directory of this distribution
|
|
3
3
|
# License: GNU Affero General Public License version 3, or any later version
|
|
4
4
|
# See top-level LICENSE file for more information
|
|
5
|
+
from datetime import datetime
|
|
6
|
+
from pathlib import Path
|
|
5
7
|
|
|
6
8
|
from django.templatetags.static import static
|
|
9
|
+
from django.utils import timezone
|
|
7
10
|
|
|
8
11
|
from swh.web.tests.helpers import check_html_get_response, check_http_get_response
|
|
9
12
|
from swh.web.utils import reverse
|
|
@@ -29,3 +32,15 @@ def test_favicon_view(client):
|
|
|
29
32
|
url = reverse("favicon")
|
|
30
33
|
resp = check_http_get_response(client, url, status_code=301)
|
|
31
34
|
assert resp["location"] == static(SWH_FAVICON)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def test_securitytxt_static(settings):
|
|
38
|
+
security_txt = Path(settings.STATIC_DIR) / "security.txt"
|
|
39
|
+
# static/security.txt contains a static expiration date, this test will fail
|
|
40
|
+
# if it expires in less than 30 days so we can check the file content is still
|
|
41
|
+
# valid
|
|
42
|
+
expiration_date = datetime.fromisoformat(
|
|
43
|
+
security_txt.read_text().splitlines()[1].split(": ")[1]
|
|
44
|
+
)
|
|
45
|
+
delta = expiration_date - timezone.now()
|
|
46
|
+
assert delta.days > 30
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: swh.web
|
|
3
|
-
Version: 0.16.
|
|
3
|
+
Version: 0.16.4
|
|
4
4
|
Summary: Software Heritage web UI
|
|
5
5
|
Author-email: Software Heritage developers <swh-devel@inria.fr>
|
|
6
6
|
Project-URL: Homepage, https://gitlab.softwareheritage.org/swh/devel/swh-web
|
|
@@ -37,7 +37,7 @@ Requires-Dist: looseversion
|
|
|
37
37
|
Requires-Dist: msgpack
|
|
38
38
|
Requires-Dist: prometheus-client
|
|
39
39
|
Requires-Dist: psycopg
|
|
40
|
-
Requires-Dist:
|
|
40
|
+
Requires-Dist: pybadges2
|
|
41
41
|
Requires-Dist: pygments
|
|
42
42
|
Requires-Dist: pymemcache
|
|
43
43
|
Requires-Dist: python-magic>=0.4.0
|
|
@@ -45,7 +45,6 @@ Requires-Dist: pyyaml
|
|
|
45
45
|
Requires-Dist: requests
|
|
46
46
|
Requires-Dist: rfc3987
|
|
47
47
|
Requires-Dist: sentry-sdk
|
|
48
|
-
Requires-Dist: standard-imghdr; python_version > "3.12"
|
|
49
48
|
Requires-Dist: swh.auth[django]>=0.6.7
|
|
50
49
|
Requires-Dist: swh.core>=4.0.0
|
|
51
50
|
Requires-Dist: swh.counters>=0.5.1
|