Skip to content

Commit

Permalink
Add 'plain' link from blobs to nav bar
Browse files Browse the repository at this point in the history
  • Loading branch information
w4 committed Sep 1, 2023
1 parent de44b40 commit 6746796
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 8 deletions.
5 changes: 5 additions & 0 deletions statics/sass/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ header {
nav {
margin-top: 2rem;
border-bottom: solid 3px #ccc;
display: flex;

.grow {
flex-grow: 1;
}

@media (prefers-color-scheme: dark) {
border-bottom-color: $darkModeHighlightColour;
Expand Down
10 changes: 9 additions & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@ <h1>

{%- block nav -%}
<nav>
<a href="/" class="active">index</a>
<div>
<a href="/" class="active">index</a>
</div>

<div class="grow"></div>

<div>
{%- block extra_nav_links %}{% endblock %}
</div>
</nav>
{%- endblock -%}

Expand Down
22 changes: 15 additions & 7 deletions templates/repo/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,20 @@

{% block nav %}
<nav>
<a href="/{{ repo.display() }}/about" class="{% block about_nav_class %}{% endblock %}">about</a>
<a href="/{{ repo.display() }}" class="{% block summary_nav_class %}{% endblock %}">summary</a>
<a href="/{{ repo.display() }}/refs" class="{% block refs_nav_class %}{% endblock %}">refs</a>
<a href="/{{ repo.display() }}/log" class="{% block log_nav_class %}{% endblock %}">log</a>
<a href="/{{ repo.display() }}/tree" class="{% block tree_nav_class %}{% endblock %}">tree</a>
<a href="/{{ repo.display() }}/commit" class="{% block commit_nav_class %}{% endblock %}">commit</a>
<a href="/{{ repo.display() }}/diff" class="{% block diff_nav_class %}{% endblock %}">diff</a>
<div>
<a href="/{{ repo.display() }}/about" class="{% block about_nav_class %}{% endblock %}">about</a>
<a href="/{{ repo.display() }}" class="{% block summary_nav_class %}{% endblock %}">summary</a>
<a href="/{{ repo.display() }}/refs" class="{% block refs_nav_class %}{% endblock %}">refs</a>
<a href="/{{ repo.display() }}/log" class="{% block log_nav_class %}{% endblock %}">log</a>
<a href="/{{ repo.display() }}/tree" class="{% block tree_nav_class %}{% endblock %}">tree</a>
<a href="/{{ repo.display() }}/commit" class="{% block commit_nav_class %}{% endblock %}">commit</a>
<a href="/{{ repo.display() }}/diff" class="{% block diff_nav_class %}{% endblock %}">diff</a>
</div>

<div class="grow"></div>

<div>
{%- block extra_nav_links %}{% endblock %}
</div>
</nav>
{% endblock %}
4 changes: 4 additions & 0 deletions templates/repo/file.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

{% block tree_nav_class %}active{% endblock %}

{% block extra_nav_links %}
<a href="?raw=true">plain</a>
{% endblock %}

{% block content %}
<pre>{{ file.content|safe }}</pre>
{% endblock %}

0 comments on commit 6746796

Please sign in to comment.