Skip to content

Commit 6528861

Browse files
authored
Keep settings button in the same place always (#598)
With the conditional view docs button on the right, the settings button is not always on the right-most button -- it jumps around. Make temporary view docs button the left most instead, it makes the disappearing button less obvious. Also fixes template issues that weren't addressed.
1 parent 684a490 commit 6528861

File tree

1 file changed

+15
-19
lines changed
  • readthedocsext/theme/templates/projects/partials

1 file changed

+15
-19
lines changed

readthedocsext/theme/templates/projects/partials/header.html

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
{% load i18n %}
2-
{% load core_tags %}
3-
{% load privacy_tags %}
4-
{% load core_tags %}
5-
{% load gravatar %}
6-
{% load ext_theme_tags %}
1+
{% load blocktrans trans from i18n %}
2+
{% load is_admin from privacy_tags %}
3+
{% load gravatar_url from gravatar %}
4+
{% load get_spam_score readthedocs_language_name readthedocs_language_name_local from ext_theme_tags %}
75

86
{% comment %}
97

@@ -44,9 +42,8 @@
4442
{% endblock project_header_labels %}
4543

4644
{% block project_header_metadata_left %}
47-
<div class="eight wide computer eight wide tablet sixteen wide mobile column"
48-
data-bind="visible: !is_collapsed()"
49-
style="display: none">
45+
<div class="eight wide computer eight wide tablet sixteen wide mobile column ko hidden"
46+
data-bind="css: { hidden: is_collapsed() }">
5047

5148
{% block project_header_description %}
5249
{% if project.description %}
@@ -109,9 +106,8 @@
109106
{% endblock project_header_metadata_left %}
110107

111108
{% block project_header_metadata_right %}
112-
<div class="right aligned eight wide computer eight wide tablet sixteen wide mobile column"
113-
data-bind="visible: !is_collapsed()"
114-
style="display: none">
109+
<div class="right aligned eight wide computer eight wide tablet sixteen wide mobile column ko hidden"
110+
data-bind="css: { hidden: is_collapsed() }">
115111

116112
{% block project_header_maintainers %}
117113
<div class="ui sub header">{% trans "Maintainers" %}</div>
@@ -174,6 +170,13 @@
174170
<span class="ui tiny teal circular label">{{ project.builds.count }}</span>
175171
</a>
176172
<div class="right menu">
173+
{# Show top-level view docs button on non-build pages with a good build #}
174+
{% if project.has_good_build and not build %}
175+
<a class="item" href="{{ project.get_docs_url }}">
176+
<i class="fa-duotone fa-book icon"></i>
177+
{% trans "View docs" %}
178+
</a>
179+
{% endif %}
177180
{% if request.user|is_admin:project %}
178181
{% if user.is_staff %}
179182
<a class="item" data-bind="click: $root.show_modal('project-debug')">
@@ -187,13 +190,6 @@
187190
{% trans "Settings" %}
188191
</a>
189192
{% endif %}
190-
{# Show top-level view docs button on non-build pages with a good build #}
191-
{% if project.has_good_build and not build %}
192-
<a class="item" href="{{ project.get_docs_url }}">
193-
<i class="fa-duotone fa-book icon"></i>
194-
{% trans "View docs" %}
195-
</a>
196-
{% endif %}
197193
</div>
198194
</div>
199195

0 commit comments

Comments
 (0)