~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/templates/revision.pt

  • Committer: Martin Albisetti
  • Date: 2008-07-26 17:41:49 UTC
  • mfrom: (183.2.1 copyright)
  • Revision ID: argentina@gmail.com-20080726174149-o64p6v3p3301km91
 * Clarify License and add copyright to all file headers (John Arbash Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
    <head>
5
5
      <title metal:fill-slot="title"
6
6
             tal:content="string:${branch/friendly_name} : revision ${change/revno}">
 
7
        ${branch.friendly_name} : revision ${change.revno}
7
8
      </title>
8
9
 
9
10
      <metal:block fill-slot="header_extras">
10
 
        <link rel="stylesheet" type="text/css" media="all"
11
 
              tal:attributes="href python:branch.static_url('/static/css/diff.css')"/>
12
11
        <script type="text/javascript"
13
 
                tal:attributes="src python:branch.static_url('/static/javascript/diff.js')"></script>
14
 
        <script type="text/javascript">
15
 
          var link_data = <tal:b content="link_data" />;
16
 
          var specific_path = <tal:b content="json_specific_path" />;
17
 
          var path_to_id = <tal:b content="path_to_id" />;
 
12
                tal:attributes="src python:branch.static_url('/static/javascript/collapse.js')">
18
13
        </script>
19
14
      </metal:block>
20
15
    </head>
21
16
 
22
17
    <body>
23
 
      <tal:block metal:fill-slot="heading">
24
 
        <h1>
25
 
          <tal:has-link condition="branch/branch_link">
26
 
            <a tal:attributes="href branch/branch_link"
27
 
               tal:content="branch/friendly_name">
28
 
              nice/branch/name
29
 
            </a>
30
 
          </tal:has-link>
31
 
          <tal:no-link condition="not: branch/branch_link">
32
 
            <span metal:use-macro="breadcrumbs/directory"></span>
33
 
          </tal:no-link>
34
 
          <span class="breadcrumb">:
35
 
            <tal:revno condition="not:specific_path" content="change/revno"></tal:revno>
36
 
            <a tal:condition="specific_path" tal:content="change/revno"
37
 
               tal:attributes="href python:url(['/revision', change.revno])"
38
 
               title="View changes to all files"></a>
39
 
                      <tal:compare-to condition="python:compare_revid is not None">
40
 
              (compared to revision <tal:block content="python:history.get_revno(compare_revid)" />)
41
 
            </tal:compare-to>
42
 
          </span>
43
 
          <span class="breadcrumb" tal:condition="specific_path">
44
 
            : <tal:annotate content="structure python:view_link(url, change.revno, specific_path)" />
45
 
          </span>
46
 
        </h1>
47
 
        <tal:branch-info replace="structure python:branchinfo(branch)" />
48
 
        <p tal:condition="not:specific_path">
49
 
          Viewing all changes in revision <tal:revno content="change/revno" />.
50
 
        </p>
51
 
        <p tal:condition="specific_path">
52
 
          <a tal:attributes="href python:url(['/revision', change.revno])">
53
 
            &#xAB; back to all changes in this revision
54
 
          </a>
55
 
        </p>
56
 
        <p tal:condition="specific_path">
57
 
          Viewing changes to <tal:annotate content="structure python:view_link(url, change.revno, specific_path)" />
58
 
        </p>
59
 
        <ul id="submenuTabs">
60
 
          <li id="first"><a tal:attributes="href python:url(['/files', change.revno]);
61
 
                                            title string:browse files at revision ${change/revno}"
62
 
                            tal:content="string:browse files at revision ${change/revno}"></a></li>
63
 
          <li tal:condition="python:remember != change.revno">
64
 
            <a tal:attributes="href python:url(['/revision', change.revno], remember=change.revno, compare_revid=None);
65
 
                               title string:compare with another revision"
66
 
               tal:content="string:Compare with another revision"></a></li>
67
 
          <li tal:condition="python:(remember is not None) and (compare_revid is None) and (change.revno != remember)" >
 
18
 
 
19
      <h1 metal:fill-slot="heading">
 
20
        <span class="branch-name" tal:content="branch/friendly_name">
 
21
          ${branch.friendly_name}
 
22
        </span>
 
23
        : revision
 
24
        <tal:revno content="change/revno">
 
25
          ${change.revno}
 
26
        </tal:revno>
 
27
        <tal:compare-to condition="python:compare_revid is not None">
 
28
          (compared to revision <tal:b content="python:history.get_revno(compare_revid)" />)
 
29
        </tal:compare-to>
 
30
      </h1>
 
31
 
 
32
      <div metal:fill-slot="content">
 
33
        <div class="links">
 
34
          <div>
 
35
            <b>&#8594;</b>
 
36
            <a tal:attributes="href python:url(['/files', change.revno])">
 
37
              browse files at revision <tal:b content="change/revno" />
 
38
            </a>
 
39
          </div>
 
40
          <div>
 
41
            <b>&#8594;</b>
 
42
            <a tal:attributes="href python:url(['/changes'], start_revid=change.revno)">
 
43
              view history from revision <tal:b content="change/revno" />
 
44
            </a>
 
45
          </div>
 
46
          <div tal:condition="python:(remember is not None) and (compare_revid is None) and remember != revid" >
 
47
            <b>&#8594;</b>
68
48
            <a tal:attributes="href python:url(['/revision', change.revno], compare_revid=history.get_revno(remember))">
69
49
              compare with revision <tal:b content="python:history.get_revno(remember)" />
70
50
            </a>
71
 
          </li>
72
 
          <li>
73
 
            <a tal:condition="python:len(change.parents) > 0 and compare_revid is None"
74
 
               tal:attributes="href python:url(['/diff', change.revno], clear=1)">download diff</a>
75
 
            <a tal:condition="python:compare_revid is not None"
76
 
               tal:attributes="href python:url(['/diff', change.revno, history.get_revno(compare_revid)], clear=1)">download diff</a>
77
 
          </li>
78
 
          <li id="last"><a tal:attributes="href python:url(['/changes', change.revno]);
79
 
                                           title string:view history from revision ${change/revno}"
80
 
                           tal:content="string:view history from revision ${change/revno}"></a></li>
81
 
        </ul>
82
 
 
83
 
        <tal:we-are-comparing condition="python:compare_revid is not None">
84
 
          <ul id="submenuTabs">
85
 
            <li id="first">
 
51
          </div>
 
52
          <div  tal:condition="python:remember != revid">
 
53
            <b>&#8594;</b>
 
54
            <a tal:attributes="href python:url(['/revision', change.revno], remember=change.revno, compare_revid=None)">
 
55
              compare with another revision
 
56
            </a>
 
57
          </div>
 
58
          <tal:we-are-comparing condition="python:compare_revid is not None">
 
59
            <div>
 
60
              <b>&#8594;</b>
86
61
              <a tal:attributes="href python:url([ '/revision', history.get_revno(compare_revid) ], remember=change.revno, compare_revid=change.revno)">
87
62
                reverse the comparison (<tal:b content="change/revno" /> to <tal:b content="python:history.get_revno(compare_revid)" />)
88
63
              </a>
89
 
            </li>
90
 
            <li id="last">
 
64
            </div>
 
65
            <div>
 
66
              <b>&#8594;</b>
91
67
              <a tal:attributes="href python:url(['/revision', change.revno], remember=None, compare_revid=None)">
92
68
                stop comparing with revision <tal:b content="python:history.get_revno(compare_revid)" />
93
69
              </a>
94
 
            </li>
95
 
          </ul>
96
 
        </tal:we-are-comparing>
97
 
 
98
 
        <tal:revision-info replace="structure python:revisioninfo(url, branch, change, file_changes, specific_path, merged_in)" />
99
 
        <tal:specific-path condition="not:specific_path">
100
 
          <p class="expand show_if_js" id="expand_all"><a href="#">
101
 
              <img tal:attributes="src python:branch.static_url('/static/images/treeCollapsed.png')"
102
 
                   alt="expand all" /> expand all</a>
103
 
          </p>
104
 
          <p class="expand" id="collapse_all" style="display:none;"><a href="#">
105
 
              <img tal:attributes="src python:branch.static_url('/static/images/treeExpanded.png')"
106
 
                   alt="collapse all" /> collapse all</a>
107
 
          </p>
108
 
        </tal:specific-path>
109
 
        <!-- Table -->
110
 
        <p class="expand show_if_js"><a id="toggle_unified_sbs" href="#">Show diffs side-by-side</a></p>
111
 
        <p class="codin"><img tal:attributes="src python:branch.static_url('/static/images/newCode.gif')" alt="added" /> added</p>
112
 
        <p class="codin"><img tal:attributes="src python:branch.static_url('/static/images/deleteCode.gif')" alt="removed" /> removed</p>
113
 
        <div class="clear"><!-- --></div>
114
 
 
115
 
      </tal:block>
116
 
 
117
 
      <div metal:fill-slot="content">
118
 
        <tal:block condition="specific_path">
119
 
          <div class="diff">
120
 
 
121
 
            <div  class="diffBox">
122
 
              <a tal:attributes="href python:url(['/revision', change.revno, specific_path], clear=1);
123
 
                                 id string:${specific_path};
124
 
                                 title string:View changes to ${specific_path} only"
125
 
                 class="the-link">
126
 
                <img tal:attributes="src python:branch.static_url('/static/images/treeExpanded.png')"
127
 
                     class="expand_diff"/>
128
 
                <tal:b content="specific_path" />
129
 
              </a>
130
 
            </div>
131
 
            <div style="overflow: hidden">
132
 
              <div class="container">
133
 
                <div class="loading" style="display:none">
134
 
                  <img tal:attributes="src python:branch.static_url('/static/images/spinner.gif')" />
135
 
                </div>
136
 
                <div class="diffinfo">
137
 
                  <div class="pseudotable unified"
138
 
                       tal:repeat="chunk diff_chunks">
139
 
 
140
 
                    <tal:block condition="not:repeat/chunk/start">
141
 
                      <div class="pseudorow context-row">
142
 
                        <div class="lineNumber separate"></div>
143
 
                        <div class="lineNumber second separate"></div>
144
 
                        <div class="code separate"></div>
145
 
                        <div class="clear"><!-- --></div>
146
 
                      </div>
147
 
                    </tal:block>
148
 
 
149
 
                    <div tal:repeat="line chunk/diff"
150
 
                         tal:attributes="class string:pseudorow ${line/type}-row">
151
 
                      <div class="lineNumber first"
152
 
                           tal:content="structure python:util.fill_div(line.old_lineno)"></div>
153
 
                      <div class="lineNumber second"
154
 
                           tal:content="structure python:util.fill_div(line.new_lineno)"></div>
155
 
                      <div tal:attributes="class string:code ${line/type}"
156
 
                           tal:content="structure python:util.fill_div(util.html_clean(line.line))"></div>
157
 
                      <div class="clear"><!-- --></div>
158
 
                    </div>
159
 
                  </div>
160
 
                </div>
161
 
              </div>
162
 
            </div>
163
 
          </div>
164
 
        </tal:block>
165
 
 
166
 
        <tal:block condition="not:specific_path">
167
 
          <div class="diff"
168
 
               tal:repeat="item file_changes/text_changes" tal:attributes="id string:diff-${item/index}">
169
 
 
170
 
            <div  class="diffBox">
171
 
              <a tal:attributes="href python:url(['/revision', change.revno, item.filename], clear=1);
172
 
                                 id string:${item/filename};
173
 
                                 title string:View changes to ${item/filename} only"
174
 
                 class="the-link">
175
 
                <img tal:attributes="src python:branch.static_url('/static/images/treeCollapsed.png')"
176
 
                     class="expand_diff" />
177
 
                <tal:b content="item/filename" />
178
 
              </a>
179
 
            </div>
180
 
            <div class="diffinfo"  style="display:none">
181
 
              <div class="loading">
182
 
                <img tal:attributes="src python:branch.static_url('/static/images/spinner.gif')" />
183
 
              </div>
184
 
            </div>
185
 
          </div>
186
 
        </tal:block>
187
 
 
188
 
        <ul tal:condition="python:navigation.prev_page_revid or navigation.next_page_revid"
189
 
            id="pages">
190
 
          <li tal:condition="navigation/prev_page_revid"
191
 
              class="previous">
192
 
            <a tal:attributes="href navigation/prev_page_url">&laquo; Newer</a>
193
 
          </li>
194
 
          <!-- FIXME: Leaving this to eventually show page numbers. Can't show all of them,
195
 
               so some magic has to be done to just show the previous and next N page numbers
196
 
 
197
 
               <li class="active">1</li>
198
 
               <tal:block tal:repeat="page_number python:range(navigation.page_count)">
199
 
                 <li><a href="#"
200
 
                        tal:content="page_number"></a></li>
201
 
               </tal:block>-->
202
 
          <li tal:condition="navigation/next_page_revid"
203
 
              class="next">
204
 
            <a tal:attributes="href navigation/next_page_url">Older &raquo;</a>
205
 
          </li>
206
 
        </ul>
207
 
 
 
70
            </div>
 
71
          </tal:we-are-comparing>
 
72
        </div>
 
73
 
 
74
        <tal:revision-info replace="structure python:revisioninfo(url, branch, change, modified_file_link_rev)" />
 
75
 
 
76
        <table class="diff-option-buttons">
 
77
          <tr>
 
78
            <td>
 
79
              <tal:b content="structure python:collapse_all_button('file', branch, normal='table-row')" />
 
80
            </td>
 
81
 
 
82
            <td class="spacey">
 
83
              <a href="javascript:show_sbs()"
 
84
                 class="hide-all collapse-style-sbs-show"
 
85
                 title="collapse">
 
86
                <img tal:attributes="src python:branch.static_url('/static/images/nav-small-out.gif')"
 
87
                     width="22" height="10" class="collapse-triangle" />
 
88
                show side by side
 
89
              </a>
 
90
              <a href="javascript:show_unified()"
 
91
                 class="hide-all collapse-style-unified-show"
 
92
                 title="expand">
 
93
                <img tal:attributes="src python:branch.static_url('/static/images/nav-small-in.gif')"
 
94
                     width="22" height="10" class="collapse-triangle" />
 
95
                show unified diff
 
96
              </a>
 
97
            </td>
 
98
 
 
99
            <td class="diff-key-block diff-insert">
 
100
            </td>
 
101
            <td class="label">
 
102
              added
 
103
            </td>
 
104
            <td class="diff-key-block diff-delete">
 
105
            </td>
 
106
            <td class="label">
 
107
              removed
 
108
            </td>
 
109
          </tr>
 
110
        </table>
 
111
 
 
112
        <div class="diff"
 
113
             tal:condition="change/changes/modified"
 
114
             tal:define="uniqs python:{}">
 
115
          <!-- ! side-by-side diff -->
 
116
          <table class="diff-block collapse-style-sbs-content">
 
117
            <tal:block repeat="item change/changes/modified">
 
118
              <tal:u define="u python:util.uniq(uniqs, item.file_id)">
 
119
                <tr>
 
120
                  <th class="filename" colspan="4">
 
121
                    <tal:b content="structure python:collapse_button('file', u, branch, normal='table-row')" />
 
122
                    <a tal:attributes="href  python:url(['/annotate', change.revno], file_id=item.file_id);
 
123
                                       name  string:${item/filename}-s;
 
124
                                       title string:Annotate ${item/filename}"
 
125
                       tal:content="item/filename">
 
126
                      ${item.filename}
 
127
                    </a>
 
128
                  </th>
 
129
                </tr>
 
130
 
 
131
                <tal:block repeat="chunk item/sbs_chunks">
 
132
                  <tr tal:attributes="class string:diff-chunk collapse-file-${u}-content">
 
133
                    <th class="lineno">
 
134
                      old
 
135
                    </th>
 
136
                    <th>
 
137
                    </th>
 
138
                    <th class="lineno">
 
139
                      new
 
140
                    </th>
 
141
                    <th>
 
142
                    </th>
 
143
                  </tr>
 
144
                  <tr tal:repeat="line chunk/diff"
 
145
                      tal:attributes="class string:diff-chunk collapse-file-${u}-content">
 
146
                    <tal:block condition="line/old_lineno">
 
147
                      <td class="lineno"
 
148
                          tal:content="line/old_lineno">
 
149
                        ${line.old_lineno}
 
150
                      </td>
 
151
                      <td tal:attributes="class string:diff-${line/old_type}"
 
152
                          tal:content="line/old_line">
 
153
                        ${line.old_line}
 
154
                      </td>
 
155
                    </tal:block>
 
156
                    <tal:block condition="not:line/old_lineno">
 
157
                      <td class="lineno-skip"
 
158
                          tal:content="line/old_lineno">
 
159
                        ${line.old_lineno}
 
160
                      </td>
 
161
                      <td tal:attributes="class string:diff-${line/old_type}-skip"
 
162
                          tal:content="line/old_line">
 
163
                        ${line.old_line}
 
164
                      </td>
 
165
                    </tal:block>
 
166
                    <tal:block condition="line/new_lineno">
 
167
                      <td class="lineno"
 
168
                          tal:content="line/new_lineno">
 
169
                        ${line.new_lineno}
 
170
                      </td>
 
171
                      <td tal:attributes="class string:diff-${line/new_type}"
 
172
                          tal:content="line/new_line">
 
173
                        ${line.new_line}
 
174
                      </td>
 
175
                    </tal:block>
 
176
                    <tal:block condition="not:line/new_lineno">
 
177
                      <td class="lineno-skip"
 
178
                          tal:content="line/new_lineno">
 
179
                        ${line.new_lineno}
 
180
                      </td>
 
181
                      <td tal:attributes="class string:diff-${line/new_type}-skip"
 
182
                          tal:content="line/new_line">
 
183
                        ${line.new_line}
 
184
                      </td>
 
185
                    </tal:block>
 
186
                  </tr>
 
187
                  <tr tal:attributes="class string:diff-chunk-spacing collapse-file-${u}-content">
 
188
                    <td colspan="4">
 
189
                      &nbsp;
 
190
                    </td>
 
191
                  </tr>
 
192
                </tal:block>
 
193
                <tr class="diff-spacing">
 
194
                  <td colspan="4">
 
195
                    &nbsp;
 
196
                  </td>
 
197
                </tr>
 
198
              </tal:u>
 
199
            </tal:block>
 
200
          </table>
 
201
 
 
202
          <!-- ! unified diff -->
 
203
          <table class="diff-block collapse-style-unified-content">
 
204
            <tal:block repeat="item change/changes/modified">
 
205
              <tal:u define="u python:util.uniq(uniqs, item.file_id)">
 
206
                <tr>
 
207
                  <th class="filename" colspan="4">
 
208
                    <tal:b content="structure python:collapse_button('file', u, branch, normal='table-row')" />
 
209
                    <a tal:attributes="href  python:url(['/annotate', change.revno], file_id=item.file_id);
 
210
                                       name  string:${item/filename}-u;
 
211
                                       title string:Annotate ${item/filename}"
 
212
                       tal:content="item/filename">
 
213
                      ${item.filename}
 
214
                    </a>
 
215
                  </th>
 
216
                </tr>
 
217
 
 
218
                <tal:block repeat="chunk item/chunks">
 
219
                  <tr tal:attributes="class string:diff-chunk collapse-file-${u}-content">
 
220
                    <th class="lineno">
 
221
                      old
 
222
                    </th>
 
223
                    <th class="lineno">
 
224
                      new
 
225
                    </th>
 
226
                    <th>
 
227
                    </th>
 
228
                    <th>
 
229
                    </th>
 
230
                  </tr>
 
231
                  <tr tal:repeat="line chunk/diff"
 
232
                      tal:attributes="class string:diff-chunk collapse-file-${u}-content">
 
233
                    <td class="lineno"
 
234
                        tal:content="line/old_lineno">
 
235
                      ${line.old_lineno}
 
236
                    </td>
 
237
                    <td class="lineno"
 
238
                        tal:content="line/new_lineno">
 
239
                      ${line.new_lineno}
 
240
                    </td>
 
241
                    <td tal:attributes="class string:diff-${line/type} text"
 
242
                        tal:content="line/line">
 
243
                      ${line.line}
 
244
                    </td>
 
245
                    <td>
 
246
                    </td>
 
247
                  </tr>
 
248
                  <tr tal:attributes="class string:diff-chunk-spacing collapse-file-${u}-content">
 
249
                    <td colspan="4">
 
250
                      &nbsp;
 
251
                    </td>
 
252
                  </tr>
 
253
                </tal:block>
 
254
                <tr class="diff-spacing">
 
255
                  <td colspan="4">
 
256
                    &nbsp;
 
257
                  </td>
 
258
                </tr>
 
259
              </tal:u>
 
260
            </tal:block>
 
261
          </table>
 
262
        </div>
 
263
 
 
264
        <div tal:condition="python:navigation.prev_page_revid or navigation.next_page_revid"
 
265
             class="bar">
 
266
          <table>
 
267
            <tr>
 
268
              <td class="buttons">
 
269
                <a tal:condition="navigation/prev_page_revid"
 
270
                   tal:attributes="href navigation/prev_page_url">
 
271
                  &lt; revision
 
272
                  <tal:r content="python:history.get_revno(navigation.prev_page_revid)" />
 
273
                </a>
 
274
              </td>
 
275
              <td class="rbuttons" align="right">
 
276
                <a tal:condition="navigation/next_page_revid"
 
277
                   tal:attributes="href navigation/next_page_url">
 
278
                  revision
 
279
                  <tal:r content="python:history.get_revno(navigation.next_page_revid)" />
 
280
                  &gt;
 
281
                </a>
 
282
              </td>
 
283
            </tr>
 
284
          </table>
 
285
        </div>
208
286
      </div>
209
287
    </body>
210
288
  </html>