diff --git a/kallithea/public/css/style.css b/kallithea/public/css/style.css
--- a/kallithea/public/css/style.css
+++ b/kallithea/public/css/style.css
@@ -5122,6 +5122,17 @@ div.comment:target>.comment-wrapp {
margin: -2px;
}
+.btn-image-diff-show,
+.btn-image-diff-swap {
+ margin: 5px;
+}
+
+.img-diff {
+ max-width: 45%;
+ height: auto;
+ margin: 5px;
+}
+
.img-preview {
max-width: 100%;
height: auto;
diff --git a/kallithea/templates/changeset/changeset.html b/kallithea/templates/changeset/changeset.html
--- a/kallithea/templates/changeset/changeset.html
+++ b/kallithea/templates/changeset/changeset.html
@@ -157,6 +157,7 @@ ${self.repo_context_bar('changelog', c.c
## diff block
<%namespace name="diff_block" file="/changeset/diff_block.html"/>
+ ${diff_block.diff_block_js()}
${diff_block.diff_block(c.changes[c.changeset.raw_id])}
% if c.limited_diff:
diff --git a/kallithea/templates/changeset/changeset_range.html b/kallithea/templates/changeset/changeset_range.html
--- a/kallithea/templates/changeset/changeset_range.html
+++ b/kallithea/templates/changeset/changeset_range.html
@@ -75,7 +75,8 @@ ${self.repo_context_bar('changelog')}
<%namespace name="comment" file="/changeset/changeset_file_comment.html"/>
<%namespace name="diff_block" file="/changeset/diff_block.html"/>
- %for cs in c.cs_ranges:
+ ${diff_block.diff_block_js()}
+ %for cs in c.cs_ranges:
##${comment.comment_inline_form(cs)}
## diff block
${diff|n}
+ %if path.rsplit('.')[-1] in ['png', 'gif', 'jpg', 'bmp']:
+
Show images
+
Press to swap images
+
+
![]()
![]()
+
+ %endif
%endfor
@@ -88,7 +99,45 @@
${diff|n}
+ %if filenode_path.rsplit('.')[-1] in ['png', 'gif', 'jpg', 'bmp']:
+
Show images
+
Press to swap images
+
+
![]()
![]()
+
+ %endif
%endfor
%def>
+
+<%def name="diff_block_js()">
+
+%def>
diff --git a/kallithea/templates/compare/compare_diff.html b/kallithea/templates/compare/compare_diff.html
--- a/kallithea/templates/compare/compare_diff.html
+++ b/kallithea/templates/compare/compare_diff.html
@@ -81,6 +81,7 @@ ${self.repo_context_bar('changelog')}
## diff block
<%namespace name="diff_block" file="/changeset/diff_block.html"/>
+ ${diff_block.diff_block_js()}
%for fid, change, f, stat in c.files:
${diff_block.diff_block_simple([c.changes[fid]])}
%endfor
diff --git a/kallithea/templates/files/file_diff.html b/kallithea/templates/files/file_diff.html
--- a/kallithea/templates/files/file_diff.html
+++ b/kallithea/templates/files/file_diff.html
@@ -25,6 +25,7 @@ ${self.repo_context_bar('changelog')}
## diff block
<%namespace name="diff_block" file="/changeset/diff_block.html"/>
+ ${diff_block.diff_block_js()}
${diff_block.diff_block(c.changes)}
diff --git a/kallithea/templates/pullrequests/pullrequest_show.html b/kallithea/templates/pullrequests/pullrequest_show.html
--- a/kallithea/templates/pullrequests/pullrequest_show.html
+++ b/kallithea/templates/pullrequests/pullrequest_show.html
@@ -307,6 +307,7 @@ ${self.repo_context_bar('showpullrequest
## diff block
<%namespace name="diff_block" file="/changeset/diff_block.html"/>
+ ${diff_block.diff_block_js()}
%for fid, change, f, stat in c.files:
${diff_block.diff_block_simple([c.changes[fid]])}
%endfor