Changeset - 150431aae9ba
[Not reviewed]
default
0 3 0
Jan Heylen - 10 years ago 2016-01-02 11:55:36
heyleke@gmail.com
diff: move looping over files into diff_block_simple

Make it slightly more like regular diff_block and make the next changes
possible.
3 files changed with 7 insertions and 9 deletions:
0 comments (0 inline, 0 general)
kallithea/templates/changeset/diff_block.html
Show inline comments
 
@@ -62,15 +62,17 @@
 
        </div>
 
    </div>
 
%endfor
 
</div>
 
</%def>
 

	
 
<%def name="diff_block_simple(change)">
 

	
 
  %for op,filenode_path,diff in change:
 
<%def name="diff_block_simple(files, changes)">
 
  %for fid, ch, f, stat in files:
 
    <%
 
    op, filenode_path, diff = changes[fid]
 
    %>
 
    <div id="${h.FID('',filenode_path)}_target" style="clear:both;margin-top:25px"></div>
 
    <div id="${h.FID('',filenode_path)}" class="diffblock  margined comm">
 
      <div class="code-header">
 
          <div class="changeset_header">
 
              <div class="changeset_file">
 
                  ${h.safe_unicode(filenode_path)} |
kallithea/templates/compare/compare_diff.html
Show inline comments
 
@@ -85,15 +85,13 @@ ${self.repo_context_bar('changelog')}
 
                % endif
 
         </div>
 

	
 
        ## 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_block.diff_block_simple(c.files, c.changes)}
 
        % if c.limited_diff:
 
          <h4>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff')}</a></h4>
 
        % endif
 
    %endif
 
    </div>
 

	
kallithea/templates/pullrequests/pullrequest_show.html
Show inline comments
 
@@ -353,15 +353,13 @@ ${self.repo_context_bar('showpullrequest
 
    </script>
 

	
 
    ## diff block
 
    <div class="commentable-diff">
 
    <%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_block.diff_block_simple(c.files, c.changes)}
 
    % if c.limited_diff:
 
      <h4>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff anyway')}</a></h4>
 
    % endif
 
    </div>
 

	
 
    ## template for inline comment form
0 comments (0 inline, 0 general)