Self hosted FLOSS fitness/workout, nutrition and weight tracker
Simplify info templates
Roland Geidera51b2f899651
diff --git a/wger/core/templates/misc/about.html b/wger/core/templates/misc/about.htmlindex b3dc102bf..daa814210 100644--- a/wger/core/templates/misc/about.html+++ b/wger/core/templates/misc/about.html@@ -1,18 +1,7 @@{% extends "base.html" %}{% load i18n static %}-{% block title %}{% translate "About us" %}{% endblock %}+{% block title %}{% translate "Imprint" %}{% endblock %}{% block content %}-<!---<p>{% translate "Responsible for the content of this site as per German law §5 TMG:" %}</p>--->-<p>-Your name<br>-Address<br>-ZIP code<br>-City<br>-<a href="mailto:[email protected]">[email protected]</a>-({%trans "GNUPG-Key:" %} <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x1234567890">1234567890</a>)-</p>{% endblock %}diff --git a/wger/core/templates/misc/contact.html b/wger/core/templates/misc/contact.htmldeleted file mode 100644index f14790ee6..000000000--- a/wger/core/templates/misc/contact.html+++ /dev/null@@ -1,61 +0,0 @@-{% extends "base_wide.html" %}-{% load i18n wger_extras %}--{% block title%}{% translate "Get in touch" %}{% endblock %}---{% block content %}-<div class="row">- <div class="col-sm-6">-<p>{% blocktranslate %}Thank you for your interest. Feel free to use any of the-ways below to send feedback you have about any aspect of the site. For-support, say hi-<a href="{{discord}}">on the discord channel</a>, to report-a bug, consider doing it through the <a href="{{issues}}">issue tracker</a>-.{% endblocktranslate %}</p>- </div>-- <div class="col-sm-6">- <div class="alert alert-block alert-wger-green">- {% blocktranslate %}If you want to further help and improve this project,-you might also be interested <a href="{{contribute}}">in contributing</a>.{% endblocktranslate %}- </div>- </div>--</div>--<div class="row">- <div class="col-md-4">- <h4>{% translate "Feedback form" %}</h4>- <p>{% blocktranslate %}A simple contact form. Remember that-if you want an answer, you need to include some way to contact you.{% endblocktranslate %}</p>- </div>-- <div class="col-md-4">- <h4>{% translate "Twitter" %}</h4>- <p>{% blocktranslate %}We are also on twitter. Write us and tell us what-you think! Except patches, don't send patches via twitter.{% endblocktranslate %}</p>- </div>--- <div class="col-md-4">- <h4>{% translate "Discord" %}</h4>- <p>{% blocktranslate %}Use the public group to get support for your-local wger installation, discuss issues or your new idea, etc.-(no registration needed){% endblocktranslate %}</p>- </div>-- <div class="col-md-4">- <a class="btn btn-light btn-block" href="{{feedback}}">{% translate "Open feedback form" %}</a>- </div>- <div class="col-md-4">- <a href="https://twitter.com/wger_project"- class="btn btn-light btn-block twitter-mention-button">{% translate "tweet to @wger_project" %}</a>- </div>- <div class="col-md-4">- <a href="{{discord}}" class="btn btn-light btn-block">{% translate "Go to the discord server" %}</a>- </div>-</div>--{% endblock %}-diff --git a/wger/core/templates/navigation.html b/wger/core/templates/navigation.htmlindex 3ec4ca6af..fe65c7997 100644--- a/wger/core/templates/navigation.html+++ b/wger/core/templates/navigation.html@@ -148,12 +148,15 @@class="dropdown-toggle nav-link"data-toggle="dropdown">{% translate "About this software" %} <b class="caret"></b></a><ul class="dropdown-menu">- <li><a class="dropdown-item" href="{% url 'software:contribute' %}">{% translate "Contribute!" %} </a></li>- <li><a class="dropdown-item" href="{% url 'software:issues' %}">{% translate "Problems and wishes" %} </a></li>- <li><a class="dropdown-item" href="{% url 'core:contact' %}">{% translate "Get in touch" %}</a></li>+ <li><a class="dropdown-item" href="{% url 'software:about-us' %}">{% translate "About us" %}</a></li><li class="dropdown-divider"></li><li><a class="dropdown-item" href="{% url 'software:api' %}">{% translate "REST API" %} </a></li>- <li><a class="dropdown-item" href="{% url 'software:license' %}">{% translate "License" %} </a></li>+ <li>+ <a class="dropdown-item" href="https://github.com/wger-project/wger/blob/master/LICENSE.txt">+ <span class="{% fa_class 'external-link-alt' %}"></span>+ {% translate "License" %}+ </a>+ </li><li><a class="dropdown-item" href="https://wger.readthedocs.io/"><span class="{% fa_class 'external-link-alt' %}"></span>diff --git a/wger/core/templates/template.html b/wger/core/templates/template.htmlindex 61109f510..177677e38 100644--- a/wger/core/templates/template.html+++ b/wger/core/templates/template.html@@ -198,7 +198,7 @@{% endif %}<ul class="list-unstyled mb-0 pt-2">- <li><a href="{% url 'core:about' %}" class="text-muted small">{% translate "About" %}</a></li>+ <li><a href="{% url 'core:imprint' %}" class="text-muted small">{% translate "Imprint" %}</a></li><li><a href="{% url 'software:tos' %}" class="text-muted small">{% translate "Terms of service" %}</a></li></ul><!--diff --git a/wger/core/templates/template_features.html b/wger/core/templates/template_features.htmlindex aa4167023..98b7e0e9a 100644--- a/wger/core/templates/template_features.html+++ b/wger/core/templates/template_features.html@@ -80,10 +80,7 @@<div class="col-md-4"><ul class="list-inline quicklinks"><li class="list-inline-item">- <a href="{% url 'software:contribute' %}" class="text-muted small">{% translate "Contribute!" %}</a>- </li>- <li class="list-inline-item">- <a href="{% url 'core:contact' %}" class="text-muted small">{% translate "Get in touch" %}</a>+ <a href="{% url 'software:about-us' %}" class="text-muted small">{% translate "About us" %}</a></li></ul></div>@@ -118,7 +115,7 @@<div class="col-md-4 text-lg-right"><ul class="list-inline quicklinks"><li class="list-inline-item">- <a href="{% url 'core:about' %}" class="text-muted small">{% translate "About" %}</a>+ <a href="{% url 'core:imprint' %}" class="text-muted small">{% translate "Imprint" %}</a></li><li class="list-inline-item">diff --git a/wger/core/templates/template_no_context.html b/wger/core/templates/template_no_context.htmlindex 22cb6603c..0875499e8 100644--- a/wger/core/templates/template_no_context.html+++ b/wger/core/templates/template_no_context.html@@ -85,7 +85,7 @@<div class="row"><div class="col-md-8"><ul class="list-unstyled mb-0 pt-2">- <li><a href="{% url 'core:about' %}" class="text-muted small">{% translate "About" %}</a></li>+ <li><a href="{% url 'core:imprint' %}" class="text-muted small">{% translate "Imprint" %}</a></li><li><a href="{% url 'software:tos' %}" class="text-muted small">{% translate "Terms of service" %}</a></li></ul></div>diff --git a/wger/core/tests/test_temporary_users.py b/wger/core/tests/test_temporary_users.pyindex 2df4870f3..0d32170dd 100644--- a/wger/core/tests/test_temporary_users.py+++ b/wger/core/tests/test_temporary_users.py@@ -132,10 +132,7 @@ class DemoUserTestCase(WgerTestCase):self.assertEqual(self.count_temp_users(), 1)# These pages should not create a user- self.client.get(reverse('core:contact'))- self.assertEqual(self.count_temp_users(), 1)-- self.client.get(reverse('software:code'))+ self.client.get(reverse('software:about-us'))self.assertEqual(self.count_temp_users(), 1)self.client.get(reverse('exercise:exercise:overview'))@@ -178,8 +175,7 @@ class DemoUserTestCase(WgerTestCase):)self.assertContains(self.client.get(reverse('exercise:muscle:overview')), demo_notice_text)self.assertContains(self.client.get(reverse('nutrition:plan:overview')), demo_notice_text)- self.assertContains(self.client.get(reverse('software:issues')), demo_notice_text)- self.assertContains(self.client.get(reverse('software:license')), demo_notice_text)+ self.assertContains(self.client.get(reverse('software:about-us')), demo_notice_text)def test_command_delete_old_users(self):"""diff --git a/wger/core/urls.py b/wger/core/urls.pyindex 6255aa452..45d53a784 100644--- a/wger/core/urls.py+++ b/wger/core/urls.py@@ -251,14 +251,9 @@ urlpatterns = [# Otherspath(- 'about',+ 'imprint',TemplateView.as_view(template_name="misc/about.html"),- name='about',- ),- path(- 'contact',- misc.ContactClassView.as_view(template_name="misc/contact.html"),- name='contact',+ name='imprint',),path('feedback',diff --git a/wger/core/views/misc.py b/wger/core/views/misc.pyindex 95ce13ed9..e0f3b53d0 100644--- a/wger/core/views/misc.py+++ b/wger/core/views/misc.py@@ -163,25 +163,9 @@ def dashboard(request):return render(request, 'index.html', context)--class ContactClassView(TemplateView):-- def get_context_data(self, **kwargs):- context = super(ContactClassView, self).get_context_data(**kwargs)- context.update(- {- 'discord': 'https://discord.gg/rPWFv6W',- 'contribute': reverse('software:contribute'),- 'issues': reverse('software:issues'),- 'feedback': reverse('core:feedback')- }- )- return context--class FeedbackClass(FormView):template_name = 'form.html'- success_url = reverse_lazy('core:contact')+ success_url = reverse_lazy('software:about-us')def get_initial(self):"""diff --git a/wger/software/templates/about_us.html b/wger/software/templates/about_us.htmlnew file mode 100644index 000000000..62ea3a296--- /dev/null+++ b/wger/software/templates/about_us.html@@ -0,0 +1,60 @@+{% extends "base.html" %}+{% load static i18n wger_extras %}+++{% block title %}{% translate "About us" %}{% endblock %}++{% block content %}+<p>+ {% blocktranslate trimmed %}+ Thank you for using wger! wger is a collaborative open source project, made+ by fitness enthusiasts from around the world.+ {% endblocktranslate %}+</p>+++<h5>+ <span class="{% fa_class 'code' %}"></span>+ {% translate 'Source code' %}+</h5>+<p>{% translate 'Get the source code of this application and its server on github' %}</p>+<a class="btn btn-outline-primary mb-5" href="https://github.com/wger-project">https://github.com/wger-project</a>++<h5>+ <span class="{% fa_class 'bug' %}"></span>+ {% translate 'Have a problem or idea?' %}+</h5>+<p>{% translate "Get in touch if something didn't behave as expected or if there is a feature that you feel is missing." %}</p>+<a class="btn btn-outline-primary mb-5" href="https://github.com/wger-project/wger/issues/new/choose">https://github.com/wger-project/wger/issues/new/choose</a>++<h5>+ <span class="{% fa_class 'comments' %}"></span>+ {% translate 'Say hi!' %}+</h5>+<p>{% translate 'If you want to chat with us, hop on the Discord server and get in touch' %}</p>+<a class="btn btn-outline-primary mb-5" href="https://discord.gg/rPWFv6W">https://discord.gg/rPWFv6W</a>++<h5>+ <span class="{% fa_class 'language' %}"></span>+ {% translate 'Translation' %}+</h5>+<p>{% translate 'This application is translated on weblate. If you also want to help, click the link and start translating' %}</p>+<a class="btn btn-outline-primary mb-5" href="https://hosted.weblate.org/engage/wger/">https://hosted.weblate.org/engage/wger/</a>++{% endblock %}+++{% block sidebar %}+<div class="card text-white bg-wger-green mb-3">+ <div class="card-header">+ {% translate "Our goal" %}+ </div>+ <div class="card-body">+ {% blocktranslate %}The goal is to build an awesome+and flexible fitness manager, along with a comprehensive and complete list of exercises and+ingredients, all released under a free license.{% endblocktranslate %}+ </div>+</div>+{% endblock %}++diff --git a/wger/software/templates/contribute.html b/wger/software/templates/contribute.htmldeleted file mode 100644index b870f3c44..000000000--- a/wger/software/templates/contribute.html+++ /dev/null@@ -1,76 +0,0 @@-{% extends "base.html" %}-{% load static %}-{% load i18n %}---{% block title %}{% translate "Contribute!" %}{% endblock %}--{% block content %}- <p>{% blocktranslate %}wger Workout Manager is build by volunteers,-the development process is open and freely accessible to anybody interested.-If you are new to the free software world, we recommend to take a-look <a href="http://schlitt.info/opensource/blog/0541_10_golden_rules_for_starting_with_open_source.html">this-article</a> which summarizes they way open source projects work very well. {% endblocktranslate %}</p>--- <p>{% blocktranslate %}Any kind of contribution is appreciated and welcome.-Use this opportunity and influence the direction of the-project. {% endblocktranslate %}</p>-----<h5>{% translate "Use the site" %}</h5>-<p>{% blocktranslate %}Simply use the site and tell your friends-how useful it is! ;) . When you find something that you specially liked,-could need some improvements or just doesn't work, tell us! This might not sound-like much, but is incredibly important!{% endblocktranslate %}</p>-<a class="btn btn-light mb-4" href="{% url 'core:contact' %}">{% translate "Get in touch" %} »</a>---<h5>{% translate "Submit exercises" %}</h5>-<p>{% blocktranslate %}Submit those cool exercises that you absolutely-love and do every week but are not in the list yet. If you think some description-is too short or some other detail is missing or could be improved, tell!{% endblocktranslate %}</p>-- {% if user.is_authenticated and not user.userprofile.is_temporary %}- <a class="btn btn-light mb-4" href="{% url 'exercise:exercise:add' %}">{% translate "Add exercise" %} »</a>- {% else %}- <a class="btn disabled btn-secondary mb-4" href="#">{% translate "Only registered users can do this" %} »</a>- {% endif %}---<h5>{% translate "Translate" %}</h5>-<p>{% blocktranslate %}Do you want to use wger in your own language?-Do you think the current translation could be improved?-The translations are easily managed and edited online, if you are interested,-visit the link and start translating.{% endblocktranslate %}</p>-- <a class="btn btn-light mb-4"- href="https://hosted.weblate.org/engage/wger/">{% translate "Translate" %} »</a>---<h5>{% translate "Code" %}</h5>-<p>{% blocktranslate %}Obviously, you are highly encouraged to clone the-repo and start hacking! Once you are ready, send a pull request and we-will show the world. Take a look at the developer guide for more details-on this.{% endblocktranslate %}</p>--<a class="btn btn-light" href="{% url 'software:code' %}">{% translate "Get the code" %} »</a>-{% endblock %}---{% block sidebar %}-<div class="card text-white bg-wger-green mb-3">- <div class="card-header">- {% translate "Our goal" %}- </div>- <div class="card-body">- {% blocktranslate %}The goal is to build an awesome-and flexible fitness manager, along with a comprehensive and complete list of exercises and-ingredients, all released under a free license.{% endblocktranslate %}- </div>-</div>-{% endblock %}--diff --git a/wger/software/templates/issues.html b/wger/software/templates/issues.htmldeleted file mode 100644index ab2f5b3b8..000000000--- a/wger/software/templates/issues.html+++ /dev/null@@ -1,45 +0,0 @@-{% extends "base.html" %}-{% load static %}-{% load i18n %}---{% block title %}{% translate "Reporting a problem" %}{% endblock %}--{% block content %}--<p>{% blocktranslate %}-No software is perfect. For some severe errors, an email will be automatically sent, but-not always, so I depend on you reporting everything that didn't behave as expected.-Please describe in as much detail as you can what you were doing when the error-happened.-{% endblocktranslate %}</p>----<p>-<a class="btn btn-primary"- href="https://github.com/wger-project/wger/issues">{% translate "report problem to the issue tracker" %} »</a>-</p>---<h3>{% translate "Enhancements" %}</h3>--<p>{% blocktranslate %}-The issue tracker can also be used to document enhancements to the software.-If you have some suggestions or think a feature is missing, feel-free to open a ticket. This can be anything from a slight change to a whole-new section of the site. Please keep in mind that not all wishes can be-implemented.{% endblocktranslate %}</p>--<p>-<a class="btn btn-primary"- href="https://github.com/wger-project/wger/issues">{% translate "report wish to the issue tracker" %} »</a>-</p>-{% endblock %}--{% block sidebar %}-<h4>{% translate "No Github account?" %}</h4>-<p>{% blocktranslate %}Filing an issue requires a github account, if you don't-have one and don't want to register, you can also send it to-<a href="https://groups.google.com/group/wger">the mailing list</a>.{% endblocktranslate %}</p>-{% endblock %}diff --git a/wger/software/templates/license.html b/wger/software/templates/license.htmldeleted file mode 100644index 0519488b9..000000000--- a/wger/software/templates/license.html+++ /dev/null@@ -1,33 +0,0 @@-{% extends "base.html" %}-{% load i18n %}-{% load static %}-{% load wger_extras %}---{% block title %}{% translate "License" %}{% endblock %}--{% block content %}-<p>{% blocktranslate %}wger Workout Manager is Free/Libre Open Source-Software (FLOSS).{% endblocktranslate %}</p>--<div class="row">- <div class="col-md-2 text-center">- <img src="{% static 'images/agpl-v3.svg' %}"- width="88"- height="31"- alt="{% translate 'Released under the Affero GPL' %}"- title="{% translate 'Released under the Affero GPL' %}">- </div>- <div class="col-md-10">- <p>{% blocktranslate %}wger Workout Manager is released under the <strong>Affero GNU-General Public License (AGPL) Version 3+</strong> and can (under the conditions-of the license) be used, modified and distributed (also with modifications)-without restrictions.{% endblocktranslate %}</p>- </div>-</div>--<p>{% blocktranslate %}A copy the license text is contained in every wger Workout-Manager release (LICENSE.txt) and can be read online on the website of-<a href='https://www.gnu.org/licenses/agpl-3.0.en.html'>the GNU project</a>.{% endblocktranslate %}</p>--{% endblock %}diff --git a/wger/software/urls.py b/wger/software/urls.pyindex a50d51849..5bec21973 100644--- a/wger/software/urls.py+++ b/wger/software/urls.py@@ -26,11 +26,6 @@ from wger.software import viewsurlpatterns = [- path(- 'issues',- TemplateView.as_view(template_name="issues.html"),- name='issues',- ),path('terms-of-service',TemplateView.as_view(template_name="tos.html"),@@ -41,20 +36,15 @@ urlpatterns = [views.features,name='features',),- path(- 'license',- TemplateView.as_view(template_name="license.html"),- name='license',- ),path('code',RedirectView.as_view(permanent=True, url='https://github.com/wger-project/wger'),name='code',),path(- 'contribute',- TemplateView.as_view(template_name="contribute.html"),- name='contribute',+ 'about-us',+ TemplateView.as_view(template_name="about_us.html"),+ name='about-us',),path('api',diff --git a/wger/utils/tests/test_middleware.py b/wger/utils/tests/test_middleware.pyindex 9750abec4..cf58cbc79 100644--- a/wger/utils/tests/test_middleware.py+++ b/wger/utils/tests/test_middleware.py@@ -41,10 +41,7 @@ class RobotsExclusionMiddlewareTestCase(WgerTestCase):response = self.client.get(reverse('core:feedback'))self.assertFalse(response.get('X-Robots-Tag'))- response = self.client.get(reverse('core:about'))- self.assertFalse(response.get('X-Robots-Tag'))-- response = self.client.get(reverse('core:contact'))+ response = self.client.get(reverse('core:imprint'))self.assertFalse(response.get('X-Robots-Tag'))def test_middleware_software(self):@@ -52,8 +49,8 @@ class RobotsExclusionMiddlewareTestCase(WgerTestCase):Test the middleware on URLs from software app"""- for i in ('features', 'issues', 'license', 'code', 'contribute'):- response = self.client.get(reverse('software:{0}'.format(i)))+ for i in ('features', 'tos', 'about-us'):+ response = self.client.get(reverse(f'software:{i}'))self.assertFalse(response.get('X-Robots-Tag'))def test_middleware_nutrition(self):