diff --git a/templates/dashboard.html b/templates/dashboard.html index 48f42dc6..e88fde4a 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -62,6 +62,9 @@ {% endwith %} {% endif %} +
+ {% include 'partials/support.html' %} +
diff --git a/templates/home.html b/templates/home.html index 3a7bc76d..e8296239 100644 --- a/templates/home.html +++ b/templates/home.html @@ -24,71 +24,7 @@

{% trans %}Learn more...{% endtrans %}

-

{% trans %}Support{% endtrans %}

-

{% trans %}Package Requests{% endtrans %}

-
-

- {{ "There are three types of requests that can be filed in the %sPackage Actions%s box on the package details page:" - | tr - | format("", "") - | safe - }} -

- -

- {{ "If you want to discuss a request, you can use the %saur-requests%s mailing list. However, please do not use that list to file requests." - | tr - | format('', "") - | safe - }} -

-
-

{% trans %}Submitting Packages{% endtrans %}

-
-

- {{ "Git over SSH is now used to submit packages to the AUR. See the %sSubmitting packages%s section of the Arch User Repository ArchWiki page for more details." - | tr - | format('', "") - | safe - }} -

- {% if ssh_fingerprints %} -

- {% trans %}The following SSH fingerprints are used for the AUR:{% endtrans %} -

-

- {% endif %} -
-

{% trans %}Discussion{% endtrans %}

-
-

- {{ "General discussion regarding the Arch User Repository (AUR) and Trusted User structure takes place on %saur-general%s. For discussion relating to the development of the AUR web interface, use the %saur-dev%s mailing list." - | tr - | format('', "", - '', "") - | safe - }} -

-

-

{% trans %}Bug Reporting{% endtrans %}

-
-

- {{ "If you find a bug in the AUR web interface, please fill out a bug report on our %sbug tracker%s. Use the tracker to report bugs in the AUR web interface %sonly%s. To report packaging bugs contact the package maintainer or leave a comment on the appropriate package page." - | tr - | format('', "", - "", "") - | safe - }} -

-
+ {% include 'partials/support.html' %}
diff --git a/templates/partials/support.html b/templates/partials/support.html new file mode 100644 index 00000000..a2890cc5 --- /dev/null +++ b/templates/partials/support.html @@ -0,0 +1,65 @@ +

{% trans %}Support{% endtrans %}

+

{% trans %}Package Requests{% endtrans %}

+
+

+ {{ "There are three types of requests that can be filed in the %sPackage Actions%s box on the package details page:" + | tr + | format("", "") + | safe + }} +

+ +

+{{ "If you want to discuss a request, you can use the %saur-requests%s mailing list. However, please do not use that list to file requests." + | tr + | format('', "") + | safe + }} +

+
+

{% trans %}Submitting Packages{% endtrans %}

+
+

+ {{ "Git over SSH is now used to submit packages to the AUR. See the %sSubmitting packages%s section of the Arch User Repository ArchWiki page for more details." + | tr + | format('', "") + | safe + }} +

+{% if ssh_fingerprints %} +

+ {% trans %}The following SSH fingerprints are used for the AUR:{% endtrans %} +

+

+{% endif %} +
+

{% trans %}Discussion{% endtrans %}

+
+

+ {{ "General discussion regarding the Arch User Repository (AUR) and Trusted User structure takes place on %saur-general%s. For discussion relating to the development of the AUR web interface, use the %saur-dev%s mailing list." + | tr + | format('', "", + '', "") + | safe + }} +

+

+

{% trans %}Bug Reporting{% endtrans %}

+
+

+ {{ "If you find a bug in the AUR web interface, please fill out a bug report on our %sbug tracker%s. Use the tracker to report bugs in the AUR web interface %sonly%s. To report packaging bugs contact the package maintainer or leave a comment on the appropriate package page." + | tr + | format('', "", + "", "") + | safe + }} +

+
diff --git a/test/test_homepage.py b/test/test_homepage.py index a573bdd6..08c52c09 100644 --- a/test/test_homepage.py +++ b/test/test_homepage.py @@ -125,33 +125,47 @@ def test_homepage(): @patch("aurweb.util.get_ssh_fingerprints") -def test_homepage_ssh_fingerprints(get_ssh_fingerprints_mock): +def test_homepage_ssh_fingerprints(get_ssh_fingerprints_mock, user): fingerprints = {"Ed25519": "SHA256:RFzBCUItH9LZS0cKB5UE6ceAYhBD5C8GeOBip8Z11+4"} get_ssh_fingerprints_mock.return_value = fingerprints + # without authentication (Home) with client as request: response = request.get("/") - for key, value in fingerprints.items(): - assert key in response.content.decode() - assert value in response.content.decode() - assert ( - "The following SSH fingerprints are used for the AUR" - in response.content.decode() - ) + # with authentication (Dashboard) + with client as auth_request: + auth_request.cookies = {"AURSID": user.login(Request(), "testPassword")} + auth_response = auth_request.get("/") + + for resp in [response, auth_response]: + for key, value in fingerprints.items(): + assert key in resp.content.decode() + assert value in resp.content.decode() + assert ( + "The following SSH fingerprints are used for the AUR" + in resp.content.decode() + ) @patch("aurweb.util.get_ssh_fingerprints") -def test_homepage_no_ssh_fingerprints(get_ssh_fingerprints_mock): +def test_homepage_no_ssh_fingerprints(get_ssh_fingerprints_mock, user): get_ssh_fingerprints_mock.return_value = {} + # without authentication (Home) with client as request: response = request.get("/") - assert ( - "The following SSH fingerprints are used for the AUR" - not in response.content.decode() - ) + # with authentication (Dashboard) + with client as auth_request: + auth_request.cookies = {"AURSID": user.login(Request(), "testPassword")} + auth_response = auth_request.get("/") + + for resp in [response, auth_response]: + assert ( + "The following SSH fingerprints are used for the AUR" + not in resp.content.decode() + ) def test_homepage_stats(redis, packages):