🏡 index : ~doyle/rgit.git

author Jordan Doyle <jordan@doyle.la> 2023-09-01 3:16:08.0 +01:00:00
committer Jordan Doyle <jordan@doyle.la> 2023-09-01 3:16:08.0 +01:00:00
commit
674679645084133e5d2098e4b5e6cad7b69a9746 [patch]
tree
c7104f3e94178dd8ded21e7d07e10ad733440bda
parent
de44b40fa4fa7b3408f93c8e564ee36da8da158f
download
674679645084133e5d2098e4b5e6cad7b69a9746.tar.gz

Add 'plain' link from blobs to nav bar



Diff

 templates/base.html      | 10 ++++++++++
 statics/sass/style.scss  |  5 +++++
 templates/repo/base.html | 22 +++++++++++++++++++---
 templates/repo/file.html |  4 ++++
 4 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/templates/base.html b/templates/base.html
index 3f49e28..4c02da1 100644
--- a/templates/base.html
+++ a/templates/base.html
@@ -18,7 +18,15 @@

{%- 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 -%}

diff --git a/statics/sass/style.scss b/statics/sass/style.scss
index 75b5c61..58012fe 100644
--- a/statics/sass/style.scss
+++ a/statics/sass/style.scss
@@ -28,6 +28,11 @@
nav {
  margin-top: 2rem;
  border-bottom: solid 3px #ccc;
  display: flex;

  .grow {
    flex-grow: 1;
  }

  @media (prefers-color-scheme: dark) {
    border-bottom-color: $darkModeHighlightColour;
diff --git a/templates/repo/base.html b/templates/repo/base.html
index b4b58dc..30a7456 100644
--- a/templates/repo/base.html
+++ a/templates/repo/base.html
@@ -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 %}
diff --git a/templates/repo/file.html b/templates/repo/file.html
index b933f81..d2727ec 100644
--- a/templates/repo/file.html
+++ a/templates/repo/file.html
@@ -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 %}