Skip to content

Commit

Permalink
feat: page/history and page/blame make better use of space. Improved …
Browse files Browse the repository at this point in the history
…blame display.
  • Loading branch information
redimp committed Sep 10, 2024
1 parent 1a88ab8 commit 20a33d2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
16 changes: 8 additions & 8 deletions otterwiki/static/css/partials/history.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ tr.added {

table .min {
width: 1%;
padding-right: 0.4rem;
}
table .linenumber {
text-align: right;
Expand All @@ -53,24 +54,23 @@ table.blame {
overflow-x: auto;
width: 100%;
}

table.blame td {
padding: 0.1rem 0.5rem;
/*border: 1px solid black;*/
vertical-align: top;
}

table.blame .tt {
font-family: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
}

table.blame tr.odd {
background-color: rgba(0, 0, 0, 0.1);
white-space: pre-wrap;
padding-left: 1rem;
}

table.compact td {
padding: 0.5rem 0.2rem;
}

.dark-mode table.blame tr.odd {
background-color: rgba(0, 0, 0, 0.3);
table.blame tr.chunk-start > td {
padding-top: 0.2rem;
}

.text-match {
Expand Down
5 changes: 3 additions & 2 deletions otterwiki/templates/blame.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{{ super() }}
<meta name="robots" content="noindex, nofollow">
{% endblock %}
{% block extra_nav %}{% endblock %}
{% block content %}
<div class="w-full mw-full p-0 m-0 clearfix">
<h2>Blame {#{pagename}#}</h2>
Expand All @@ -14,8 +15,8 @@ <h2>Blame {#{pagename}#}</h2>
<td class="min">{% if line[0] %}<a href="{{ url_for("show_commit", revision=line[0]) }}" class="btn revision-small">{{line[0]}}</a>{% endif %}</td>
<td class="min" style="white-space:nowrap">{{line[1]}}</td>
<td class="min" style="white-space:nowrap">{% if line[2] %}<a href="{{ url_for("pageview", path=pagepath, revision=line[0]) }}">{{line[2]|format_datetime}}</a>{% endif %}</td>
<td class="tt min linenumber">{{line[3]}}</td>
<td class="tt"><div class="highlight">{{line[4]|safe}}</div></td>
<td class="tt min linenumber" style="border-left: 2px solid #{{line[6]}};">{{line[3]}}</td>
<td class="tt" style="border-right: 2px solid #{{line[6]}}; border-left: 2px solid #{{line[6]}};"><div class="highlight">{{line[4]|safe}}</div></td>
</tr>
{%- endfor %}{# l in lines #}
</table>
Expand Down
1 change: 1 addition & 0 deletions otterwiki/templates/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{{ super() }}
<meta name="robots" content="noindex, nofollow">
{% endblock %}
{% block extra_nav %}{% endblock %}
{% block content %}
<div class="w-full mw-full p-0 clearfix">
<h2>History {#{pagename}#}</h2>
Expand Down
4 changes: 2 additions & 2 deletions otterwiki/wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,11 +740,11 @@ def blame(self):
if row[0] != last:
oddeven = "odd" if oddeven == "even" else "even"
fdata.append(
(row[0], row[1], row[2], int(row[3]), line, oddeven)
(row[0], row[1], row[2], int(row[3]), line, f"chunk-start chunk-start-{oddeven}", row[0])
)
last = row[0]
else:
fdata.append(("", "", "", int(row[3]), line, oddeven))
fdata.append(("", "", "", int(row[3]), line, oddeven, row[0]))
menutree = SidebarPageIndex(get_page_directoryname(self.pagepath))
return render_template(
"blame.html",
Expand Down

0 comments on commit 20a33d2

Please sign in to comment.