~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/templates/revision.kid

  • Committer: Max Kanat-Alexander
  • Date: 2010-04-22 03:23:55 UTC
  • mto: This revision was merged to the branch mainline in revision 409.
  • Revision ID: mkanat@bugzilla.org-20100422032355-e1i2y6t6n6b8j0qp
Don't put parens around the if condition

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" xmlns:py="http://purl.org/kid/ns#"
3
 
    py:extends="'master.kid'">
4
 
<head>
5
 
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" py:replace="''"/>
6
 
    <title> ${branch.friendly_name} : revision ${change.revno} </title>
7
 
    
8
 
    <span py:strip="True" py:def="file_link(filename, file_id)">
9
 
        <a href="${branch.url([ '/annotate', revid ],
10
 
            **util.get_context(file_id=file_id))}" title="Annotate ${filename}">${filename}</a>
11
 
    </span>
12
 
    <span py:strip="True" py:def="file_link_rev(filename, file_id, revid)">
13
 
        <a href="${branch.url([ '/annotate', revid ],
14
 
            **util.get_context(file_id=file_id))}" title="Annotate ${filename} at revision ${history.get_revno(revid)}">${filename}</a>
15
 
    </span>
16
 
    
17
 
    <span py:replace="use_collapse_buttons()"></span>
18
 
    
19
 
    <script type="text/javascript"> <!--
20
 
    function show_sbs(path) {
21
 
        collapseDisplay('style', 'sbs', 'table');
22
 
        collapseDisplay('style', 'unified', 'none');
23
 
        document.cookie='diff=sbs; path=' + path; 
24
 
    }
25
 
    function show_unified(path) {
26
 
        collapseDisplay('style', 'unified', 'table');
27
 
        collapseDisplay('style', 'sbs', 'none');
28
 
        document.cookie='diff=unified; path=' + path; 
29
 
    }
30
 
    function load(path) {
31
 
        sortCollapseElements();
32
 
        if (document.cookie.indexOf('diff=unified') >= 0) {
33
 
            show_unified(path);
34
 
        }
35
 
        if (document.cookie.indexOf('stop=1') >= 0) {
36
 
            return;
37
 
        }
38
 
        if (document.cookie.indexOf('diff=unified') >= 0) {
39
 
            window.location.hash = window.location.hash;
40
 
            document.cookie='stop=1; max-age=5; path=' + window.location.pathname;
41
 
        } 
42
 
    }
43
 
    // --> </script>
44
 
</head>
45
 
 
46
 
<body onload="javascript:load('${branch.url('/')}')">
47
 
 
48
 
${navbar()}
49
 
 
50
 
<h1> <span class="branch-name">${branch.friendly_name}</span> : revision ${change.revno}
51
 
    <span py:if="compare_revid is not None"> (compared to revision ${history.get_revno(compare_revid)}) </span>
52
 
    
53
 
    <div class="links">
54
 
        <div> <b>&#8594;</b> <a href="${branch.context_url([ '/files', revid ])}">
55
 
            browse files at revision ${change.revno} </a> </div>
56
 
        <div> <b>&#8594;</b> <a href="${branch.context_url('/changes', start_revid=revid)}">
57
 
            view history from revision ${change.revno} </a> </div>
58
 
        <span py:if="compare_revid is not None" py:strip="True">
59
 
            <div> <b>&#8594;</b> <a href="${branch.url([ '/bundle', revid, compare_revid, 'bundle.txt' ])}">
60
 
                download bundle from ${history.get_revno(compare_revid)} to ${change.revno} </a> </div>
61
 
        </span>
62
 
        <span py:if="(remember is not None) and (compare_revid is None) and (revid != remember)" py:strip="True">
63
 
            <div> <b>&#8594;</b> <a href="${branch.context_url([ '/revision', revid ], compare_revid=remember)}">
64
 
                compare with revision ${history.get_revno(remember)} </a></div>
