Skip to content

Commit

Permalink
Show "end of life" notice in header bar
Browse files Browse the repository at this point in the history
References qgis#3452
  • Loading branch information
m-kuhn committed Oct 14, 2019
1 parent 43df851 commit 84ede0d
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 1 deletion.
6 changes: 6 additions & 0 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@
html_theme_options = {
}

html_context = {
# When a QGIS version reaches end of life, set this to True to show an information
# message on the top of the page.
'outdated': False
}

# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []

Expand Down
13 changes: 12 additions & 1 deletion themes/qgis-theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,19 @@
{%- set titlesuffix = "" %}
{%- endif %}

{%- macro outdated_block() %}
<div class="row outdated">
This documentation is for a QGIS version which has reached end of life. Visit the <a href="https://docs.qgis.org/latest/">latest version</a> instead.
</div>
{%- endmacro %}

{%- macro relbar() %}
<div class="related">
{%- if outdated %}
{%- set navigation_classes = "related related-outdated" %}
{%- else %}
{%- set navigation_classes = "related" %}
{%- endif %}
<div class="{{ navigation_classes }}">
{# QGIS hide this # navigation h3 #}
{#<h3>{{ _('Navigation') }}</h3>#}
<ul>
Expand Down
3 changes: 3 additions & 0 deletions themes/qgis-theme/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@
</div>
</div>
</div>
{%- if outdated %}
{{ outdated_block() }}
{%- endif %}
</div>
{% endmacro %}

Expand Down
12 changes: 12 additions & 0 deletions themes/qgis-theme/static/qgis-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -902,3 +902,15 @@ section.menu nav.subnav ul li a:hover {
padding-left: 3px;
padding-right: 3px;
}
.outdated {
background: #ffbaba;
color: #6a0e0e;
padding-top: 0.5rem;
margin-left: 0;
padding-left: 0.5rem;
padding-bottom: 0.5rem;
font-size: 0.9rem;
}
.related-outdated {
margin-top: 2.5rem;
}
12 changes: 12 additions & 0 deletions themes/qgis-theme/static/qgis-style.less
Original file line number Diff line number Diff line change
Expand Up @@ -903,3 +903,15 @@ section.menu nav.subnav ul li a:hover {
padding-left: 3px;
padding-right: 3px;
}
.outdated {
background: #ffbaba;
color: #6a0e0e;
padding-top: 0.5rem;
margin-left: 0;
padding-left: 0.5rem;
padding-bottom: 0.5rem;
font-size: 0.9rem;
}
.related-outdated {
margin-top: 2.5rem;
}

0 comments on commit 84ede0d

Please sign in to comment.