~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/templates/revision.kid

  • Committer: Robey Pointer
  • Date: 2006-12-15 09:20:04 UTC
  • Revision ID: robey@lag.net-20061215092004-q9u5p1aa4xn4893k
figured out how to make my own separate config file like BzrInspect, and
did that.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
    py:extends="'master.kid'">
4
4
<head>
5
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>
 
6
    <title> ${branch_name} : revision ${change.revno} </title>
 
7
    
 
8
    <span py:def="file_link(filename)">
 
9
        <a href="${tg.url([ '/annotate', revid ], path=filename)}" title="Annotate ${filename}">${filename}</a>
 
10
    </span>
35
11
</head>
36
12
 
37
 
<body onload="javascript:load()">
 
13
<body>
38
14
 
39
15
${navbar()}
40
16
 
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>
 
17
<h1> <span class="branch-name">${branch_name}</span> : revision ${change.revno}
 
18
        <div class="links">
 
19
            <div> <b>&#8594;</b> <a href="${tg.url([ '/files', revid ])}">browse files</a> </div>
 
20
            <div> <b>&#8594;</b> <a href="${tg.url('/changes', start_revid=revid)}">view branch changes</a> </div>
 
21
        </div>
73
22
</h1>
74
23
 
75
24
<div class="revision-info">
87
36
            <th class="children"> merged in: </th>
88
37
            <td class="children">
89
38
                <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 /> 
 
39
                    ${revlink_path(child.revid, child.revid, '(' + child.revno + util.if_present(' %s', child.branch_nick) + ')', None)} &nbsp; 
91
40
                </span>
92
41
            </td>
93
42
        </tr>
95
44
                <th class="parents"> merged from: </th>
96
45
                <td class="parents">
97
46
                    <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 />
 
47
                        ${revlink_path(parent.revid, parent.revid, '(' + parent.revno + util.if_present(' %s', parent.branch_nick) + ')', None)} &nbsp;
99
48
                    </span></span>
100
49
                </td>
101
50
        </tr>
109
58
        
110
59
        <tr py:if="change.changes.added">
111
60
            <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>
 
61
            <td class="files"> <span py:for="filename in change.changes.added" class="filename">${file_link(filename)} <br /></span> </td>
113
62
        </tr>
114
63
        <tr py:if="change.changes.removed">
115
64
            <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>
 
65
            <td class="files"> <span py:for="filename in change.changes.removed" class="filename">${file_link(filename)} <br /></span> </td>
119
66
        </tr>
120
67
        <tr py:if="change.changes.renamed">
121
68
            <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>
 
69
            <td class="files"> <span py:for="old_filename, new_filename in change.changes.renamed" class="filename">${file_link(old_filename)} => ${file_link(new_filename)}<br /></span> </td>
125
70
        </tr>
126
71
        <tr py:if="change.changes.modified">
127
72
            <th class="files"> files modified: </th>
128
73
            <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 />
 
74
                <span py:for="item in change.changes.modified">
 
75
                    <span class="filename">${file_link(item.filename)}</span> &nbsp; <a href="#${item.filename}" class="jump">(jump to diff)</a><br />
134
76
                </span>
135
77
            </td>
136
78
        </tr>
137
79
    </table>
138
80
</div>
139
81
 
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
82
<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">
 
83
    <table py:for="item in change.changes.modified" class="diff-block">
 
84
        <tr><th class="filename"> <a href="${tg.url([ '/annotate', change.revid ], path=item.filename)}" name="${item.filename}">${item.filename}</a> </th></tr>
 
85
        <tr><td>
 
86
            <table py:for="chunk in item.chunks" class="diff-chunk">
 
87
                <tr> <th class="lineno">old</th> <th class="lineno">new</th> <th></th> </tr>
 
88
                <tr py:for="line in chunk.diff">
211
89
                    <td class="lineno">${line.old_lineno}</td>
212
90
                    <td class="lineno">${line.new_lineno}</td>
213
 
                    <td class="diff-${line.type} text">${line.line}</td>
214
 
                    <td> </td>
 
91
                    <td class="${line.type} text">${XML(line.line)}</td>
215
92
                </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>
 
93
            </table>
 
94
        </td></tr>
220
95
    </table>
221
 
 
222
96
</div>
223
97
 
224
 
<div py:if="navigation.prev_page_revid or navigation.next_page_revid" class="bar">
 
98
<div class="bar">
225
99
    <table>
226
100
        <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>
 
101
                <td class="buttons">
 
102
                <a py:if="navigation.prev_page_revid" href="${navigation.prev_page_url}"> &lt; revision ${history.get_revno(navigation.prev_page_revid)} </a>
 
103
                        </td>
 
104
                        <td class="rbuttons" align="right">
 
105
                <a py:if="navigation.next_page_revid" href="${navigation.next_page_url}"> revision ${history.get_revno(navigation.next_page_revid)} &gt; </a>
 
106
                        </td>
 
107
                </tr>
 
108
        </table>
235
109
</div>
236
110
 
237
111
</body>