grim/hgkeeper-theme

Parents 32ea68e4de50
Children 9ad45fc93a09
basic setup for the diffs, need some more work on the extension to continue
--- a/templates/hgkeeper/changeset/description.tmpl Sun Mar 22 07:52:06 2020 -0500
+++ b/templates/hgkeeper/changeset/description.tmpl Tue Mar 24 00:14:01 2020 -0500
@@ -16,4 +16,6 @@
</div>
</div>
+{diff}
+
{footer}
--- a/templates/hgkeeper/changeset/diffstat.tmpl Sun Mar 22 07:52:06 2020 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-<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/templates/hgkeeper/diff/block.tmpl Tue Mar 24 00:14:01 2020 -0500
@@ -0,0 +1,1 @@
+<div class="card mt-2 diff"><div class="d-inline-block" style="min-width: 100%">{lines}</div></div>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/hgkeeper/diff/line.tmpl Tue Mar 24 00:14:01 2020 -0500
@@ -0,0 +1,1 @@
+<div class="d-flex">{difflineanchors}<div class="unchanged">{strip(line|escape, '\r\n')}</div></div>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/hgkeeper/diff/lineanchors.tmpl Tue Mar 24 00:14:01 2020 -0500
@@ -0,0 +1,1 @@
+{if(minuslineno, '<a href="#" class="line-number" data-line-number="{minuslineno}"></a>', '<span class="line-number" data-line-number="&nbsp;"></span>')}{if(pluslineno, '<a href="#" class="line-number" data-line-number="{pluslineno}"></a>', '<span class="line-number" data-line-number="&nbsp;"></span>')}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/hgkeeper/diff/lineat.tmpl Tue Mar 24 00:14:01 2020 -0500
@@ -0,0 +1,1 @@
+<div class="d-flex">{difflineanchors}<div class="offset">{strip(line|escape, '\r\n')}</div></div>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/hgkeeper/diff/lineminus.tmpl Tue Mar 24 00:14:01 2020 -0500
@@ -0,0 +1,4 @@
+<div class="d-flex">
+ {difflineanchors}
+ <del id="{lineid}">{strip(line|escape, '\r\n')}</del>
+</div>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/hgkeeper/diff/lineplus.tmpl Tue Mar 24 00:14:01 2020 -0500
@@ -0,0 +1,4 @@
+<div class="d-flex">
+ {difflineanchors}
+ <ins id="{lineid}">{strip(line|escape, '\r\n')}</ins>
+</div>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/hgkeeper/diff/stat.tmpl Tue Mar 24 00:14:01 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 color-added bg-added border-added mr-auto p-1 w-50 text-center">+{added}</span>
+ <span class="border rounded-right flex-fill color-removed bg-removed border-removed ml-auto p-1 w-50 text-center">-{removed}</span>
+ </div>
+ </div>
+ <a href="#l{fileno}.1">{file|escape}</a>
+</li>
\ No newline at end of file
--- a/templates/hgkeeper/map Sun Mar 22 07:52:06 2020 -0500
+++ b/templates/hgkeeper/map Tue Mar 24 00:14:01 2020 -0500
@@ -45,5 +45,12 @@
changeset = changeset/description.tmpl
changesetheader = changeset/header.tmpl
changesetbody = changeset/body.tmpl
-diffstatlink = changeset/diffstat.tmpl
-diffstatnolink = changeset/diffstat.tmpl
+
+diffblock = diff/block.tmpl
+diffline = diff/line.tmpl
+difflineanchors = diff/lineanchors.tmpl
+difflineat = diff/lineat.tmpl
+difflineminus = diff/lineminus.tmpl
+difflineplus = diff/lineplus.tmpl
+diffstatlink = diff/stat.tmpl
+diffstatnolink = diff/stat.tmpl
--- a/templates/static/css/hgkeeper.css Sun Mar 22 07:52:06 2020 -0500
+++ b/templates/static/css/hgkeeper.css Tue Mar 24 00:14:01 2020 -0500
@@ -4,16 +4,71 @@
min-width: 12em;
}
-.diffstat .added {
- background-color: #7dff7d;
+.diff {
+ font-family: monospace;
+ overflow-x: auto;
+}
+
+.diff ins {
color: #235d23;
- border-color: #235d23 !important;
- width: 50%; /* to make sure that both pils are the same size */
+ background-color: #7dff7d;
+ display: inline-block;
+ text-decoration: none;
+ white-space: pre;
+ flex: 1 1 auto; /* bootstrap flex-fill */
+}
+
+.line-number {
+ display: inline-block;
+ width: 5ch;
+ text-align: right;
+ margin-right: 1ch;
+ flex-shrink: 0; /* bootstrap flex-shrink */
+}
+
+.line-number:before {
+ content: attr(data-line-number);
+}
+
+.color-added {
+ color: #235d23;
+}
+
+.bg-added {
+ background-color: #7dff7d;
}
-.diffstat .removed {
+.border-added {
+ border-color: #235d23 !important;
+}
+
+.diff del {
+ color: #8d2323;
background-color: #ff8d8d;
+ display: inline-block;
+ text-decoration: none;
+ white-space: pre;
+ flex: 1 1 auto; /* bootstrap flex-fill */
+}
+
+.color-removed {
color: #8d2323;
+}
+
+.bg-removed {
+ background-color: #ff8d8d;
+}
+
+.border-removed {
border-color: #8d2323 !important;
- width: 50%; /* to make sure that both pils are the same size */
}
+
+.diff div.unchanged {
+ display: inline-block;
+ white-space: pre;
+ flex: 1 1 auto; /* bootstrap flex-fill */
+}
+
+.diff div.offset {
+ color: #e800e8;
+}
\ No newline at end of file