From 21f7e44b1bb9be07d486699222552477956397af Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Oct 17 2018 13:41:44 +0000 Subject: [PATCH 1/2] Adjust a little bit the content of the about page on all themes Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/templates/about.html b/pagure/templates/about.html index b61fb1d..6cb2d51 100644 --- a/pagure/templates/about.html +++ b/pagure/templates/about.html @@ -1,6 +1,6 @@ {% extends "master.html" %} -{% block title %}About this Pagure Instance{% endblock %} +{% block title %}About{% endblock %} {% block content %} diff --git a/pagure/themes/chameleon/templates/theme.html b/pagure/themes/chameleon/templates/theme.html index 835a424..e229c1b 100644 --- a/pagure/themes/chameleon/templates/theme.html +++ b/pagure/themes/chameleon/templates/theme.html @@ -49,11 +49,40 @@ {% endmacro %} {% macro about_page() %} -
-

About

-

This is an instance of Pagure, a git forge.

-

If you experience a bug or security concern, please submit an issue.

-

You may contact an administrator by emailing: {{ config['ADMIN_EMAIL'] }}.

-

Subscribe to announcements about Pagure.

-
+
+

About

+

Welcome to this pagure instance.

+

+ For any issue, wish or security concern, feel free to + open a ticket (please + ensure the ticket is private if your concern is security-related). +

+

+ You may contact an administrator by emailing: + + {{ config['ADMIN_EMAIL'] }} + . +

+

Learn more or keep in touch about pagure via our mailing lists:

+ +

+ pagure is a free software licensed + under the + GNU General Public License (GPL) v2 + or any later versions. +

+

+ This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for details. +

+
{% endmacro %} diff --git a/pagure/themes/default/templates/theme.html b/pagure/themes/default/templates/theme.html index a4be810..de69e6e 100644 --- a/pagure/themes/default/templates/theme.html +++ b/pagure/themes/default/templates/theme.html @@ -42,18 +42,51 @@ href="{{ url_for('theme.static', filename='favicon.ico')}}?version={{ g.version} Pagure {{ g.version }}

-

SSH Hostkey/Fingerprint | Documentation | About this Instance

+

+ SSH Hostkey/Fingerprint + | Documentation + | About +

© 2014-2018 Red Hat, Inc. and others.

{% endmacro %} {% macro about_page() %} -
-

About

-

This is an instance of Pagure, a git forge.

-

If you experience a bug or security concern, please submit an issue.

-

You may contact an administrator by emailing: {{ config['ADMIN_EMAIL'] }}.

-

Subscribe to announcements about Pagure.

-
+
+

About

+

Welcome to this pagure instance.

+

+ For any issue, wish or security concern, feel free to + open a ticket (please + ensure the ticket is private if your concern is security-related). +

+

+ You may contact an administrator by emailing: + + {{ config['ADMIN_EMAIL'] }} + . +

+

Learn more or keep in touch about pagure via our mailing lists:

+ +

+ pagure is a free software licensed + under the + GNU General Public License (GPL) v2 + or any later versions. +

+

+ This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for details. +

+
{% endmacro %} diff --git a/pagure/themes/pagureio/templates/theme.html b/pagure/themes/pagureio/templates/theme.html index 725fc2a..d86c94d 100644 --- a/pagure/themes/pagureio/templates/theme.html +++ b/pagure/themes/pagureio/templates/theme.html @@ -53,7 +53,7 @@
DocumentationFile an Issue • - About this Instance • + AboutSSH Hostkey/Fingerprint
@@ -66,11 +66,40 @@ {% endmacro %} {% macro about_page() %} -
-

About

-

This is an instance of Pagure, a git forge.

-

If you experience a bug or security concern, please submit an issue.

-

You may contact an administrator by emailing: {{ config['ADMIN_EMAIL'] }}.

-

Subscribe to announcements about Pagure.

-
+
+

About

+

Welcome to this pagure instance.

+

+ For any issue, wish or security concern, feel free to + open a ticket (please + ensure the ticket is private if your concern is security-related). +

+

+ You may contact an administrator by emailing: + + {{ config['ADMIN_EMAIL'] }} + . +

+

Learn more or keep in touch about pagure via our mailing lists:

+ +

+ pagure is a free software licensed + under the + GNU General Public License (GPL) v2 + or any later versions. +

+

+ This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for details. +

+
{% endmacro %} diff --git a/pagure/themes/srcfpo/templates/theme.html b/pagure/themes/srcfpo/templates/theme.html index 4ac17c9..6ec4159 100644 --- a/pagure/themes/srcfpo/templates/theme.html +++ b/pagure/themes/srcfpo/templates/theme.html @@ -109,3 +109,45 @@

Subscribe to announcements about Pagure.

{% endmacro %} + +{% macro about_page() %} +
+

About

+

Welcome to this pagure instance.

+

+ For any issue, wish or security concern, feel free to open a ticket, + either with the + Fedora Infrastructure or on the + upstream issue tracker + (please ensure the ticket is private if your concern is security-related + on either tracker). +

+

+ You may contact an administrator by emailing: + + {{ config['ADMIN_EMAIL'] }} + . +

+

Learn more or keep in touch about pagure via our mailing lists:

+ +

+ pagure is a free software licensed + under the + GNU General Public License (GPL) v2 + or any later versions. +

+

+ This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for details. +

+
+{% endmacro %} From 7c623776c029b2b605cb3efcb24664d110b4c946 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Oct 17 2018 13:41:44 +0000 Subject: [PATCH 2/2] Add basic tests for the about page Signed-off-by: Pierre-Yves Chibon --- diff --git a/tests/test_pagure_flask_ui_app.py b/tests/test_pagure_flask_ui_app.py index 8315a20..9b3c1d5 100644 --- a/tests/test_pagure_flask_ui_app.py +++ b/tests/test_pagure_flask_ui_app.py @@ -1996,6 +1996,37 @@ class PagureFlaskApptests(tests.Modeltests): 'to use pagure', output_text) +class PagureFlaskAppAboutPagetests(tests.Modeltests): + """ Unit-tests for the about page. """ + + def test_about_page(self): + """ Test the about page when an admin_email is set. """ + output = self.app.get('/about/') + self.assertEqual(output.status_code, 200) + output_text = output.get_data(as_text=True) + self.assertIn('About - Pagure', output_text) + self.assertIn( + 'by emailing:\n ' + '', output_text) + self.assertIn( + 'href="https://pagure.io/pagure/issues">open a ticket', + output_text) + + @patch.dict('pagure.config.config', {'ADMIN_EMAIL': 'admin@fp.o'}) + def test_about_page_admin_email(self): + """ Test the about page when an admin_email is set. """ + output = self.app.get('/about/') + self.assertEqual(output.status_code, 200) + output_text = output.get_data(as_text=True) + self.assertIn('About - Pagure', output_text) + self.assertIn( + 'by emailing:\n ', + output_text) + self.assertIn( + 'href="https://pagure.io/pagure/issues">open a ticket', + output_text) + + class PagureFlaskAppNoDocstests(tests.Modeltests): """ Tests for flask app controller of pagure """