help: Link to updates page when new version is available

Closes: #1332.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Simplify the message for link to upgrade page]
[sunil: Use url method instead of hard-coded path]
[sunil: Cosmetic changes]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Fioddor Superconcentrado authored and Sunil Mohan Adapa committed 2020-10-19 16:57:34 -07:00
1 parent a7829d3bf7
commit 792c2cd00f
3 files changed
+15 -13

No files matched your search

@@ -65,8 +65,10 @@
{% endblocktrans %}
{% if new_version %}
{% url 'upgrades:index' as upgrades_url %}
{% blocktrans trimmed %}
There is a new {{ box_name }} version available.
There is a new {{ box_name }} version
<a href="{{ upgrades_url }}">available</a>.
{% endblocktrans %}
{% else %}
{% blocktrans trimmed %}
+3 -5
View File
@@ -7,7 +7,6 @@ import mimetypes
import os
import pathlib
from apt.cache import Cache
from django.core.files.base import File
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.template.response import TemplateResponse
@@ -16,7 +15,8 @@ from django.utils.translation import get_language_from_request
from django.utils.translation import ugettext as _
from plinth import __version__, actions, cfg
from plinth.modules.upgrades.views import get_os_release
from plinth.modules.upgrades.views import (get_os_release,
is_newer_version_available)
def index(request):
@@ -45,12 +45,10 @@ def support(request):
def about(request):
"""Serve the about page"""
cache = Cache()
freedombox = cache['freedombox']
context = {
'title': _('About {box_name}').format(box_name=_(cfg.box_name)),
'version': __version__,
'new_version': not freedombox.candidate.is_installed,
'new_version': is_newer_version_available(),
'os_release': get_os_release()
}
return TemplateResponse(request, 'help_about.html', context)