From 7fdb09abfd2bfe21bc311e14261cfba13626bf96 Mon Sep 17 00:00:00 2001 From: pk13055 Date: Sun, 8 Jan 2017 03:23:03 +0530 Subject: [PATCH] help: Add indicator for new plinth version available --- plinth/modules/help/help.py | 7 +++++-- plinth/modules/help/templates/help_about.html | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plinth/modules/help/help.py b/plinth/modules/help/help.py index 9a8fda53e..d73140a92 100644 --- a/plinth/modules/help/help.py +++ b/plinth/modules/help/help.py @@ -24,7 +24,7 @@ from django.http import Http404 from django.template.response import TemplateResponse from django.utils.translation import ugettext as _, ugettext_lazy from stronghold.decorators import public - +from apt.cache import Cache from plinth import cfg, __version__ @@ -50,9 +50,12 @@ def index(request): @public def about(request): """Serve the about page""" + cache = Cache() + plinth = cache['plinth'] context = { 'title': _('About {box_name}').format(box_name=_(cfg.box_name)), - 'version': __version__ + 'version': __version__, + 'new_version': plinth.candidate.is_installed } return TemplateResponse(request, 'help_about.html', context) diff --git a/plinth/modules/help/templates/help_about.html b/plinth/modules/help/templates/help_about.html index 1c7beafbd..cbc31427e 100644 --- a/plinth/modules/help/templates/help_about.html +++ b/plinth/modules/help/templates/help_about.html @@ -75,6 +75,9 @@

{% blocktrans trimmed %} You are running Plinth version {{ version }}. + {% if new_version %} + There is a new version available. + {% end if %} {% endblocktrans %}