mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
help: Add Debian release to about page.
This commit is contained in:
parent
cc5e49433a
commit
5ee8e9397d
@ -57,7 +57,8 @@ def about(request):
|
|||||||
context = {
|
context = {
|
||||||
'title': _('About {box_name}').format(box_name=_(cfg.box_name)),
|
'title': _('About {box_name}').format(box_name=_(cfg.box_name)),
|
||||||
'version': __version__,
|
'version': __version__,
|
||||||
'new_version': not plinth.candidate.is_installed
|
'new_version': not plinth.candidate.is_installed,
|
||||||
|
'os_release': get_os_release()
|
||||||
}
|
}
|
||||||
return TemplateResponse(request, 'help_about.html', context)
|
return TemplateResponse(request, 'help_about.html', context)
|
||||||
|
|
||||||
@ -90,3 +91,15 @@ def status_log(request):
|
|||||||
'data': data
|
'data': data
|
||||||
}
|
}
|
||||||
return TemplateResponse(request, 'statuslog.html', context)
|
return TemplateResponse(request, 'statuslog.html', context)
|
||||||
|
|
||||||
|
|
||||||
|
def get_os_release():
|
||||||
|
"""Returns the Debian release number and name"""
|
||||||
|
output = 'Error: Cannot read PRETTY_NAME in /etc/os-release.'
|
||||||
|
with open('/etc/os-release', 'r') as release_file:
|
||||||
|
for line in release_file:
|
||||||
|
if 'PRETTY_NAME=' in line:
|
||||||
|
line = line.replace('"', '').strip()
|
||||||
|
line = line.split('=')
|
||||||
|
output = line[1]
|
||||||
|
return output
|
||||||
|
|||||||
@ -74,12 +74,16 @@
|
|||||||
|
|
||||||
<p style='margin-top:30px'>
|
<p style='margin-top:30px'>
|
||||||
{% blocktrans trimmed %}
|
{% blocktrans trimmed %}
|
||||||
You are running Plinth version {{ version }}.
|
You are running {{ os_release }} and Plinth version {{ version }}.
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
|
|
||||||
{% if new_version %}
|
{% if new_version %}
|
||||||
{% blocktrans trimmed %}
|
{% blocktrans trimmed %}
|
||||||
There is a new version available.
|
There is a new Plinth version available.
|
||||||
|
{% endblocktrans %}
|
||||||
|
{% else %}
|
||||||
|
{% blocktrans trimmed %}
|
||||||
|
Plinth is up to date.
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user