2
0
mirror of https://github.com/inventree/inventree-docs.git synced 2025-04-27 21:26:43 +00:00

version banner fixes (#331)

* version banner fixes

* More context

* Banner tweaks

* Template fix

* HTML tweaks

* Banner simplificatio
This commit is contained in:
Oliver 2022-07-26 15:08:15 +10:00 committed by GitHub
parent cf5dbf03cf
commit c23165307b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 7 deletions

View File

@ -1,13 +1,14 @@
{% if config.extra.version %}
{% if config.version_banner %}
<div class='md-banner md-banner--warning'>
<div class='md-grid md-typeset'>
{% if config.extra.version == "latest" %}
This documentation is for the <em>development</em> version of InvenTree, which may be significantly different from previous stable releases.
For stable release documentation, use the version selector located in the bottom right corner of this page.
{% elif self.outdated() %}
This documentation is for an outdated version of InvenTree.
For updated release documentation, use the version selector located in the bottom right corner of this page.
<small>
{% if config.readthedocs.version == 'latest' %}
This documentation is for the <em>development</em> version of InvenTree, which may be significantly different from the stable releases.
{% else %}
This documentation is for an outdated version of InvenTree.
{% endif %}
For <em>stable</em> release documentation, use the version selector located in the bottom right corner of this page.
</small>
</div>
</div>
{% endif %}

View File

@ -49,6 +49,10 @@ def on_config(config, *args, **kwargs):
# Supply this to the context
config['readthedocs'] = readthedocs
# Determine if we want to display a 'version' banner
# Basically we do, *unless* we are displaying the "stable" version
config['version_banner'] = rtd_version != 'stable'
else:
print("'READTHEDOCS' environment variable not found")
print("Building for localhost configuration!")