~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/templates/revision.kid

[r=spiv] [!log] prevent turbogears/cherrypy from turning url query arguments into unicode strings.  fixes bug 175228 ("view revision = 500 Internal error").

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
        <a href="${branch.url([ '/annotate', revid ],
10
10
            **util.get_context(file_id=file_id))}" title="Annotate ${filename}">${filename}</a>
11
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>
12
16
    
13
17
    <span py:replace="use_collapse_buttons()"></span>
14
18
    
15
19
    <script type="text/javascript"> <!--
16
 
    function show_sbs() {
 
20
    function show_sbs(path) {
17
21
        collapseDisplay('style', 'sbs', 'table');
18
22
        collapseDisplay('style', 'unified', 'none');
19
 
        document.cookie='diff=sbs';
 
23
        document.cookie='diff=sbs; path=' + path; 
20
24
    }
21
 
    function show_unified() {
 
25
    function show_unified(path) {
22
26
        collapseDisplay('style', 'unified', 'table');
23
27
        collapseDisplay('style', 'sbs', 'none');
24
 
        document.cookie='diff=unified'; 
 
28
        document.cookie='diff=unified; path=' + path; 
25
29
    }
26
 
    function load() {
 
30
    function load(path) {
27
31
        sortCollapseElements();
28
 
        if (document.cookie.indexOf('diff=unified') >= 0) { show_unified(); }
 
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
        } 
29
42
    }
30
43
    // --> </script>
31
44
</head>
32
45
 
33
 
<body onload="javascript:load()">
 
46
<body onload="javascript:load('${branch.url('/')}')">
34
47
 
35
48
${navbar()}
36
49
 
38
51
    <span py:if="compare_revid is not None"> (compared to revision ${history.get_revno(compare_revid)}) </span>
39
52
    
40
53
    <div class="links">
41
 
        <div> <b>&#8594;</b> <a href="${branch.url([ '/files', revid ], **util.get_context())}">
42
 
            browse files</a> </div>
43
 
        <div> <b>&#8594;</b> <a href="${branch.url('/changes', **util.get_context(start_revid=revid))}">
44
 
            view branch changes</a> </div>
45
 
        <span py:if="compare_revid is None" py:strip="True">
46
 
            <div> <b>&#8594;</b> <a href="${branch.url([ '/bundle', revid, 'bundle.txt' ])}">
47
 
                view/download patch</a> </div>
48
 
        </span>
 
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>
49
58
        <span py:if="compare_revid is not None" py:strip="True">
50
59
            <div> <b>&#8594;</b> <a href="${branch.url([ '/bundle', revid, compare_revid, 'bundle.txt' ])}">
51
 
                view/download patch</a> </div>
 
60
                download bundle from ${history.get_revno(compare_revid)} to ${change.revno} </a> </div>
52
61
        </span>
53
 
        <span py:if="(remember is not None) and (compare_revid is None)" py:strip="True">
54
 
            <div> <b>&#8594;</b> <a href="${branch.url([ '/revision', revid ],
55
 
                **util.get_context(compare_revid=remember))}">
 
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)}">
56
64
                compare with revision ${history.get_revno(remember)} </a></div>
57
65
        </span>
58
66
        <span py:if="remember != revid" py:strip="True">
59
 
            <div> <b>&#8594;</b> <a href="${branch.url([ '/revision', revid ],
60
 
                **util.get_context(remember=revid, compare_revid=None))}">
 
67
            <div> <b>&#8594;</b> <a href="${branch.context_url([ '/revision', revid ], remember=revid, compare_revid=None)}">
61
68
                compare with another revision </a></div>
62
69
        </span>
63
70
        <span py:if="compare_revid is not None" py:strip="True">
64
 
            <div> <b>&#8594;</b> <a href="${branch.url([ '/revision', revid ],
65
 
                **util.get_context(remember=None, compare_revid=None))}">
66
 
                stop comparing to revision ${history.get_revno(compare_revid)} </a></div>
 
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>
67
75
        </span>
68
76
    </div>
