grim/hgkeeper-theme

Parents dbeac8d89a39
Children 1bd5816b01e2
Lots of updates for the changeset rendering. Basically header and stats, still need to finish diffs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hgkeeper/changeset/body.tmpl Sat Mar 21 23:57:25 2020 -0500
@@ -0,0 +1,1 @@
+<div class="list-group-item rounded-bottom p-2">{sub("\n", "<br>", desc)}</div>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hgkeeper/changeset/description.tmpl Sat Mar 21 23:57:25 2020 -0500
@@ -0,0 +1,19 @@
+{header}
+
+<div class="card">
+ <div class="list-group list-group-flush">
+ {changesetheader}
+ {changesetbody}
+ </div>
+</div>
+
+<div class="card mt-2">
+ <div class="card-body">
+ <a data-toggle="collapse" href="#diffstat">{diffsummary}</a>
+ </div>
+ <div class="card-body collapse" id="diffstat">
+ {diffstat}
+ </div>
+</div>
+
+{footer}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hgkeeper/changeset/diffstat.tmpl Sat Mar 21 23:57:25 2020 -0500
@@ -0,0 +1,9 @@
+<li class="list-group-item">
+ <div class="d-inline-block diffstat">
+ <div class="btn-group d-flex">
+ <span class="border rounded-left flex-fill added mr-auto p-1 text-center">+{added}</span>
+ <span class="border rounded-right flex-fill removed ml-auto p-1 text-center">-{removed}</span>
+ </div>
+ </div>
+ <a href="#l{fileno}.1">{file|escape}</a>
+</li>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hgkeeper/changeset/header.tmpl Sat Mar 21 23:57:25 2020 -0500
@@ -0,0 +1,18 @@
+<div class="list-group-item d-flex align-items-stretch" data-node="{node|short}">
+ <div class="p-1 align-self-center">
+ <img src="https://www.gravatar.com/avatar/{author|email|mailmap|strip|lower|md5}?s=36" decoding="async">
+ </div>
+ <div class="p-1 text-truncate">
+ <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">
+ {desc|strip|firstline|escape|nonempty}</a><br>\
+ {if(alltags, "{alltags}<br>")}
+ {date|age}, {author|person}
+ </div>
+ <div class="p-1 ml-auto align-self-center">
+ <div class="btn-group">
+ <span class="p-1 rounded-left border border-info text-monospace align-middle">{node|short}</span>
+ <a class="btn btn-sm btn-outline-info clipboard" href="#" data-clipboard-text="{node}" title="Copy Revision"><i class="icofont-ui-clip-board"></i></a>
+ <a class="btn btn-sm btn-outline-info" href="{url|urlescape}file/{node}" title="Browse Files"><i class="icofont-ui-folder"></i></a>
+ </div>
+ </div>
+</div>
--- a/hgkeeper/graph/entry.tmpl Sat Mar 21 06:30:33 2020 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-<li class="list-group-item d-flex align-items-stretch" data-node="{node|short}">
- <div class="p-1 align-self-center">
- <img src="https://www.gravatar.com/avatar/{author|email|strip|lower|md5}?s=36">
- </div>
- <div class="p-1 text-truncate">
- <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty}</a><br>
- {date|age}, {author|person}
- </div>
- <div class="p-1 ml-auto">
- <div class="btn-group">
- <span class="p-1 rounded-left border border-info text-monospace align-middle">{node|short}</span>
- <a class="btn btn-sm btn-outline-info clipboard" href="#" data-clipboard-text="{node}" title="Copy Revision"><i class="icofont-ui-clip-board"></i></a>
- <a class="btn btn-sm btn-outline-info" href="{url|urlescape}file/{node}" title="Browse Files"><i class="icofont-ui-folder"></i></a>
- </div>
- </div>
-</li>
--- a/hgkeeper/graph/list.tmpl Sat Mar 21 06:30:33 2020 -0500
+++ b/hgkeeper/graph/list.tmpl Sat Mar 21 23:57:25 2020 -0500
@@ -3,7 +3,7 @@
<div class="position-relative">
<canvas id="graph" class="position-absolute" style="z-index: 5;"></canvas>
<ul class="list-group" id="graphnodes">
- {nodes%graphentry}
+ {nodes%changesetheader}
</ul>
</div>
--- a/hgkeeper/header.tmpl Sat Mar 21 06:30:33 2020 -0500
+++ b/hgkeeper/header.tmpl Sat Mar 21 23:57:25 2020 -0500
@@ -5,8 +5,9 @@
<meta name="robots" content="index, nofollow"/>
<link rel="stylesheet" href="{staticurl|urlescape}css/icofont.min.css">
+ <link rel="stylesheet" href="{staticurl|urlescape}css/bootstrap.min.css" type="text/css" />
+ <link rel="stylesheet" href="{staticurl|urlescape}css/hgkeeper.css">
- <link rel="stylesheet" href="{staticurl|urlescape}css/bootstrap.min.css" type="text/css" />
<script type="text/javascript" src="{staticurl|urlescape}js/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="{staticurl|urlescape}js/bootstrap.bundle.min.js"></script>
<script type="text/javascript" src="{staticurl|urlescape}js/clipboard.min.js"></script>
--- a/hgkeeper/manifest/list.tmpl Sat Mar 21 06:30:33 2020 -0500
+++ b/hgkeeper/manifest/list.tmpl Sat Mar 21 23:57:25 2020 -0500
@@ -4,11 +4,7 @@
<div class="card-header">
{repo|escape}{path|escape}
</div>
- <div class="card-body">
- <div class="card-text">{node|short} {alltags}</div>
- <div class="card-text">{author|person} {date|age}</div>
- <div class="card-text">{desc|firstline}</div>
- </div>
+ {changesetheader}
</div>
<ul class="list-group list-group-flush">
--- a/hgkeeper/map Sat Mar 21 06:30:33 2020 -0500
+++ b/hgkeeper/map Sat Mar 21 23:57:25 2020 -0500
@@ -24,7 +24,6 @@
summary = summary.tmpl
shortlog = shortlog/list.tmpl
-shortlogentry = shortlog/entry.tmpl
bookmarkentry = bookmark/entry.tmpl
@@ -42,4 +41,9 @@
reponav = nav/repo.tmpl
graph = graph/list.tmpl
-graphentry = graph/entry.tmpl
+
+changeset = changeset/description.tmpl
+changesetheader = changeset/header.tmpl
+changesetbody = changeset/body.tmpl
+diffstatlink = changeset/diffstat.tmpl
+diffstatnolink = changeset/diffstat.tmpl
--- a/hgkeeper/shortlog/entry.tmpl Sat Mar 21 06:30:33 2020 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-<li class="list-group-item">
-<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{desc|strip|firstline|escape|nonempty} {alltags}</a><br/>
-{author|person} <small>{date|age}</small>
-</li>
--- a/hgkeeper/shortlog/list.tmpl Sat Mar 21 06:30:33 2020 -0500
+++ b/hgkeeper/shortlog/list.tmpl Sat Mar 21 23:57:25 2020 -0500
@@ -2,7 +2,7 @@
<div class="card">
<ul class="list-group list-group-flush">
- {entries%shortlogentry}
+ {entries%changesetheader}
</ul>
</div>
--- a/hgkeeper/summary.tmpl Sat Mar 21 06:30:33 2020 -0500
+++ b/hgkeeper/summary.tmpl Sat Mar 21 23:57:25 2020 -0500
@@ -12,7 +12,7 @@
Recent Changes
</div>
<ul class="list-group list-group-flush">
- {shortlog%shortlogentry}
+ {shortlog%changesetheader}
</ul>
</div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/static/css/hgkeeper.css Sat Mar 21 23:57:25 2020 -0500
@@ -0,0 +1,19 @@
+.diffstat {
+ font-size: small;
+ font-family: monospace;
+ min-width: 12em;
+}
+
+.diffstat .added {
+ background-color: #7dff7d;
+ color: #235d23;
+ border-color: #235d23 !important;
+ width: 50%; /* to make sure that both pils are the same size */
+}
+
+.diffstat .removed {
+ background-color: #ff8d8d;
+ color: #8d2323;
+ border-color: #8d2323 !important;
+ width: 50%; /* to make sure that both pils are the same size */
+}