From 662257ff3ecef739375524649265a3938a81faf8 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 21 Sep 2018 17:16:16 -0400 Subject: [PATCH] Polish up some loose ends --- gitsrht/app.py | 4 +++- gitsrht/templates/repo.html | 12 +++++++----- gitsrht/templates/settings.html | 14 +++++++------- gitsrht/templates/summary.html | 12 ++++++++++-- gitsrht/templates/tree.html | 4 +--- 5 files changed, 28 insertions(+), 18 deletions(-) diff --git a/gitsrht/app.py b/gitsrht/app.py index a0704cb..34c5207 100644 --- a/gitsrht/app.py +++ b/gitsrht/app.py @@ -1,3 +1,4 @@ +import stat from flask import session from srht.flask import SrhtFlask from srht.config import cfg @@ -40,8 +41,9 @@ class GitApp(SrhtFlask): if notice: del session["notice"] return { - "trim_commit": trim_commit, "commit_time": commit_time, + "trim_commit": trim_commit, + "stat": stat, "notice": notice } diff --git a/gitsrht/templates/repo.html b/gitsrht/templates/repo.html index 1f3c855..3539105 100644 --- a/gitsrht/templates/repo.html +++ b/gitsrht/templates/repo.html @@ -16,14 +16,14 @@ {% endmacro %} {% endblock %} diff --git a/gitsrht/templates/settings.html b/gitsrht/templates/settings.html index 1a6085a..b76a48b 100644 --- a/gitsrht/templates/settings.html +++ b/gitsrht/templates/settings.html @@ -1,21 +1,21 @@ {% extends "layout.html" %} {% block body %} -
+
-
+

{{ owner.canonical_name }}/{{ repo.name }}

+
-
{% block content %}{% endblock %}
diff --git a/gitsrht/templates/summary.html b/gitsrht/templates/summary.html index 30b095f..38a8df7 100644 --- a/gitsrht/templates/summary.html +++ b/gitsrht/templates/summary.html @@ -1,5 +1,12 @@ {% extends "repo.html" %} {% block content %} +{% if repo.description %} +
+
+ {{ repo.description }} +
+
+{% endif %}
@@ -26,15 +33,16 @@ {% if default_branch %}
{{default_branch.name[len("refs/heads/"):]}}
- log {{icon("caret-right")}} browse {{icon("caret-right")}} + log {{icon("caret-right")}}
{% endif %} {% if latest_tag %}
{{ latest_tag[0][len("refs/tags/"):] }}
- log {{icon("caret-right")}} + browse {{icon("caret-right")}} .tar.gz {{icon("caret-right")}} + announcement {{icon("caret-right")}}
{% endif %} diff --git a/gitsrht/templates/tree.html b/gitsrht/templates/tree.html index db11622..3e79a26 100644 --- a/gitsrht/templates/tree.html +++ b/gitsrht/templates/tree.html @@ -20,10 +20,8 @@
{% for entry in tree %} - {# TODO: Decode the mode #}
- {#{{"{0:o}".format(entry.filemode)}}#} - -rw-r--r-- + {{stat.filemode(entry.filemode)}}