help: Fix issues with new version indicator

This commit is contained in:
James Valleroy 2017-01-17 12:29:33 -05:00
parent 7fdb09abfd
commit c7b4bb7cc8
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
3 changed files with 10 additions and 5 deletions

View File

@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
- Added JS license web labels for LibreJS.
- Added basic configuration form for Minetest server.
- Added Domain Name Server (BIND) module.
- help: Added indicator for new plinth version available.
### Changed
- frontpage: Show app logos instead of generic icons.

View File

@ -20,11 +20,12 @@ Help module for Plinth.
"""
import os
from apt.cache import Cache
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__
@ -55,7 +56,7 @@ def about(request):
context = {
'title': _('About {box_name}').format(box_name=_(cfg.box_name)),
'version': __version__,
'new_version': plinth.candidate.is_installed
'new_version': not plinth.candidate.is_installed
}
return TemplateResponse(request, 'help_about.html', context)

View File

@ -75,10 +75,13 @@
<p style='margin-top:30px'>
{% blocktrans trimmed %}
You are running Plinth version {{ version }}.
{% if new_version %}
There is a new version available.
{% end if %}
{% endblocktrans %}
{% if new_version %}
{% blocktrans trimmed %}
There is a new version available.
{% endblocktrans %}
{% endif %}
</p>
{% endblock %}