diff --git a/app.py b/app.py
index 9e2696a..6aad97f 100644
--- a/app.py
+++ b/app.py
@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
th, td {
border: 1px solid black;
- padding: 8px;
+ padding: 2px;
text-align: left;
}
.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
<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
<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
{% 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