~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/templates/revision.kid

Support serving /robots.txt when using apps.transport (serve-branches or bzr serve --http)

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