Diff between 1fd24f86fabd7017ef8d2bf87f3554b2222abcd6 and a5c268774e166e88bf98fd2506e14c0a5ffd2da6

Changed Files

File Additions Deletions Status
app.py +2 -1 modified
static/styles.css +4 -2 modified
templates/base.html +6 -5 modified
templates/index.html +8 -2 modified
templates/repo.html +27 -1 modified

Full Patch

diff --git a/app.py b/app.py
index 9e2696a..6aad97f 100644
--- a/app.py
+++ b/app.py
@@ -46,8 +46,9 @@ def index():
 
 @app.route("/<repo_name>")
 def repo_detail(repo_name):
+    commits = get_commits(f"{repo_path}/{repo_name}", ref="HEAD", max_count=10)
     refs = get_refs(f"{repo_path}/{repo_name}")
-    return render_template("repo.html", repo_name=repo_name, refs=refs)
+    return render_template("repo.html", repo_name=repo_name, refs=refs, commits=commits)
 
 @app.route("/<repo_name>/commits")
 def repo_commits(repo_name):
diff --git a/static/styles.css b/static/styles.css
index c5ef3a2..64d48cc 100644
--- a/static/styles.css
+++ b/static/styles.css
@@ -8,7 +8,7 @@ table {
 
 th, td {
     border: 1px solid black;
-    padding: 8px;
+    padding: 2px;
     text-align: left;
 }
 
@@ -18,6 +18,8 @@ a {
 .base-nav {
     display:flex; 
     align-items:center; 
-    gap: 1em; 
     margin-bottom:1em;
+    gap: 0.2em;
+    border-bottom: 1px solid black;
+    padding-bottom: 0.4em;
 }
\ No newline at end of file
diff --git a/templates/base.html b/templates/base.html
index 7f0e21c..e2d2a9f 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -3,17 +3,18 @@
 <head>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>Py GitWeb</title>
+    <title>Lipasto</title>
     <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
 </head>
 <body>
     <nav class="base-nav">
-        <a href="/">Home</a>
+        <a href="/">Back</a>·
         {% set repo_name = request.view_args.get('repo_name') %}
         {% if repo_name %}
-        <a href="{{ url_for('repo_commits', repo_name=repo_name) }}?ref={{ current_ref }}">Commits</a>
-        <a href="{{ url_for('repo_refs', repo_name=repo_name) }}">Refs</a>
-        <a href="{{ url_for('repo_tree_path', repo_name=repo_name) }}?ref={{ current_ref }}">Tree</a>
+        <a href="{{ url_for('repo_detail', repo_name=repo_name) }}?ref={{ current_ref }}">Overview</a>·
+        <a href="{{ url_for('repo_commits', repo_name=repo_name) }}?ref={{ current_ref }}">Commits</a>·
+        <a href="{{ url_for('repo_refs', repo_name=repo_name) }}">Refs</a>·
+        <a href="{{ url_for('repo_tree_path', repo_name=repo_name) }}?ref={{ current_ref }}">Tree</a>·
         <a href="{{ url_for('repo_diff', repo_name=repo_name) }}?ref={{ current_ref }}">Diff</a>
         {% endif %}
         {% if refs %}
diff --git a/templates/index.html b/templates/index.html
index ad357a2..1b3bf69 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -3,11 +3,17 @@
 <head>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title>Py GitWeb</title>
+    <title>Lipasto</title>
     <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
 </head>
 <body>
-    <h1>Repositories</h1>
+    <h1>
+        Lipasto
+    </h1>
+    <p>
+        A git interface for repositories. In development. Currently supports basic git pluming features, and views commits, trees, blobs, diffs and refs. Feautres like stats, commit signature verification, grep, submodules, auth, sql db integration are planned.  
+    </p>
+    <h2>Repositories</h2>
     <ul>
         {% for repo in repos %}
             <li><a href="{{ url_for('repo_detail', repo_name=repo.name) }}">{{ repo.name }}</a></li>
diff --git a/templates/repo.html b/templates/repo.html
index 0c7dc84..5969cb3 100644
--- a/templates/repo.html
+++ b/templates/repo.html
@@ -2,5 +2,31 @@
 
 {% block content %}
 <h1>Repository: {{ repo_name }}</h1>
-<img src="{{ url_for('static', filename='cat.png') }}" alt="cat">
+<h2>Latest commits</h2>
+<table border="1">
+    <thead>
+        <tr>
+            <th>Commit</th>
+            <th>Message</th>
+            <th>Author</th>
+            <th>Date</th>
+            <th>Files Changed</th>
+            <th>Insertions</th>
+            <th>Deletions</th>
+        </tr>
+    </thead>
+    <tbody>
+        {% for commit in commits %}
+            <tr>
+                <td><a href="{{ url_for('commit_detail', repo_name=repo_name, commit_id=commit.id) }}">{{ commit.id[:8] }}</a></td>
+                <td>{{ commit.message }}</td>
+                <td>{{ commit.author.name }}</td>
+                <td>{{ commit.date | datetime }}</td>
+                <td>{{ commit.diff_stats.files_changed }}</td>
+                <td>{{ commit.diff_stats.insertions }}</td>
+                <td>{{ commit.diff_stats.deletions }}</td>
+            </tr>
+        {% endfor %}
+    </tbody>
+</table>
 {% endblock %}
\ No newline at end of file