diff --git a/assets/src/bundles/add_forge/create-request.js b/assets/src/bundles/add_forge/create-request.js
--- a/assets/src/bundles/add_forge/create-request.js
+++ b/assets/src/bundles/add_forge/create-request.js
@@ -5,7 +5,7 @@
* See top-level LICENSE file for more information
*/
-import {handleFetchError, removeUrlFragment, csrfPost,
+import {handleFetchError, csrfPost,
getHumanReadableDate} from 'utils/functions';
let requestBrowseTable;
@@ -55,22 +55,6 @@
}
});
- $(window).on('hashchange', () => {
- if (window.location.hash === '#browse-requests') {
- $('.nav-tabs a[href="#swh-add-forge-requests-list"]').tab('show');
- } else {
- $('.nav-tabs a[href="#swh-add-forge-submit-request"]').tab('show');
- }
- });
-
- $('#swh-add-forge-requests-list-tab').on('shown.bs.tab', () => {
- window.location.hash = '#browse-requests';
- });
-
- $('#swh-add-forge-tab').on('shown.bs.tab', () => {
- removeUrlFragment();
- });
-
populateRequestBrowseList(); // Load existing requests
});
}
diff --git a/cypress/integration/add-forge-now-request-create.spec.js b/cypress/integration/add-forge-now-request-create.spec.js
--- a/cypress/integration/add-forge-now-request-create.spec.js
+++ b/cypress/integration/add-forge-now-request-create.spec.js
@@ -16,7 +16,7 @@
describe('Test add-forge-request creation', function() {
beforeEach(function() {
- this.addForgeNowUrl = this.Urls.forge_add();
+ this.addForgeNowUrl = this.Urls.forge_add_create();
});
it('should show both tabs for every user', function() {
@@ -52,7 +52,7 @@
cy.get('#loginLink')
.should('have.attr', 'href')
- .and('include', `${this.Urls.login()}?next=${this.Urls.forge_add()}`);
+ .and('include', `${this.Urls.login()}?next=${this.Urls.forge_add_create()}`);
});
it('should change tabs on click', function() {
@@ -105,7 +105,7 @@
.should('be.visible');
cy.get('#loginLink')
- .should('not.be.visible');
+ .should('not.exist');
});
it('should update browse list on successful submission', function() {
diff --git a/swh/web/add_forge_now/views.py b/swh/web/add_forge_now/views.py
--- a/swh/web/add_forge_now/views.py
+++ b/swh/web/add_forge_now/views.py
@@ -87,21 +87,41 @@
]
-def create_request(request):
+def create_request_create(request):
"""View to create a new 'add_forge_now' request.
"""
return render(
- request, "add_forge_now/create-request.html", {"forge_types": FORGE_TYPES},
+ request,
+ "add_forge_now/create-request-create.html",
+ {"forge_types": FORGE_TYPES},
)
+def create_request_list(request):
+ """View to list existing 'add_forge_now' requests.
+
+ """
+
+ return render(request, "add_forge_now/create-request-list.html",)
+
+
+def create_request_help(request):
+ """View to explain 'add_forge_now'.
+
+ """
+
+ return render(request, "add_forge_now/create-request-help.html",)
+
+
urlpatterns = [
url(
r"^add-forge/request/list/datatables/$",
add_forge_request_list_datatables,
name="add-forge-request-list-datatables",
),
- url(r"^add-forge/request/create/$", create_request, name="forge-add"),
+ url(r"^add-forge/request/create/$", create_request_create, name="forge-add-create"),
+ url(r"^add-forge/request/list/$", create_request_list, name="forge-add-list"),
+ url(r"^add-forge/request/help/$", create_request_help, name="forge-add-help"),
]
diff --git a/swh/web/templates/add_forge_now/create-request-create.html b/swh/web/templates/add_forge_now/create-request-create.html
new file mode 100644
--- /dev/null
+++ b/swh/web/templates/add_forge_now/create-request-create.html
@@ -0,0 +1,110 @@
+{% extends "./create-request.html" %}
+
+{% comment %}
+Copyright (C) 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 %}
+
+ {% if not user.is_authenticated %}
+
+
+ You must be logged in to submit an add forge request. Please
+ log in
+
+
+ {% else %}
+
+
+
+ Once a add request has been submitted, you can follow its current status in
+ the
+ submitted requests list. This process is depending on human interactions
+ and might take a few days to be handled (it primarily depends on the response
+ time of the forge).
+
+ {% endif %}
+
+{% endblock %}
diff --git a/swh/web/templates/add_forge_now/create-request-help.html b/swh/web/templates/add_forge_now/create-request-help.html
new file mode 100644
--- /dev/null
+++ b/swh/web/templates/add_forge_now/create-request-help.html
@@ -0,0 +1,96 @@
+{% extends "./create-request.html" %}
+
+{% comment %}
+Copyright (C) 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 %}
+
+
Prior to submit an "Add forge now" request, we ask
+ you to fill in the following parameters:
+
+ - Forge type: the type of supported forge the software archive is able to list.
+ Currently, the supported types are:
+
+ cgit
, for cgit forges
+ gitea
, for gitea forges
+ gitlab
, for gitlab forges
+ heptapod
, for heptapod forges
+ ...
+
+
+ - Forge url: the url of the selected forge. This must be unique.
+
+ - Forge contact name: Contact name of the forge administrator we
+ intend to ingest.
+
+ - Forge contact email: Contact email of the forge administrator so an
+ email can be send to the forge. The intent is to notify the forge prior to
+ actually start the ingestion.
+
+ - Consent checkbox: This checkbox's purpose is to know whether we can
+ explicitly mention the user's login within the email sent to the forge. If
+ not checked, the user's name won't be mentioned in the email at all.
+
+ - Comment: (Optionally) For the user to mention something more about
+ their request to the add-forge-now moderator.
+
+
+
Once submitted, your "add forge" request can either be:
+
+
+ -
+ Pending:
+ the request was submitted and is waiting for a moderator
+ to check its validity.
+
+
+ -
+ Waiting for feedback:
+ the request was processed by a moderator
+ and the forge was contacted, the request is waiting for feedback from the
+ forge.
+
+
+ -
+ Feedback to handle:
+ the forge has responded to the request and
+ there is feedback to handle for the request.
+
+ -
+ Accepted:
+ the request has been accepted and waiting to be
+ scheduled.
+
+
+ -
+ Scheduled:
+ the request has been scheduled is considered
+ done.
+
+
+ -
+ First listing done:
+ The first listing of the forge is
+ completed.
+
+
+ -
+ First origin loaded:
+ The first origin or repository processed by
+ loader and archived (using a search query).
+
+
+ - Rejected: the request is not a valid request and is rejected by a
+ Software Heritage moderator.
+
+ - Denied: the forge has requested not to archive the forge.
+
+ - Suspended: the request is for a forge with a non supported
+ VCS.
+
+
+{% endblock %}
diff --git a/swh/web/templates/add_forge_now/create-request-list.html b/swh/web/templates/add_forge_now/create-request-list.html
new file mode 100644
--- /dev/null
+++ b/swh/web/templates/add_forge_now/create-request-list.html
@@ -0,0 +1,24 @@
+{% extends "./create-request.html" %}
+
+{% comment %}
+Copyright (C) 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 %}
+
+
+
+
+ Submission date |
+ Forge type |
+ Forge URL |
+ Status |
+
+
+
+
+
+{% endblock %}
diff --git a/swh/web/templates/add_forge_now/create-request.html b/swh/web/templates/add_forge_now/create-request.html
--- a/swh/web/templates/add_forge_now/create-request.html
+++ b/swh/web/templates/add_forge_now/create-request.html
@@ -43,209 +43,14 @@
-
- {% if not user.is_authenticated %}
-
-
- You must be logged in to submit an add forge request. Please
- log in
-
-
- {% else %}
-
-
-
- Once a add request has been submitted, you can follow its current status in
- the
- submitted requests list. This process is depending on human interactions
- and might take a few days to be handled (it primarily depends on the response
- time of the forge).
-
- {% endif %}
-
-
-
-
-
- Submission date |
- Forge type |
- Forge URL |
- Status |
-
-
-
-
-
-
-
Prior to submit an "Add forge now" request, we ask
- you to fill in the following parameters:
-
- - Forge type: the type of supported forge the software archive is able to list.
- Currently, the supported types are:
-
- cgit
, for cgit forges
- gitea
, for gitea forges
- gitlab
, for gitlab forges
- heptapod
, for heptapod forges
- ...
-
-
- - Forge url: the url of the selected forge. This must be unique.
-
- - Forge contact name: Contact name of the forge administrator we
- intend to ingest.
-
- - Forge contact email: Contact email of the forge administrator so an
- email can be send to the forge. The intent is to notify the forge prior to
- actually start the ingestion.
-
- - Consent checkbox: This checkbox's purpose is to know whether we can
- explicitly mention the user's login within the email sent to the forge. If
- not checked, the user's name won't be mentioned in the email at all.
-
- - Comment: (Optionally) For the user to mention something more about
- their request to the add-forge-now moderator.
-
-
-
Once submitted, your "add forge" request can either be:
-
-
- -
- Pending:
- the request was submitted and is waiting for a moderator
- to check its validity.
-
-
- -
- Waiting for feedback:
- the request was processed by a moderator
- and the forge was contacted, the request is waiting for feedback from the
- forge.
-
-
- -
- Feedback to handle:
- the forge has responded to the request and
- there is feedback to handle for the request.
-
- -
- Accepted:
- the request has been accepted and waiting to be
- scheduled.
-
-
- -
- Scheduled:
- the request has been scheduled is considered
- done.
-
-
- -
- First listing done:
- The first listing of the forge is
- completed.
-
-
- -
- First origin loaded:
- The first origin or repository processed by
- loader and archived (using a search query).
-
-
- - Rejected: the request is not a valid request and is rejected by a
- Software Heritage moderator.
-
- - Denied: the forge has requested not to archive the forge.
-
- - Suspended: the request is for a forge with a non supported
- VCS.
-
-
+ {% block tab_content %}
+ {% 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
@@ -211,7 +211,7 @@
{% if FEATURES.add_forge_now %}
-
+
Add forge now