69
77
</h1>
76
84
        </tr>
77
85
        <tr>
78
86
            <th class="date">date:</th>
79
 
            <td class="date"> ${change.date.strftime('%d %b %Y %H:%M')} </td>
 
87
            <td class="date"> ${util.format_date(change.date)} </td>
80
88
        </tr>
81
89
 
82
90
        <tr py:if="len(change.merge_points) > 0">
109
117
        </tr>
110
118
        <tr py:if="change.changes.removed">
111
119
            <th class="files"> files removed: </th>
112
 
            <td class="files"> <span py:for="filename, file_id in change.changes.removed" class="filename">${file_link(filename, file_id)} <br /></span> </td>
 
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>
113
123
        </tr>
114
124
        <tr py:if="change.changes.renamed">
115
125
            <th class="files"> files renamed: </th>
120
130
        <tr py:if="change.changes.modified">
121
131
            <th class="files"> files modified: </th>
122
132
            <td class="files">
123
 
                <span py:for="item in change.changes.modified">
124
 
                    <span class="filename">${file_link(item.filename, item.file_id)}</span> &nbsp; <a href="#${item.filename}" class="jump">&#8594; diff</a><br />
 
133
                <span py:for="item in change.changes.modified" class="collapse-style-sbs-content">
 
134
                    <a href="#${item.filename}-s" class="filename" title="Jump to ${item.filename} below">${item.filename}</a><br />
 
135
                </span>
 
136
                <span py:for="item in change.changes.modified" class="collapse-style-unified-content">
 
137
                    <a href="#${item.filename}-u" class="filename" title="Jump to ${item.filename} below">${item.filename}</a><br />
125
138
                </span>
126
139
            </td>
127
140
        </tr>
133
146
    <td> ${collapse_all_button('file', 'table-row')} </td>
134
147
 
135
148
    <td class="spacey">
136
 
        <a href="javascript:show_sbs()" class="hide-all collapse-style-sbs-show" title="collapse">
 
149
        <a href="javascript:show_sbs('${branch.url('/')}')" class="hide-all collapse-style-sbs-show" title="collapse">
137
150
            <img src="${tg.url('/static/images/nav-small-out.gif')}" width="22" height="10" class="collapse-triangle" />show side by side</a>
138
 
        <a href="javascript:show_unified()" class="hide-all collapse-style-unified-show" title="expand">
 
151
        <a href="javascript:show_unified('${branch.url('/')}')" class="hide-all collapse-style-unified-show" title="expand">
139
152
            <img src="${tg.url('/static/images/nav-small-in.gif')}" width="22" height="10" class="collapse-triangle" />show unified diff</a>
140
153
    </td>
141
154
    
155
168
        <span py:strip="True" py:for="item in change.changes.modified">
156
169
            <tr><th class="filename" colspan="4">
157
170
                ${collapse_button('file', util.uniq(uniqs, item.file_id), 'table-row')}
158
 
                <a href="${branch.url([ '/annotate', change.revid ], **util.get_context(file_id=item.file_id))}" name="${item.filename}">${item.filename}</a>
 
171
                <a href="${branch.url([ '/annotate', change.revid ], **util.get_context(file_id=item.file_id))}"
 
172
                    name="${item.filename}-s" title="Annotate ${item.filename}">${item.filename}</a>
159
173
            </th></tr>
160
174
 
161
175
            <span py:strip="True" py:for="chunk in item.sbs_chunks">
165
179
                <tr py:for="line in chunk.diff" class="diff-chunk collapse-file-${util.uniq(uniqs, item.file_id)}-content">
166
180
                    <span py:if="line.old_lineno" py:strip="True">
167
181
                        <td class="lineno">${line.old_lineno}</td>
168
 
                        <td class="diff-${line.old_type}">${XML(line.old_line)}</td>
 
182
                        <td class="diff-${line.old_type}">${line.old_line}</td>
169
183
                    </span>
170
184
                    <span py:if="not line.old_lineno" py:strip="True">
171
185
                        <td class="lineno-skip">${line.old_lineno}</td>