65
 
        </span>
66
 
        <span py:if="remember != revid" py:strip="True">
67
 
            <div> <b>&#8594;</b> <a href="${branch.context_url([ '/revision', revid ], remember=revid, compare_revid=None)}">
68
 
                compare with another revision </a></div>
69
 
        </span>
70
 
        <span py:if="compare_revid is not None" py:strip="True">
71
 
            <div> <b>&#8594;</b> <a href="${branch.context_url([ '/revision', compare_revid ], remember=revid, compare_revid=revid)}">
72
 
                reverse the comparison (${change.revno} to ${history.get_revno(compare_revid)})</a></div>
73
 
            <div> <b>&#8594;</b> <a href="${branch.context_url([ '/revision', revid ], remember=None, compare_revid=None)}">
74
 
                stop comparing with revision ${history.get_revno(compare_revid)} </a></div>
75
 
        </span>
76
 
    </div>
77
 
</h1>
78
 
 
79
 
<div class="revision-info">
80
 
    <table>
81
 
        <tr>
82
 
            <th class="author">committed by:</th>
83
 
            <td class="author"> ${util.hide_email(change.author)} </td>
84
 
        </tr>
85
 
        <tr>
86
 
            <th class="date">date:</th>
87
 
            <td class="date"> ${util.date_time(change.date)} </td>
88
 
        </tr>
89
 
 
90
 
        <tr py:if="len(change.merge_points) > 0">
91
 
            <th class="children"> merged in: </th>
92
 
            <td class="children">
93
 
                <span py:for="child in change.merge_points">
94
 
                    ${revision_link(child.revid, '(' + child.revno + util.if_present(' %s', child.branch_nick) + ')', clear=1, start_revid=child.revid)} <br /> 
95
 
                </span>
96
 
            </td>
97
 
        </tr>
98
 
        <tr py:if="len(change.parents) > 1">
99
 
                <th class="parents"> merged from: </th>
100
 
                <td class="parents">
101
 
                    <span py:for="parent in change.parents"><span py:if="parent.revid != change.parents[0].revid">
102
 
                        ${revision_link(parent.revid, '(' + parent.revno + util.if_present(' %s', parent.branch_nick) + ')', clear=1, start_revid=parent.revid)} <br />
103
 
                    </span></span>
104
 
                </td>
105
 
        </tr>
106
 
 
107
 
        <tr>
108
 
            <th class="description">description:</th>
109
 
            <td class="description"><span py:for="line in change.comment_clean">${XML(line)} <br /></span> </td>
110
 
        </tr>
111
 
        
112
 
        <tr class="divider"> <th></th> <td></td> </tr>
113
 
        
114
 
        <tr py:if="change.changes.added">
115
 
            <th class="files"> files added: </th>
116
 
            <td class="files"> <span py:for="filename, file_id in change.changes.added" class="filename">${file_link(filename, file_id)} <br /></span> </td>
117
 
        </tr>
118
 
        <tr py:if="change.changes.removed">
119
 
            <th class="files"> files removed: </th>
120
 
            <td class="files"> <span py:for="filename, file_id in change.changes.removed" class="filename">
121
 
                ${file_link_rev(filename, file_id, change.parents[0].revid)} <br /></span>
122
 
            </td>
123
 
        </tr>
124
 
        <tr py:if="change.changes.renamed">
125
 
            <th class="files"> files renamed: </th>
126
 
            <td class="files"> <span py:for="old_filename, new_filename, file_id in change.changes.renamed" class="filename">
127
 
                ${file_link(old_filename, file_id)} => ${file_link(new_filename, file_id)}<br />
128
 
            </span> </td>
129
 
        </tr>
130
 
        <tr py:if="change.changes.modified">
131
 
            <th class="files"> files modified: </th>
132
 
            <td class="files">
133
 
              <span py:if="not show_plain_diffs" py:strip="True">
