~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/templates/revision.pt

bah css mumble

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
2
<html xmlns="http://www.w3.org/1999/xhtml">
 
3
  <head>
 
4
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
 
5
    <title>
 
6
      <tal:branch-name content="branch/friendly_name">
 
7
        ${branch.friendly_name}
 
8
      </tal:branch-name>
 
9
      : revision
 
10
      <tal:revno content="change/revno">
 
11
        ${change.revno}
 
12
      </tal:revno>
 
13
    </title>
 
14
 
 
15
    <link rel="stylesheet"
 
16
          tal:attributes="href python:tg.url('/static/css/zptstyle.css')" />
 
17
 
 
18
    <script type="text/javascript"
 
19
            tal:attributes="src python:tg.url('/static/javascript/collapse.js')">
 
20
    </script>
 
21
 
 
22
    <script type="text/javascript">
 
23
      <!--
 
24
      function show_sbs() {
 
25
          collapseDisplay('style', 'sbs', 'table');
 
26
          collapseDisplay('style', 'unified', 'none');
 
27
          document.cookie='diff=sbs';
 
28
      }
 
29
      function show_unified() {
 
30
          collapseDisplay('style', 'unified', 'table');
 
31
          collapseDisplay('style', 'sbs', 'none');
 
32
          document.cookie='diff=unified';
 
33
      }
 
34
      function load() {
 
35
          sortCollapseElements();
 
36
          if (document.cookie.indexOf('diff=unified') >= 0) { show_unified(); }
 
37
      }
 
38
      // -->
 
39
    </script>
 
40
  </head>
 
41
 
 
42
  <body onload="javascript:load()">
 
43
 
 
44
    <tal:navigation content="structure here/navigation.pt" />
 
45
 
 
46
    <h1>
 
47
      <span class="branch-name" tal:content="branch/friendly_name">
 
48
        ${branch.friendly_name}
 
49
      </span>
 
50
      : revision
 
51
      <tal:revno content="change/revno">
 
52
        ${change.revno}
 
53
      </tal:revno>
 
54
      <span tal:condition="python:compare_revid is not None">
 
55
        (compared to revision <tal:b replace="python:history.get_revno(compare_revid)" />)
 
56
      </span>
 
57
    </h1>
 
58
 
 
59
    <div class="links">
 
60
      <div>
 
61
        <b>&#8594;</b>
 
62
        <a tal:attributes="href python:url([ '/files', revid ])">
 
63
          browse files
 
64
        </a>
 
65
      </div>
 
66
      <div>
 
67
        <b>&#8594;</b>
 
68
        <a tal:attributes="href python:url(['/changes'], start_revid=revid)">
 
69
          view branch changes
 
70
        </a>
 
71
      </div>
 
72
      <div tal:condition="python:compare_revid is None" >
 
73
        <b>&#8594;</b>
 
74
        <a tal:attributes="href python:url([ '/bundle', revid, 'bundle.txt' ])">
 
75
          view/download patch
 
76
        </a>
 
77
      </div>
 
78
      <div tal:condition="python:compare_revid is not None" >
 
79
        <b>&#8594;</b>
 
80
        <a tal:attributes="href python:url([ '/bundle', revid, compare_revid, 'bundle.txt' ])">
 
81
          view/download patch
 
82
        </a>
 
83
      </div>
 
84
      <div tal:condition="python:(remember is not None) and (compare_revid is None)" >
 
85
        <b>&#8594;</b>
 
86
        <a tal:attributes="href python:url([ '/revision', revid ], compare_revid=remember)">
 
87
          compare with revision ${history.get_revno(remember)}
 
88
        </a>
 
89
      </div>
 
90
      <div  tal:condition="python:remember != revid">
 
91
        <b>&#8594;</b>
 
92
        <a tal:attributes="href python:url([ '/revision', revid ], remember=revid, compare_revid=None)">
 
93
          compare with another revision
 
94
        </a>
 
95
      </div>
 
96
      <div tal:condition="python:compare_revid is not None">
 
97
        <b>&#8594;</b>
 
98
        <a tal:attributes="href python:url([ '/revision', revid ], remember=None, compare_revid=None)">
 
99
          stop comparing to revision ${history.get_revno(compare_revid)}
 
100
        </a>
 
101
      </div>
 
102
    </div>
 
103
 
 
104
    <tal:revision-info replace="structure python:revisioninfo(url, branch, change, modified_file_link_rev)" />
 
