~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/templates/revisionfilechanges.pt

  • Committer: Martin Albisetti
  • Date: 2008-06-27 21:01:30 UTC
  • mto: (157.1.3 loggerhead)
  • mto: This revision was merged to the branch mainline in revision 187.
  • Revision ID: argentina@gmail.com-20080627210130-0jrgduoly7qpoh59
 * Convert diff to HTML before sending to the template
 * Separate diff lines every 78 characters with <wbr/> so we can wrap lies
 * Print diff in the template without escaping HTML
 * Change character for non-breakspace

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<tal:block>
2
 
  <ul tal:repeat="added file_changes/added">
 
2
 
 
3
<div tal:repeat="added entry/changes/added">
3
4
    <tal:block condition="repeat/added/start">
4
 
      <li class="desc">files added:</li>
 
5
        <li class="desc">files added:</li>
5
6
    </tal:block>
6
 
    <li class="files">
7
 
      <tal:revision condition="python:added.kind == 'file'"
8
 
                    content="structure python:file_link(added.filename)" />
9
 
      <tal:revision condition="python:added.kind != 'file'"
10
 
                    content="added/filename" />
 
7
    <li class="files"
 
8
        tal:define="filename python:added[0];
 
9
                    file_id  python:added[1]">
 
10
        <a tal:attributes="href  python:url(['/annotate', entry.revno], file_id=file_id);
 
11
                           title string:Annotate ${filename}"
 
12
           tal:content="filename" class="link"></a>
11
13
    </li>
12
 
  </ul>
 
14
</div>
13
15
 
14
 
  <ul tal:repeat="removed file_changes/removed">
 
16
<div tal:repeat="removed entry/changes/removed">
15
17
    <tal:block condition="repeat/removed/start">
16
 
      <li class="desc">files removed:</li>
 
18
        <li class="desc">files removed:</li>
17
19
    </tal:block>
18
 
    <li class="files">
19
 
      <tal:revision condition="python:removed.kind == 'file'"
20
 
                    content="structure python:file_link(removed.filename)" />
21
 
      <tal:revision condition="python:removed.kind != 'file'"
22
 
                    content="removed/filename" />
 
20
    <li class="files"
 
21
        tal:define="filename python:removed[0];
 
22
                    file_id  python:removed[1]">
 
23
      <a tal:attributes="href  python:url(['/annotate', entry.revno], file_id=file_id);
 
24
                         title string:Annotate ${filename}"
 
25
                         tal:content="filename" class="link"></a>
23
26
    </li>
24
 
  </ul>
 
27
</div>
25
28
 
26
 
  <ul tal:repeat="renamed file_changes/renamed">
 
29
<div tal:repeat="renamed entry/changes/renamed">
27
30
    <tal:block condition="repeat/renamed/start">
28
 
      <li class="desc">files renamed:</li>
 
31
        <li class="desc">files renamed:</li>
29
32
    </tal:block>
30
 
    <li class="files">
31
 
      <tal:old-name content="renamed/old_filename" class="filename">
 
33
    <li class="files"
 
34
        tal:define="old_filename python:renamed[0];
 
35
                    new_filename python:renamed[1];
 
36
                    file_id      python:renamed[2]">
 
37
      <a tal:attributes="href  python:url(['/annotate', entry.revno], file_id=file_id);
 
38
                         title string:Annotate ${old_filename}"
 
39
         tal:content="old_filename" class="filename">
32
40
        old_filename
33
 
      </tal:old-name>
34
 
      =&gt;
35
 
      <tal:revision condition="renamed/text_modified" content="structure python:file_link(renamed.new_filename)" />
36
 
      <tal:old-name condition="not:renamed/text_modified" content="renamed/new_filename" class="filename">
 
41
      </a>
 
42
      =>
 
43
      <a tal:attributes="href  python:url(['/annotate', entry.revno], file_id=file_id);
 
44
                         title string:Annotate ${new_filename}"
 
45
         tal:content="new_filename">
37
46
        new_filename
38
 
      </tal:old-name>
 
47
      </a>
39
48
    </li>
40
 
  </ul>
 
49
</div>
41
50
 
42
 
  <ul tal:repeat="item file_changes/modified">
 
51
<div tal:repeat="item entry/changes/modified">
43
52
    <tal:block condition="repeat/item/start">
44
 
      <li class="desc">files modified:</li>
 
53
        <li class="desc">files modified:</li>
45
54
    </tal:block>
46
 
    <li class="files">
47
 
      <tal:revision content="structure python:file_link(item.filename)" />
48
 
    </li>
49
 
  </ul>
 
55
    <tal:b content="structure python:modified_file_link(url, entry, item)" />
 
56
</div>
 
57
 
50
58
</tal:block>