Edgewall Software

Ticket #199: templates.patch

File templates.patch, 6.2 KB (added by agr30@…, 4 years ago)

Templates for anydiff

  • templates/anydiff.cs

    diff -ruN /opt/trac.bak/templates/anydiff.cs templates/anydiff.cs
    old new  
     1<?cs set:html.stylesheet = 'css/changeset.css' ?> 
     2<?cs include "header.cs"?> 
     3<?cs include "macros.cs"?> 
     4 
     5<div id="ctxtnav" class="nav"> 
     6 <ul> 
     7  <li class="last"><a href="?format=diff">Download Diff</a></li> 
     8 </ul> 
     9</div> 
     10 
     11<div id="content" class="changeset"> 
     12<?cs each:file = changeset.diff.files ?> 
     13<h1>Diff between revision <?cs var:file.rev.old ?> and  
     14                revision <?cs var:file.rev.new ?>  
     15                of <?cs var:file.name.new ?></h1> 
     16<?cs /each ?> 
     17 
     18<form method="post" id="prefs" action="<?cs var:anydiff.href ?>"> 
     19 <div> 
     20  <label for="style">View differences</label> 
     21  <select id="style" name="style"> 
     22   <option value="inline"<?cs 
     23     if:diff.style == 'inline' ?> selected="selected"<?cs 
     24     /if ?>>inline</option> 
     25   <option value="sidebyside"<?cs 
     26     if:diff.style == 'sidebyside' ?> selected="selected"<?cs 
     27     /if ?>>side by side</option> 
     28  </select> 
     29  <div class="field"> 
     30   Show <input type="text" name="contextlines" id="contextlines" size="2" 
     31     maxlength="2" value="<?cs var:diff.options.contextlines ?>" /> 
     32   <label for="contextlines">lines around each change</label> 
     33  </div> 
     34  <fieldset id="ignore"> 
     35   <legend>Ignore:</legend> 
     36   <div class="field"> 
     37    <input type="checkbox" id="blanklines" name="ignoreblanklines" <?cs 
     38      if:diff.options.ignoreblanklines ?>checked="checked"<?cs /if ?>/> 
     39    <label for="blanklines">Blank lines</label> 
     40   </div> 
     41   <div class="field"> 
     42    <input type="checkbox" id="case" name="ignorecase" <?cs 
     43      if:diff.options.ignorecase ?>checked="checked"<?cs /if ?>/> 
     44    <label for="case">Case changes</label> 
     45   </div> 
     46   <div class="field"> 
     47    <input type="checkbox" id="whitespace" name="ignorewhitespace" <?cs 
     48      if:diff.options.ignorewhitespace ?>checked="checked"<?cs /if ?>/> 
     49    <label for="whitespace">White space changes</label> 
     50   </div> 
     51  </fieldset> 
     52  <div class="buttons"> 
     53   <input type="submit" name="update" value="Update" /> 
     54  </div> 
     55 </div> 
     56        <?cs each:file = changeset.diff.files ?> 
     57         <input type="hidden" name="a" value="<?cs var:file.rev.old ?>" /> 
     58         <input type="hidden" name="b" value="<?cs var:file.rev.new ?>" /> 
     59        <?cs /each ?> 
     60</form> 
     61 
     62 
     63<div class="diff"> 
     64 <div id="legend"> 
     65  <h3>Legend:</h3> 
     66  <dl> 
     67   <dt class="unmod"></dt><dd>Unmodified</dd> 
     68   <dt class="add"></dt><dd>Added</dd> 
     69   <dt class="rem"></dt><dd>Removed</dd> 
     70   <dt class="mod"></dt><dd>Modified</dd> 
     71  </dl> 
     72  <br />&nbsp; 
     73 </div> 
     74 <ul> 
     75  <?cs each:file = changeset.diff.files ?> 
     76   <?cs if:len(file.changes) ?> 
     77    <li id="file<?cs var:name(file) ?>"> 
     78     <h2><a href="<?cs 
     79       var:file.browser_href.new ?>" title="Show version <?cs 
     80       var:file.rev.new ?> of this file in browser"><?cs 
     81       var:file.name.new ?></a></h2> 
     82     <?cs if:diff.style == 'sidebyside' ?> 
     83      <table class="sidebyside to_collapse" summary="Differences" cellspacing="0"> 
     84       <colgroup class="base"> 
     85        <col class="lineno" /><col class="content" /> 
     86       <colgroup class="chg"> 
     87        <col class="lineno" /><col class="content" /> 
     88       </colgroup> 
     89       <thead><tr> 
     90        <th colspan="2"><a href="<?cs var:file.browser_href.old ?>">Revision <?cs 
     91          var:file.rev.old ?></a></th> 
     92        <th colspan="2"><a href="<?cs var:file.browser_href.new ?>">Revision <?cs 
     93          var:file.rev.new ?></a></th> 
     94       </tr></thead> 
     95       <?cs each:change = file.changes ?> 
     96        <tbody> 
     97         <?cs call:diff_display(change, diff.style) ?> 
     98        </tbody> 
     99        <?cs if:name(change) < len(file.changes) - 1 ?> 
     100         <tbody class="skippedlines"> 
     101          <tr><th>&hellip;</th><td>&nbsp;</td> 
     102          <th>&hellip;</th><td>&nbsp;</td></tr> 
     103         </tbody> 
     104        <?cs /if ?> 
     105       <?cs /each ?> 
     106      </table> 
     107     <?cs else ?> 
     108      <table class="inline to_collapse" summary="Differences" cellspacing="0"> 
     109       <colgroup> 
     110        <col class="lineno" /> 
     111        <col class="lineno" /> 
     112        <col class="content" /> 
     113       </colgroup> 
     114       <thead><tr> 
     115        <th title="Revision <?cs var:file.rev.old ?>"><a href="<?cs 
     116          var:file.browser_href.old ?>" title="Show revision <?cs 
     117          var:file.rev.old ?> of this file in browser">r<?cs 
     118          var:file.rev.old ?></a></th> 
     119        <th title="Revision <?cs var:file.rev.new ?>"><a href="<?cs 
     120          var:file.browser_href.new ?>" title="Show revision <?cs 
     121          var:file.rev.new ?> of this file in browser">r<?cs 
     122          var:file.rev.new ?></a></th> 
     123        <th>&nbsp;</th> 
     124       </tr></thead> 
     125       <?cs each:change = file.changes ?> 
     126        <?cs call:diff_display(change, diff.style) ?> 
     127        <?cs if:name(change) < len(file.changes) - 1 ?> 
     128         <tbody class="skippedlines"> 
     129          <tr><th>&hellip;</th><th>&hellip;</th><td>&nbsp;</td></tr> 
     130         </tbody> 
     131        <?cs /if ?> 
     132       <?cs /each ?> 
     133      </table> 
     134     <?cs /if ?> 
     135    </li> 
     136   <?cs /if ?> 
     137  <?cs /each ?> 
     138 </ul> 
     139</div> 
     140 
     141</div> 
     142<?cs include "footer.cs"?> 
  • templates/log.cs

    diff -ruN /opt/trac.bak/templates/log.cs templates/log.cs
    old new  
    2828  </form> 
    2929 </div> 
    3030 
     31<form method="get" action="<?cs var:log.href.anydiff ?>"> 
    3132 <table id="chglist" class="listing"> 
    3233  <thead> 
    3334   <tr> 
    3435    <th class="data">Date</th> 
    3536    <th class="rev">Rev</th> 
    3637    <th class="chgset">Chgset</th> 
     38    <th>A</th> 
     39    <th>B</th> 
    3740    <th class="author">Author</th> 
    3841    <th class="summary">Log Message</th> 
    3942   </tr> 
     
    4851     <td class="chgset"> 
    4952      <a class="block-link" href="<?cs var:item.changeset_href ?>"><?cs var:item.rev ?></a> 
    5053     </td> 
     54     <td><input type="radio" name="a" value="<?cs var:item.rev ?>" /></td> 
     55     <td><input type="radio" name="b" value="<?cs var:item.rev ?>" /></td>      
    5156     <td class="author"><?cs var:item.author ?></td> 
    5257     <td class="summary"><?cs var:item.log ?></td> 
    5358    </tr> 
    5459   <?cs /each ?> 
    5560  </tbody> 
    5661 </table> 
     62 <input type="submit" value="Create Diff between revision A and revision B" /> 
     63</form> 
    5764 
    5865</div> 
    5966<?cs include "footer.cs"?>