105
 
 
106
    <table class="diff-option-buttons">
 
107
      <tr>
 
108
        <td>
 
109
          <tal:b content="structure python:collapse_all_button('file', 'table-row')" />
 
110
        </td>
 
111
 
 
112
        <td class="spacey">
 
113
          <a href="javascript:show_sbs()"
 
114
             class="hide-all collapse-style-sbs-show"
 
115
             title="collapse">
 
116
            <img tal:attributes="src python:tg.url('/static/images/nav-small-out.gif')"
 
117
                 width="22" height="10" class="collapse-triangle" />
 
118
            show side by side
 
119
          </a>
 
120
          <a href="javascript:show_unified()"
 
121
             class="hide-all collapse-style-unified-show"
 
122
             title="expand">
 
123
            <img tal:attributes="src python:tg.url('/static/images/nav-small-in.gif')"
 
124
                 width="22" height="10" class="collapse-triangle" />
 
125
            show unified diff
 
126
          </a>
 
127
        </td>
 
128
 
 
129
        <td class="diff-key-block diff-insert">
 
130
        </td>
 
131
        <td class="label">
 
132
          added
 
133
        </td>
 
134
        <td class="diff-key-block diff-delete">
 
135
        </td>
 
136
        <td class="label">
 
137
          removed
 
138
        </td>
 
139
      </tr>
 
140
    </table>
 
141
 
 
142
    <div class="diff"
 
143
         tal:condition="change/changes/modified"
 
144
         tal:define="uniqs python:{}">
 
145
      <!-- ! side-by-side diff -->
 
146
      <table class="diff-block collapse-style-sbs-content">
 
147
        <tal:block repeat="item change/changes/modified">
 
148
          <tal:u define="u python:util.uniq(uniqs, item.file_id)">
 
149
            <tr>
 
150
              <th class="filename" colspan="4">
 
151
                <tal:b content="structure python:collapse_button('file', u, 'table-row')" />
 
152
                <a tal:attributes="href  python:url(['/annotate', change.revid], file_id=item.file_id);
 
153
                                   name  string:${item/filename}-s;
 
154
                                   title string:Annotate ${item/filename}"
 
155
                   tal:content="item/filename">
 
156
                  ${item.filename}
 
157
                </a>
 
158
              </th>
 
159
            </tr>
 
160
 
 
161
            <tal:block repeat="chunk item/sbs_chunks">
 
162
              <tr tal:attributes="class string:diff-chunk collapse-file-${u}-content">
 
163
                <th class="lineno">
 
164
                  old
 
165
                </th>
 
166
                <th>
 
167
                </th>
 
168
                <th class="lineno">
 
169
                  new
 
170
                </th>
 
171
                <th>
 
172
                </th>
 
173
              </tr>
 
174
              <tr tal:repeat="line chunk/diff"
 
175
                  tal:attributes="class string:diff-chunk collapse-file-${u}-content">
 
176
                <tal:block condition="line/old_lineno">
 
177
                  <td class="lineno"
 
178
                      tal:content="line/old_lineno">
 
179
                    ${line.old_lineno}
 
180
                  </td>
 
181
                  <td tal:attributes="class string:diff-${line/old_type}"
 
182
                      tal:content="line/old_line">
 
183
                    ${line.old_line}
 
184
                  </td>
 
185
                </tal:block>
 
186
                <tal:block condition="not:line/old_lineno">
 
187
                  <td class="lineno-skip"
 
188
                      tal:content="line/old_lineno">
 
189
                    ${line.old_lineno}
 
190
                  </td>
 
191
                  <td tal:attributes="class string:diff-${line/old_type}-skip"
 
192
                      tal:content="line/old_line">
 
193
                    ${line.old_line}
 
194
                  </td>
 
195
                </tal:block>
 
196
                <tal:block condition="line/new_lineno">
 
197
                  <td class="lineno"
 
198
                      tal:content="line/new_lineno">
 
199
                    ${line.new_lineno}
 
200
                  </td>
 
201
                  <td tal:attributes="class string:diff-${line/new_type}"
 
202
                      tal:content="line/new_line">
 
203
                    ${line.new_line}
 
204
                  </td>
 
205
                </tal:block>
 
206
                <tal:block condition="not:line/new_lineno">
 
207
                  <td class="lineno-skip"
 
