2
0
mirror of https://github.com/inventree/inventree-docs.git synced 2025-04-28 05:36:46 +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-banner md-banner--warning'>
<div class='md-grid md-typeset'> <div class='md-grid md-typeset'>
{% if config.extra.version == "latest" %} <small>
This documentation is for the <em>development</em> version of InvenTree, which may be significantly different from previous stable releases. {% if config.readthedocs.version == 'latest' %}
For stable release documentation, use the version selector located in the bottom right corner of this page. This documentation is for the <em>development</em> version of InvenTree, which may be significantly different from the stable releases.
{% elif self.outdated() %} {% else %}
This documentation is for an outdated version of InvenTree. 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.
{% endif %} {% endif %}
For <em>stable</em> release documentation, use the version selector located in the bottom right corner of this page.
</small>
</div> </div>
</div> </div>
{% endif %} {% endif %}

View File

@ -49,6 +49,10 @@ def on_config(config, *args, **kwargs):
# Supply this to the context # Supply this to the context
config['readthedocs'] = readthedocs 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: else:
print("'READTHEDOCS' environment variable not found") print("'READTHEDOCS' environment variable not found")
print("Building for localhost configuration!") print("Building for localhost configuration!")