Changeset - 03cc203d3e98
[Not reviewed]
default
0 1 0
Mads Kiilerich - 11 years ago 2014-08-12 13:08:23
madski@unity3d.com
diff: show images when relevant - don't show images with empty src
1 file changed with 14 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/templates/changeset/diff_block.html
Show inline comments
 
@@ -43,18 +43,24 @@
 
        </div>
 
        <div class="code-body">
 
            <div class="full_f_path" path="${h.safe_unicode(path)}"></div>
 
            ${diff|n}
 
            %if path.rsplit('.')[-1] in ['png', 'gif', 'jpg', 'bmp']:
 
              <div class="btn btn-image-diff-show">Show images</div>
 
              %if change =='M':
 
              <div id="${FID}_image-diff" class="btn btn-image-diff-swap" style="display:none">Press to swap images</div>
 
              %endif
 
              <div style="font-size: 0">
 
                %if change == 'M':
 
                <img id="${FID}_image-diff-img-a" class="img-diff img-diff-swapable" style="display:none"
 
                    realsrc="${h.url('files_raw_home',repo_name=c.repo_name,revision=cs1,f_path=path) if change in 'DM' else ''}" />
 
                      realsrc="${h.url('files_raw_home',repo_name=c.repo_name,revision=cs1,f_path=path)}" />
 
                %endif
 
                %if change in 'AM':
 
                <img id="${FID}_image-diff-img-b" class="img-diff img-diff-swapable" style="display:none"
 
                    realsrc="${h.url('files_raw_home',repo_name=c.repo_name,revision=cs2,f_path=path) if change in 'AM' else ''}" />
 
                      realsrc="${h.url('files_raw_home',repo_name=c.repo_name,revision=cs2,f_path=path)}" />
 
                %endif
 
              </div>
 
            %endif
 
        </div>
 
    </div>
 
%endfor
 
</div>
 
@@ -95,18 +101,24 @@
 
      </div>
 
        <div class="code-body">
 
            <div class="full_f_path" path="${h.safe_unicode(filenode_path)}"></div>
 
            ${diff|n}
 
            %if filenode_path.rsplit('.')[-1] in ['png', 'gif', 'jpg', 'bmp']:
 
              <div class="btn btn-image-diff-show">Show images</div>
 
              %if op == 'M':
 
              <div id="${h.FID('',filenode_path)}_image-diff" class="btn btn-image-diff-swap" style="display:none">Press to swap images</div>
 
              %endif
 
              <div style="font-size: 0">
 
                %if op == 'M':
 
                <img id="${h.FID('',filenode_path)}_image-diff-img-a" class="img-diff img-diff-swapable" style="display:none"
 
                    realsrc="${h.url('files_raw_home',repo_name=c.other_repo.repo_name,revision=c.other_rev,f_path=filenode_path) if op in 'DM' else ''}" />
 
                %endif
 
                %if op in 'AM':
 
                <img id="${h.FID('',filenode_path)}_image-diff-img-b" class="img-diff img-diff-swapable" style="display:none"
 
                    realsrc="${h.url('files_raw_home',repo_name=c.org_repo.repo_name,revision=c.org_rev,f_path=filenode_path) if op in 'AM' else ''}" />
 
                %endif
 
              </div>
 
            %endif
 
        </div>
 
    </div>
 
  %endfor
 
</%def>
0 comments (0 inline, 0 general)