134
 
                <span py:for="item in change.changes.modified" class="collapse-style-sbs-content">
135
 
                    <a href="#${item.filename}-s" class="filename" title="Jump to ${item.filename} below">${item.filename}</a><br />
136
 
                </span>
137
 
                <span py:for="item in change.changes.modified" class="collapse-style-unified-content">
138
 
                    <a href="#${item.filename}-u" class="filename" title="Jump to ${item.filename} below">${item.filename}</a><br />
139
 
                </span>
140
 
              </span>
141
 
              <span py:if="show_plain_diffs" py:strip="True">
142
 
                <span py:for="item in change.changes.modified" py:strip="True">
143
 
                    <a href="#${item.filename}" class="filename" title="Jump to ${item.filename} below">${item.filename}</a><br />
144
 
                </span>
145
 
              </span>
146
 
            </td>
147
 
        </tr>
148
 
    </table>
149
 
</div>
150
 
 
151
 
<div py:if="show_plain_diffs" py:strip="True">
152
 
  Diff of ${line_count} lines is too long to display richly -- limit is ${line_count_limit} lines.
153
 
 
154
 
  <pre class="diff-plain">
155
 
    <span py:strip="True" py:for="item in change.changes.modified">
156
 
      <a name="${item.filename}" />${item.raw_diff}
157
 
    </span>
158
 
  </pre>
159
 
</div>
160
 
 
161
 
<div py:if="change.changes.modified and not show_plain_diffs" py:strip="True">
162
 
 
163
 
<table class="diff-option-buttons">
164
 
<tr>
165
 
    <td> ${collapse_all_button('file', 'table-row')} </td>
166
 
 
167
 
    <td class="spacey">
168
 
        <a href="javascript:show_sbs('${branch.url('/')}')" class="hide-all collapse-style-sbs-show" title="collapse">
169
 
            <img src="${tg.url('/static/images/nav-small-out.gif')}" width="22" height="10" class="collapse-triangle" />show side by side</a>
170
 
        <a href="javascript:show_unified('${branch.url('/')}')" class="hide-all collapse-style-unified-show" title="expand">
171
 
            <img src="${tg.url('/static/images/nav-small-in.gif')}" width="22" height="10" class="collapse-triangle" />show unified diff</a>
172
 
    </td>
173
 
    
174
 
    <td class="diff-key-block diff-insert"></td>
175
 
    <td class="label"> added </td>
176
 
    <td class="diff-key-block diff-delete"></td>
177
 
    <td class="label"> removed</td>
178
 
</tr>
179
 
</table>
180
 
 
181
 
<!-- ! i'm not a big fan of embedding python code here, but the alternatives all seem to be worse -->
182
 
<?python uniqs={}; ?>
183
 
 
184
 
<div class="diff">
185
 
    <!-- ! side-by-side diff -->
186
 
    <table class="diff-block collapse-style-sbs-content">
187
 
        <span py:strip="True" py:for="item in change.changes.modified">
188
 
            <tr><th class="filename" colspan="4">
189
 
                ${collapse_button('file', util.uniq(uniqs, item.file_id), 'table-row')}
190
 
                <a href="${branch.url([ '/annotate', change.revid ], **util.get_context(file_id=item.file_id))}"
191
 
                    name="${item.filename}-s" title="Annotate ${item.filename}">${item.filename}</a>
192
 
            </th></tr>
193
 
 
194
 
            <span py:strip="True" py:for="chunk in item.sbs_chunks">
195
 
                <tr class="diff-chunk collapse-file-${util.uniq(uniqs, item.file_id)}-content">
196
 
                    <th class="lineno">old</th> <th></th> <th class="lineno">new</th> <th></th>
197
 
                </tr>
198
 
                <tr py:for="line in chunk.diff" class="diff-chunk collapse-file-${util.uniq(uniqs, item.file_id)}-content">
199
 
                    <span py:if="line.old_lineno" py:strip="True">
