diff --git a/static/styles.css b/static/styles.css
new file mode 100644
index 0000000..df33122
--- /dev/null
+++ b/static/styles.css
+* {
+ box-sizing: border-box;
+}
+
+hr {
+ margin: 10px 0;
+ border-top: 1px;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ font-size: 1em;
+ margin: 0;
+}
diff --git a/templates/base.html b/templates/base.html
index a003975..a4b99b2 100644
--- a/templates/base.html
+++ b/templates/base.html
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lipasto</title>
+ <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
</head>
<body>
<nav>
</select>
{% endif %}
</nav>
+ <hr />
<main>
{% block content %}{% endblock %}
</main>
diff --git a/templates/commit.html b/templates/commit.html
index f469375..7407e5a 100644
--- a/templates/commit.html
+++ b/templates/commit.html
{% extends "base.html" %}
{% block content %}
- <h1>commit {{ commit.id }}</h1>
- Author: {{ commit.author.name }} <{{ commit.author.email }}><br>
- Committer: {{ commit.committer.name }} <{{ commit.committer.email }}><br>
- Date: {{ commit.date | datetime }}
- {% if commit.parent_id %}<br>
- Parent: <a href="{{ url_for('commit_detail', repo_name=repo_name, commit_id=commit.parent_id) }}">{{ commit.parent_id }}</a>
- {% endif %}<br>
- Tree: <a href="{{ url_for('repo_tree_path', repo_name=repo_name, path='') }}?ref={{ commit.tree_id }}">{{ commit.tree_id }}</a>
- <div>
- {{ commit.message }}
- </div>
- <a href="{{ url_for('repo_tree_path', repo_name=repo_name, path='') }}?ref={{ commit.id }}">View Tree</a>
+ <header>
+ <b>Commit:</b> <a href="{{ url_for('commit_detail', repo_name=repo_name, commit_id=commit.id) }}">{{ commit.id }}</a><br>
+ {% if commit.parent_id %}
+ <b>Parent:</b> <a href="{{ url_for('commit_detail', repo_name=repo_name, commit_id=commit.parent_id) }}">{{ commit.parent_id }}</a><br>
+ {% endif %}
+ <b>Author:</b> {{ commit.author.name }} <{{ commit.author.email }}><br>
+ <b>Committer:</b> {{ commit.committer.name }} <{{ commit.committer.email }}><br>
+ <b>Date:</b> {{ commit.date | datetime }}<br>
+ <b>Tree:</b> <a href="{{ url_for('repo_tree_path', repo_name=repo_name, path='') }}?ref={{ commit.tree_id }}">{{ commit.tree_id }}</a>
+ </header>
+ <p>{{ commit.message }}</p>
{% if commit.diff %}
- <h2>Changed Files</h2>
+ <h2>Diffstat</h2>
<table>
- <thead>
- <tr>
- <th>File</th>
- <th>Additions</th>
- <th>Deletions</th>
- <th>Status</th>
- </tr>
- </thead>
<tbody>
{% for file in commit.changed_files %}
+ {% set status_letter = {'added':'A','deleted':'D','modified':'M','renamed':'R','copied':'C','typechange':'T'}.get(file.status, '?') %}
+ {% set total = file.additions + file.deletions %}
+ {% set plus_len = [file.additions, 40] | min %}
+ {% set minus_len = [file.deletions, 40] | min %}
<tr>
+ <td class="status {{ status_letter }}">{{ status_letter }}</td>
<td><a href="{{ url_for('repo_blob_path', repo_name=repo_name, path=file.file) }}?ref={{ commit.id }}">{{ file.file }}</a></td>
- <td>+{{ file.additions }}</td>
- <td>-{{ file.deletions }}</td>
- <td>{{ file.status }}</td>
+ <td>|</td>
+ <td>{{ total }}</td>
+ <td><span style="color: green;">{{ '+' * plus_len }}</span><span style="color: red;">{{ '- ' * minus_len }}</span></td>
</tr>
{% endfor %}
</tbody>
</table>
+ <p>{{ commit.diff_stats.files_changed }} files changed, {{ commit.diff_stats.insertions }} insertions(+), {{ commit.diff_stats.deletions }} deletions(-)</p>
{% if commit.parent_id %}
<div>
<a href="{{ url_for('repo_diff', repo_name=repo_name) }}?id1={{ commit.parent_id }}&id2={{ commit.id }}">View Full Diff</a> |