208
                      tal:content="line/new_lineno">
 
209
                    ${line.new_lineno}
 
210
                  </td>
 
211
                  <td tal:attributes="class string:diff-${line/new_type}-skip"
 
212
                      tal:content="line/new_line">
 
213
                    ${line.new_line}
 
214
                  </td>
 
215
                </tal:block>
 
216
              </tr>
 
217
              <tr tal:attributes="class string:diff-chunk-spacing collapse-file-${u}-content">
 
218
                <td colspan="4">
 
219
                  &nbsp;
 
220
                </td>
 
221
              </tr>
 
222
            </tal:block>
 
223
            <tr class="diff-spacing">
 
224
              <td colspan="4">
 
225
                &nbsp;
 
226
              </td>
 
227
            </tr>
 
228
          </tal:u>
 
229
        </tal:block>
 
230
      </table>
 
231
 
 
232
      <!-- ! unified diff -->
 
233
      <table class="diff-block collapse-style-unified-content">
 
234
        <tal:block repeat="item change/changes/modified">
 
235
          <tal:u define="u python:util.uniq(uniqs, item.file_id)">
 
236
            <tr>
 
237
              <th class="filename" colspan="4">
 
238
                <tal:b content="structure python:collapse_button('file', u, 'table-row')" />
 
239
                <a tal:attributes="href  python:url(['/annotate', change.revid], file_id=item.file_id);
 
240
                                   name  string:${item/filename}-u;
 
241
                                   title string:Annotate ${item/filename}"
 
242
                   tal:content="item/filename">
 
243
                  ${item.filename}
 
244
                </a>
 
245
              </th>
 
246
            </tr>
 
247
 
 
248
            <tal:block repeat="chunk item/chunks">
 
249
              <tr tal:attributes="class string:diff-chunk collapse-file-${u}-content">
 
250
                <th class="lineno">
 
251
                  old
 
252
                </th>
 
253
                <th class="lineno">
 
254
                  new
 
255
                </th>
 
256
                <th>
 
257
                </th>
 
258
                <th>
 
259
                </th>
 
260
              </tr>
 
261
              <tr tal:repeat="line chunk/diff"
 
262
                  tal:attributes="class string:diff-chunk collapse-file-${u}-content">
 
263
                <td class="lineno"
 
264
                    tal:content="line/old_lineno">
 
265
                  ${line.old_lineno}
 
266
                </td>
 
267
                <td class="lineno"
 
268
                    tal:content="line/new_lineno">
 
269
                  ${line.new_lineno}
 
270
                </td>
 
271
                <td tal:attributes="class string:diff-${line/type} text"
 
272
                    tal:content="line/line">
 
273
                  ${line.line}
 
274
                </td>
 
275
                <td>
 
276
                </td>
 
277
              </tr>
 
278
              <tr tal:attributes="class string:diff-chunk-spacing collapse-file-${u}-content">
 
279
                <td colspan="4">
 
280
                  &nbsp;
 
281
                </td>
 
282
              </tr>
 
283
            </tal:block>
 
284
            <tr class="diff-spacing">
 
285
              <td colspan="4">
 
286
                &nbsp;
 
287
              </td>
 
288
            </tr>
 
289
          </tal:u>
 
290
        </tal:block>
 
291
      </table>
 
292
    </div>
 
293
 
 
294
    <div tal:condition="python:navigation.prev_page_revid or navigation.next_page_revid"
 
295
         class="bar">
 
296
      <table>
 
297
        <tr>
 
298
          <td class="buttons">
 
299
            <a tal:condition="navigation/prev_page_revid"
 
300
               tal:attributes="href navigation/prev_page_url">
 
301
              &lt; revision
 
302
              <tal:r content="python:history.get_revno(navigation.prev_page_revid)" />
 
303
            </a>
 
304
          </td>
 
305
          <td class="rbuttons" align="right">
 
306
            <a tal:condition="navigation/next_page_revid"
 
307
               tal:attributes="href navigation/next_page_url">
 
308
              revision
 
309
              <tal:r content="python:history.get_revno(navigation.next_page_revid)" />
 
310
              &gt;
 
311
            </a>
 
312
          </td>
 
313
        </tr>
 
314
      </table>
 
315
    </div>
 
316
 
 
317
    <tal:footer content="structure here/footer.pt" />
 
318
 
 
319
  </body>
 
320
</html>