diff --git a/assets/src/bundles/admin/origin-save.js b/assets/src/bundles/admin/origin-save.js --- a/assets/src/bundles/admin/origin-save.js +++ b/assets/src/bundles/admin/origin-save.js @@ -178,14 +178,6 @@ enableRowSelection('#swh-origin-save-accepted-requests'); swh.webapp.addJumpToPagePopoverToDataTable(acceptedSaveRequestsTable); - $('#swh-origin-save-requests-nav-item').on('shown.bs.tab', () => { - pendingSaveRequestsTable.draw(); - }); - - $('#swh-origin-save-url-filters-nav-item').on('shown.bs.tab', () => { - authorizedOriginTable.draw(); - }); - $('#swh-authorized-origins-tab').on('shown.bs.tab', () => { authorizedOriginTable.draw(); }); diff --git a/swh/web/admin/origin_save.py b/swh/web/admin/origin_save.py --- a/swh/web/admin/origin_save.py +++ b/swh/web/admin/origin_save.py @@ -26,10 +26,16 @@ ) -@admin_route(r"origin/save/", view_name="admin-origin-save") +@admin_route(r"origin/save/requests/", view_name="admin-origin-save-requests") @staff_member_required(view_func=None, login_url=settings.LOGIN_URL) -def _admin_origin_save(request): - return render(request, "admin/origin-save.html") +def _admin_origin_save_requests(request): + return render(request, "admin/origin-save/requests.html") + + +@admin_route(r"origin/save/filters/", view_name="admin-origin-save-filters") +@staff_member_required(view_func=None, login_url=settings.LOGIN_URL) +def _admin_origin_save_filters(request): + return render(request, "admin/origin-save/filters.html") def _datatables_origin_urls_response(request, urls_query_set): diff --git a/swh/web/admin/urls.py b/swh/web/admin/urls.py --- a/swh/web/admin/urls.py +++ b/swh/web/admin/urls.py @@ -18,7 +18,7 @@ def _admin_default_view(request): - return redirect("admin-origin-save") + return redirect("admin-origin-save-requests") urlpatterns = [ diff --git a/swh/web/templates/admin/origin-save/common.html b/swh/web/templates/admin/origin-save/common.html new file mode 100644 --- /dev/null +++ b/swh/web/templates/admin/origin-save/common.html @@ -0,0 +1,41 @@ +{% extends "layout.html" %} + +{% comment %} +Copyright (C) 2018-2021 The Software Heritage developers +See the AUTHORS file at the top-level directory of this distribution +License: GNU Affero General Public License version 3, or any later version +See top-level LICENSE file for more information +{% endcomment %} + +{% load swh_templatetags %} +{% load render_bundle from webpack_loader %} + +{% block header %} +{{ block.super }} +{% render_bundle 'admin' %} +{% render_bundle 'save' %} +{% endblock %} + +{% block title %} Save origin administration {% endblock %} + +{% block navbar-content %} +

Save origin administration

+{% endblock %} + +{% block content %} + + + +
+ {% block tab_content %} + {% endblock %} +
+ + +{% endblock %} diff --git a/swh/web/templates/admin/origin-save/filters.html b/swh/web/templates/admin/origin-save/filters.html new file mode 100644 --- /dev/null +++ b/swh/web/templates/admin/origin-save/filters.html @@ -0,0 +1,76 @@ +{% extends "./common.html" %} + +{% comment %} +Copyright (C) 2018-2022 The Software Heritage developers +See the AUTHORS file at the top-level directory of this distribution +License: GNU Affero General Public License version 3, or any later version +See top-level LICENSE file for more information +{% endcomment %} + + +{% block tab_content %} +
+ + +
+
+ + + + + + +
Url
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+ +
+ + + + + + +
Url
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
+
+
+{% endblock %} diff --git a/swh/web/templates/admin/origin-save.html b/swh/web/templates/admin/origin-save/requests.html rename from swh/web/templates/admin/origin-save.html rename to swh/web/templates/admin/origin-save/requests.html --- a/swh/web/templates/admin/origin-save.html +++ b/swh/web/templates/admin/origin-save/requests.html @@ -1,36 +1,14 @@ -{% extends "layout.html" %} +{% extends "./common.html" %} {% comment %} -Copyright (C) 2018-2021 The Software Heritage developers +Copyright (C) 2018-2022 The Software Heritage developers See the AUTHORS file at the top-level directory of this distribution License: GNU Affero General Public License version 3, or any later version See top-level LICENSE file for more information {% endcomment %} -{% load swh_templatetags %} -{% load render_bundle from webpack_loader %} - -{% block header %} -{{ block.super }} -{% render_bundle 'admin' %} -{% render_bundle 'save' %} -{% endblock %} - -{% block title %} Save origin administration {% endblock %} - -{% block navbar-content %} -

Save origin administration

-{% endblock %} - -{% block content %} - - - -
+{% block tab_content %}
- -
- - -
-
- - - - - - -
Url
-
-
-
- -
- -
-
-
-
- -
-
-
-
-
- -
- - - - - - -
Url
-
-
-
- -
- -
-
-
-
- -
-
-
-
-
-
-
- - - {% endblock %} diff --git a/swh/web/templates/layout.html b/swh/web/templates/layout.html --- a/swh/web/templates/layout.html +++ b/swh/web/templates/layout.html @@ -227,7 +227,7 @@ {% if user.is_staff %}