Skip to content

Commit

Permalink
Enable a new banner on top of the testing documentation (qgis#4315)
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ authored Oct 22, 2019
2 parents 7878846 + bfc5545 commit 92378a3
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 3 deletions.
5 changes: 4 additions & 1 deletion source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@
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
'outdated': False,
# When a new QGIS version is released, set this to False to remove the disclaimer
# information message on the top of the page.
'isTesting': True
}

# Add any paths that contain custom themes here, relative to this directory.
Expand Down
8 changes: 8 additions & 0 deletions themes/qgis-theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,17 @@
</div>
{%- endmacro %}

{%- macro isTesting_block() %}
<div class="row isTesting">
This documentation is a work in progress. For the Long Term Release and translations, please visit the <a href="https://docs.qgis.org/latest/{{ language }}/">latest version</a>.
</div>
{%- endmacro %}

{%- macro relbar() %}
{%- if outdated %}
{%- set navigation_classes = "related related-outdated" %}
{%- elif isTesting %}
{%- set navigation_classes = "related related-isTesting" %}
{%- else %}
{%- set navigation_classes = "related" %}
{%- endif %}
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 isTesting %}
{{ isTesting_block() }}
{%- endif %}
{%- if outdated %}
{{ outdated_block() }}
{%- endif %}
Expand Down
13 changes: 12 additions & 1 deletion themes/qgis-theme/static/qgis-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -897,14 +897,25 @@ section.menu nav.subnav ul li a:hover {
padding-right: 3px;
}
.outdated {
/* only to be visible for outdated releases*/
background: #ffbaba;
color: #6a0e0e;
}
.isTesting {
/* only to be visible in testing*/
background: #f3fbfb;
color: black;
}
.outdated,
.isTesting {
/* top banner for testing and outdated docs*/
padding-top: 0.5rem;
margin-left: 0;
padding-left: 0.5rem;
padding-bottom: 0.5rem;
font-size: 0.9rem;
}
.related-outdated {
.related-outdated,
.related-isTesting {
margin-top: 2.5rem;
}
11 changes: 10 additions & 1 deletion themes/qgis-theme/static/qgis-style.less
Original file line number Diff line number Diff line change
Expand Up @@ -900,14 +900,23 @@ section.menu nav.subnav ul li a:hover {
padding-right: 3px;
}
.outdated {
/* only to be visible for outdated releases*/
background: #ffbaba;
color: #6a0e0e;
}
.isTesting {
/* only to be visible in testing*/
background: #f3fbfb;
color: black;
}
.outdated, .isTesting {
/* top banner for testing and outdated docs*/
padding-top: 0.5rem;
margin-left: 0;
padding-left: 0.5rem;
padding-bottom: 0.5rem;
font-size: 0.9rem;
}
.related-outdated {
.related-outdated, .related-isTesting{
margin-top: 2.5rem;
}

0 comments on commit 92378a3

Please sign in to comment.