Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Visit docs button to header #508

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions readthedocsext/theme/templates/projects/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
style="display: none">

{% block project_header_description %}
{% if project.description %}<p>{{ project.description|truncatewords:15 }}</p>{% endif %}
{% if project.description %}
<p>{{ project.description|truncatewords:15 }}</p>
{% endif %}
{% endblock project_header_description %}

{% block project_header_tags %}
Expand Down Expand Up @@ -171,8 +173,8 @@
{% trans "Builds" %}
<span class="ui tiny teal circular label">{{ project.builds.count }}</span>
</a>
{% if request.user|is_admin:project %}
<div class="right menu">
<div class="right menu">
{% if request.user|is_admin:project %}
{% if user.is_staff %}
<a class="item" data-bind="click: $root.show_modal('project-debug')">
<i class="fa-duotone fa-microscope icon"></i>
Expand All @@ -184,8 +186,15 @@
<i class="fa-duotone fa-gears icon"></i>
{% trans "Settings" %}
</a>
</div>
{% endif %}
{% endif %}
{# Show top-level view docs button on non-build pages with a good build #}
{% if project.has_good_build and not build %}
<a class="item" href="{{ project.get_docs_url }}">
<i class="fa-duotone fa-book icon"></i>
{% trans "View docs" %}
</a>
{% endif %}
</div>
</div>

<div class="ui mini modal" data-modal-id="project-debug">
Expand Down