172
 
                        <td class="diff-${line.old_type}-skip">${XML(line.old_line)}</td>
 
186
                        <td class="diff-${line.old_type}-skip">${line.old_line}</td>
173
187
                    </span>
174
188
                    <span py:if="line.new_lineno" py:strip="True">
175
189
                        <td py:if="line.new_lineno" class="lineno">${line.new_lineno}</td>
176
 
                        <td class="diff-${line.new_type}">${XML(line.new_line)}</td>
 
190
                        <td class="diff-${line.new_type}">${line.new_line}</td>
177
191
                    </span>
178
192
                    <span py:if="not line.new_lineno" py:strip="True">
179
193
                        <td py:if="not line.new_lineno" class="lineno-skip">${line.new_lineno}</td>
180
 
                        <td class="diff-${line.new_type}-skip">${XML(line.new_line)}</td>
 
194
                        <td class="diff-${line.new_type}-skip">${line.new_line}</td>
181
195
                    </span>
182
196
                </tr>
183
197
                <tr class="diff-chunk-spacing collapse-file-${util.uniq(uniqs, item.file_id)}-content"> <td colspan="4"> &nbsp; </td> </tr>
188
202
    
189
203
    <!-- ! unified diff -->
190
204
    <table class="diff-block collapse-style-unified-content">
191
 
            <span py:strip="True" py:for="item in change.changes.modified">
192
 
                <tr><th class="filename" colspan="4">
193
 
                    ${collapse_button('file', util.uniq(uniqs, item.file_id), 'table-row')}
194
 
                    <a href="${branch.url([ '/annotate', change.revid ], **util.get_context(file_id=item.file_id))}" name="${item.filename}">${item.filename}</a>
195
 
                </th></tr>
196
 
        
197
 
                <span py:strip="True" py:for="chunk in item.chunks">
198
 
                    <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>
199
 
                    <tr py:for="line in chunk.diff" class="diff-chunk collapse-file-${util.uniq(uniqs, item.file_id)}-content">
200
 
                        <td class="lineno">${line.old_lineno}</td>
201
 
                        <td class="lineno">${line.new_lineno}</td>
202
 
                        <td class="diff-${line.type} text">${XML(line.line)}</td>
203
 
                        <td> </td>
204
 
                    </tr>
205
 
                    <tr class="diff-chunk-spacing collapse-file-${util.uniq(uniqs, item.file_id)}-content"> <td colspan="4"> &nbsp; </td> </tr>
206
 
                </span>
207
 
                <tr class="diff-spacing"> <td colspan="4"> &nbsp; </td> </tr>
208
 
            </span>
 
205
        <span py:strip="True" py:for="item in change.changes.modified">
 
206
            <tr><th class="filename" colspan="4">
 
207
                ${collapse_button('file', util.uniq(uniqs, item.file_id), 'table-row')}
 
208
                <a href="${branch.url([ '/annotate', change.revid ], **util.get_context(file_id=item.file_id))}"
 
209
                    name="${item.filename}-u" title="Annotate ${item.filename}">${item.filename}</a>
 
210
            </th></tr>
 
211
 
 
212
            <span py:strip="True" py:for="chunk in item.chunks">
 
213
                <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>
 
214
                <tr py:for="line in chunk.diff" class="diff-chunk collapse-file-${util.uniq(uniqs, item.file_id)}-content">
 
215
                    <td class="lineno">${line.old_lineno}</td>
 
216
                    <td class="lineno">${line.new_lineno}</td>
 
217
                    <td class="diff-${line.type} text">${line.line}</td>
 
218
                    <td> </td>
 
219
                </tr>
 
220
                <tr class="diff-chunk-spacing collapse-file-${util.uniq(uniqs, item.file_id)}-content"> <td colspan="4"> &nbsp; </td> </tr>
 
221
            </span>
 
222
            <tr class="diff-spacing"> <td colspan="4"> &nbsp; </td> </tr>
 
223
        </span>
209
224
    </table>
210
225
 
211
226
</div>