From b1a63b21519c7277cea876959e5d1d3af3d82e94 Mon Sep 17 00:00:00 2001 From: Sebastian Blauth Date: Mon, 18 Sep 2023 08:12:38 +0200 Subject: [PATCH 1/5] Add version warning banners --- docs/source/_static/version_switcher.json | 3 ++- docs/source/conf.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/_static/version_switcher.json b/docs/source/_static/version_switcher.json index 61d1e66d..b78c9d30 100755 --- a/docs/source/_static/version_switcher.json +++ b/docs/source/_static/version_switcher.json @@ -7,7 +7,8 @@ { "name": "2.0 (stable)", "version": "2.0.11", - "url": "https://cashocs.readthedocs.io/en/v2.0.11/" + "url": "https://cashocs.readthedocs.io/en/v2.0.11/", + "preferred": true, }, { "name": "1.8", diff --git a/docs/source/conf.py b/docs/source/conf.py index e5067c91..26f3a948 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -136,6 +136,7 @@ ], "logo": {"text": "cashocs", "alt_text": "cashocs"}, "navbar_align": "content", + "show_version_warning_banner": True, } html_sidebars = {"**": ["search-field.html", "sidebar-nav-bs", "sidebar-ethical-ads"]} From e562c6f5635be1abdfc14401c751a3d9f6b6b5d4 Mon Sep 17 00:00:00 2001 From: Sebastian Blauth Date: Mon, 18 Sep 2023 08:20:59 +0200 Subject: [PATCH 2/5] Style everything but stable and dev versions in red for the dropdown --- docs/source/_static/cashocs.css | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/source/_static/cashocs.css b/docs/source/_static/cashocs.css index 69f3d3b8..71822145 100755 --- a/docs/source/_static/cashocs.css +++ b/docs/source/_static/cashocs.css @@ -25,6 +25,26 @@ h3 { } +/* Background of others should be red */ +.version-switcher__container { + position: relative; +} + +.version-switcher__container span { + color: var(--pst-color-danger); +} + +.version-switcher__container span:before { + content: ""; + width: 100%; + height: 100%; + position: absolute; + left: 0; + top: 0; + background-color: var(--pst-color-danger); + opacity: 0.1; +} + /* Background of stable should be green */ .version-switcher__container a[data-version-name*="stable"] { position: relative; @@ -66,6 +86,8 @@ h3 { } + + /* Main page overview cards */ .sd-card { From 95b3919d319c7c12a8612a527b6ab5598a00eef5 Mon Sep 17 00:00:00 2001 From: Sebastian Blauth Date: Mon, 18 Sep 2023 08:23:06 +0200 Subject: [PATCH 3/5] Color the version button (the active one) according to the choice of the version --- docs/source/_static/cashocs.css | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/source/_static/cashocs.css b/docs/source/_static/cashocs.css index 71822145..35a5c8b9 100755 --- a/docs/source/_static/cashocs.css +++ b/docs/source/_static/cashocs.css @@ -86,6 +86,18 @@ h3 { } +.version-switcher__button { + background-color: var(--pst-color-danger); +} + +.version-switcher__button[data-active-version-name*="dev"] { + background-color: #E69F00; +} + +.version-switcher__button[data-active-version-name*="stable"] { + background-color: var(--pst-color-success); +} + /* Main page overview cards */ From 3ae48d104b99ba27297c6cf12b852f0b017a27fa Mon Sep 17 00:00:00 2001 From: Sebastian Blauth Date: Mon, 18 Sep 2023 08:38:31 +0200 Subject: [PATCH 4/5] Try to fix the css selectors --- docs/source/_static/cashocs.css | 41 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/docs/source/_static/cashocs.css b/docs/source/_static/cashocs.css index 35a5c8b9..353abed6 100755 --- a/docs/source/_static/cashocs.css +++ b/docs/source/_static/cashocs.css @@ -25,69 +25,66 @@ h3 { } -/* Background of others should be red */ -.version-switcher__container { +/* Background of stable should be green */ +.version-switcher__container a[data-version-name*="stable"] { position: relative; } -.version-switcher__container span { - color: var(--pst-color-danger); +.version-switcher__container a[data-version-name*="stable"] span { + color: var(--pst-color-success); } -.version-switcher__container span:before { +.version-switcher__container a[data-version-name*="stable"] span:before { content: ""; width: 100%; height: 100%; position: absolute; left: 0; top: 0; - background-color: var(--pst-color-danger); + background-color: var(--pst-color-success); opacity: 0.1; } -/* Background of stable should be green */ -.version-switcher__container a[data-version-name*="stable"] { +/* Background of dev should be orange */ +.version-switcher__container a[data-version-name*="dev"] { position: relative; } -.version-switcher__container a[data-version-name*="stable"] span { - color: var(--pst-color-success); +.version-switcher__container a[data-version-name*="dev"] span { + color: #E69F00; } -.version-switcher__container a[data-version-name*="stable"] span:before { +.version-switcher__container a[data-version-name*="dev"] span:before { content: ""; width: 100%; height: 100%; position: absolute; left: 0; top: 0; - background-color: var(--pst-color-success); + background-color: #E69F00; opacity: 0.1; } -/* Background of dev should be orange */ -.version-switcher__container a[data-version-name*="dev"] { +/* Background of others should be red */ +.version-switcher__container a:not([data-version-name*="dev"], [data-version-name*="stable"]) { position: relative; } -.version-switcher__container a[data-version-name*="dev"] span { - color: #E69F00; +.version-switcher__container a:not([data-version-name*="dev"], [data-version-name*="stable"]) span { + color: var(--pst-color-danger); } -.version-switcher__container a[data-version-name*="dev"] span:before { +.version-switcher__container a:not([data-version-name*="dev"], [data-version-name*="stable"]) span:before { content: ""; width: 100%; height: 100%; position: absolute; left: 0; top: 0; - background-color: #E69F00; + background-color: var(--pst-color-danger); opacity: 0.1; } - -.version-switcher__button { - background-color: var(--pst-color-danger); } .version-switcher__button[data-active-version-name*="dev"] { @@ -98,6 +95,8 @@ h3 { background-color: var(--pst-color-success); } +.version-switcher__button:not([data-activate-version-name*="dev"], [data-active-version-name*="stable"]) { + background-color: var(--pst-color-danger); /* Main page overview cards */ From 77037b8785fceff1e15719d681107cbb3f8a2782 Mon Sep 17 00:00:00 2001 From: Sebastian Blauth Date: Mon, 18 Sep 2023 08:41:54 +0200 Subject: [PATCH 5/5] Try to fix the issues --- docs/source/_static/cashocs.css | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/docs/source/_static/cashocs.css b/docs/source/_static/cashocs.css index 353abed6..f9f84010 100755 --- a/docs/source/_static/cashocs.css +++ b/docs/source/_static/cashocs.css @@ -87,17 +87,6 @@ h3 { } -.version-switcher__button[data-active-version-name*="dev"] { - background-color: #E69F00; -} - -.version-switcher__button[data-active-version-name*="stable"] { - background-color: var(--pst-color-success); -} - -.version-switcher__button:not([data-activate-version-name*="dev"], [data-active-version-name*="stable"]) { - background-color: var(--pst-color-danger); - /* Main page overview cards */