From 2e44bc352b40371d76d3ac2c58fff7a383da5a17 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Tue, 15 Oct 2024 07:19:58 -0700 Subject: [PATCH 1/4] Add Visit docs button to header This gives a basic way to get to the docs like the old dashboard. I think this is important and is a middle ground until we can work on a fancier verison. --- .../templates/projects/partials/header.html | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/readthedocsext/theme/templates/projects/partials/header.html b/readthedocsext/theme/templates/projects/partials/header.html index 21242af3..0db566db 100644 --- a/readthedocsext/theme/templates/projects/partials/header.html +++ b/readthedocsext/theme/templates/projects/partials/header.html @@ -49,7 +49,9 @@ style="display: none"> {% block project_header_description %} - {% if project.description %}

{{ project.description|truncatewords:15 }}

{% endif %} + {% if project.description %} +

{{ project.description|truncatewords:15 }}

+ {% endif %} {% endblock project_header_description %} {% block project_header_tags %} @@ -171,8 +173,8 @@ {% trans "Builds" %} {{ project.builds.count }} - {% if request.user|is_admin:project %} - From fe75fa6dfe2991b8f0d26e43dd7f951d31cc1c1f Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Tue, 15 Oct 2024 10:43:18 -0700 Subject: [PATCH 3/4] Use same language --- readthedocsext/theme/templates/projects/partials/header.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readthedocsext/theme/templates/projects/partials/header.html b/readthedocsext/theme/templates/projects/partials/header.html index 311b969c..e996f976 100644 --- a/readthedocsext/theme/templates/projects/partials/header.html +++ b/readthedocsext/theme/templates/projects/partials/header.html @@ -191,7 +191,7 @@ {% if not build %} - {% trans "Visit docs" %} + {% trans "View docs" %} {% endif %} From 2e08a897bdc623b67cc7bea0e36edd0a2f281ce1 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Tue, 15 Oct 2024 10:54:50 -0700 Subject: [PATCH 4/4] Don't show if the project hasn't had a good build. --- readthedocsext/theme/templates/projects/partials/header.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readthedocsext/theme/templates/projects/partials/header.html b/readthedocsext/theme/templates/projects/partials/header.html index e996f976..61cd7608 100644 --- a/readthedocsext/theme/templates/projects/partials/header.html +++ b/readthedocsext/theme/templates/projects/partials/header.html @@ -187,8 +187,8 @@ {% trans "Settings" %} {% endif %} - {# Show top-level view docs button on non-build pages #} - {% if not build %} + {# Show top-level view docs button on non-build pages with a good build #} + {% if project.has_good_build and not build %} {% trans "View docs" %}