200
 
                        <td class="lineno">${line.old_lineno}</td>
201
 
                        <td class="diff-${line.old_type}">${line.old_line}</td>
202
 
                    </span>
203
 
                    <span py:if="not line.old_lineno" py:strip="True">
204
 
                        <td class="lineno-skip">${line.old_lineno}</td>
205
 
                        <td class="diff-${line.old_type}-skip">${line.old_line}</td>
206
 
                    </span>
207
 
                    <span py:if="line.new_lineno" py:strip="True">
208
 
                        <td py:if="line.new_lineno" class="lineno">${line.new_lineno}</td>
209
 
                        <td class="diff-${line.new_type}">${line.new_line}</td>
210
 
                    </span>
211
 
                    <span py:if="not line.new_lineno" py:strip="True">
212
 
                        <td py:if="not line.new_lineno" class="lineno-skip">${line.new_lineno}</td>
213
 
                        <td class="diff-${line.new_type}-skip">${line.new_line}</td>
214
 
                    </span>
215
 
                </tr>
216
 
                <tr class="diff-chunk-spacing collapse-file-${util.uniq(uniqs, item.file_id)}-content"> <td colspan="4"> &nbsp; </td> </tr>
217
 
            </span>
218
 
            <tr class="diff-spacing"> <td colspan="4"> &nbsp; </td> </tr>
219
 
        </span>
220
 
    </table>
221
 
    
222
 
    <!-- ! unified diff -->
223
 
    <table class="diff-block collapse-style-unified-content">
224
 
        <span py:strip="True" py:for="item in change.changes.modified">
225
 
            <tr><th class="filename" colspan="4">
226
 
                ${collapse_button('file', util.uniq(uniqs, item.file_id), 'table-row')}
227
 
                <a href="${branch.url([ '/annotate', change.revid ], **util.get_context(file_id=item.file_id))}"
228
 
                    name="${item.filename}-u" title="Annotate ${item.filename}">${item.filename}</a>
229
 
            </th></tr>
230
 
 
231
 
            <span py:strip="True" py:for="chunk in item.chunks">
232
 
                <tr class="diff-chunk collapse-file-${util.uniq(uniqs, item.file_id)}-content"> <th class="lineno">old</th> <th class="lineno">new</th> <th></th> <th></th> </tr>
233
 
                <tr py:for="line in chunk.diff" class="diff-chunk collapse-file-${util.uniq(uniqs, item.file_id)}-content">
234
 
                    <td class="lineno">${line.old_lineno}</td>
235
 
                    <td class="lineno">${line.new_lineno}</td>
236
 
                    <td class="diff-${line.type} text">${line.line}</td>
237
 
                    <td> </td>
238
 
                </tr>
239
 
                <tr class="diff-chunk-spacing collapse-file-${util.uniq(uniqs, item.file_id)}-content"> <td colspan="4"> &nbsp; </td> </tr>
240
 
            </span>
241
 
            <tr class="diff-spacing"> <td colspan="4"> &nbsp; </td> </tr>
242
 
        </span>
243
 
    </table>
244
 
 
245
 
</div>
246
 
 
247
 
<div py:if="navigation.prev_page_revid or navigation.next_page_revid" class="bar">
248
 
    <table>
249
 
        <tr>
250
 
        <td class="buttons">
251
 
            <a py:if="navigation.prev_page_revid" href="${navigation.prev_page_url}"> &lt; revision ${history.get_revno(navigation.prev_page_revid)} </a>
252
 
        </td>
253
 
        <td class="rbuttons" align="right">
254
 
            <a py:if="navigation.next_page_revid" href="${navigation.next_page_url}"> revision ${history.get_revno(navigation.next_page_revid)} &gt; </a>
255
 
        </td>
256
 
        </tr>
257
 
    </table>
258
 
</div>
259
 
</div>
260
 
 
261
 
</body>
262
 
</html>