source: peerreviewplugin/tags/0.12/3.1/codereview/templates/repobrowser.html

Last change on this file was 15582, checked in by Cinc-th, 7 years ago

PeerReviewPlugin: when a default repository was defined no browsing of other named repositories was possible, follow up to [15581].

The repository information is now saved when creating a review.

Refs #12792

File size: 9.9 KB
Line 
1<div xmlns="http://www.w3.org/1999/xhtml"
2     xmlns:py="http://genshi.edgewall.org/"
3     xmlns:xi="http://www.w3.org/2001/XInclude" py:strip="">
4
5    <py:def function="sortable_th(order, desc, class_, title)">
6        <th class="$class_${order == class_ and (desc and ' desc' or ' asc') or ''}">
7            <a title="Sort by $class_${order == class_ and not desc and
8                                             ' (descending)' or ''}"
9               href="${href.peerReviewBrowser(path, rev=stickyrev, order=(class_ != 'name' and class_ or None),
10                                                   desc=(class_ == order and not desc and 1 or None))}">$title</a>
11        </th>
12    </py:def>
13
14    <py:def function="sizeinfo(size)">
15        <span title="${_('%(size)s bytes', size=size)}">
16            ${pretty_size(size)}</span>
17    </py:def>
18
19    <div id="repo" class="browser" py:if="norepo">
20        <div class="warning system-message"><p class="">$norepo</p>
21        </div>
22    </div>
23
24    <div py:if="show_repo_idx" id="repo_idx">
25        <p class="help">Select a repository from the following list.</p>
26        <table class="listing" id="sel_repo_table">
27            <thead>
28                <tr>
29                    <th>Name</th>
30                    <th>Description</th>
31                </tr>
32            </thead>
33            <tr py:for="key, val in all_repos.iteritems()">
34                <td><a class="link_repo_idx" href="${browse_url+'?repo='+val.name}">${val.name if val.name else '(default)'}</a></td>
35                <td>${wiki_to_oneliner(context('wiki'), val.description)}</td>
36            </tr>
37        </table>
38    </div>
39
40    <div id="repo" class="browser" py:if="not norepo and not show_repo_idx">
41        <div>
42            <p py:if="reponame">Current repository: ${repo.reponame}</p>
43            <p py:if="not reponame">Current repository: (default)</p>
44            <p>
45                Current path:
46                <xi:include href="path_links.html"/>
47            </p>
48        </div>
49
50        <div id="jumprev">
51            <div>
52                <label for="switch_rev"
53                       title="${stickyrev and 'Hint: clear the field to view latest revision' or None}">
54                    View revision:</label>
55                <input type="text" id="switch_rev" name="newrev" value="$stickyrev" size="6"/>
56            </div>
57        </div>
58
59        <table py:if="dir" class="listing dirlist" id="dirlist">
60            <thead>
61                <tr>
62                    <th></th>
63                    <th class="name">Name</th>
64                    <th class="size">Size</th>
65                    <th class="rev">Rev</th>
66                    <th class="date">Age</th>
67                    <th class="author">Author</th>
68                    <th class="change">Last Change</th>
69                </tr>
70            </thead>
71            <tbody style="overflow: auto; max-height: 400px">
72                <py:if test="'up' in chrome.links">
73                    <tr class="even">
74                        <td class="name" colspan="7">
75                            <a class="parent" title="Parent Directory" href="${chrome.links.up[0].href}">../</a>
76                        </td>
77                    </tr>
78                </py:if>
79                <py:for each="idx, item in enumerate(dir['items'])">
80                    <py:with vars="change = dir.changes[item.rev]">
81                        <tr class="${idx % 2 and 'even' or 'odd'}">
82                            <td class="'sel">
83                                <input py:if="item.size" class="fileselect" type="checkbox" name="sel"
84                                       data-rev="${item.rev}" value="${item.fullpath}"/>
85                            </td>
86                            <td class="name">
87                                <py:if test="not item.permission">
88                                    <span class="${item.is_dir and 'dir' or 'file'}" title="Access Denied" href="">${item.name}</span>
89                                </py:if>
90                                <py:if test="item.permission">
91                                    <a class="${item.is_dir and 'dir' or 'file'}"
92                                       title="${item.is_dir and 'Browse Directory' or 'View File'}"
93                                       href="${item.browser_href}">${item.name}</a>
94                                </py:if>
95                            </td>
96                            <td class="size">${item.size}</td>
97                            <td class="rev">
98                                <py:if test="not item.permission">${item.rev}</py:if>
99                                <py:if test="item.permission">
100                                    <a title="View Revision Log" href="${item.log_href}">${item.rev}</a>
101                                </py:if>
102                            </td>
103                            <td class="age">
104                                <span title="${dir.changes[item.rev].date}">${dir.changes[item.rev] and dateinfo(dir.changes[item.rev].date) or '-'}</span>
105                            </td>
106                            <td class="author">
107                                ${dir.changes[item.rev].author}
108                            </td>
109                            <td class="change">
110                                <py:if test="wiki_format_messages">
111                                    ${wiki_to_oneliner(context('changeset', item.rev, parent=repo.resource),
112                                    dir.changes[item.rev].message, shorten=True)}
113                                </py:if>
114                                <py:if test="not wiki_format_messages">
115                                    ${shorten_line(dir.changes[item.rev].message)}
116                                </py:if>
117                            </td>
118                        </tr>
119                    </py:with>
120                </py:for>
121            </tbody>
122        </table>
123
124        <!--! Properties -->
125        <table py:if="props or file" id="info" summary="Revision info">
126            <py:if test="file">
127                <tr>
128                    <th scope="row">
129                        Revision <a href="${href.changeset(rev)}">${rev}</a>
130                        (checked in by ${authorinfo(file.changeset.author)}, ${dateinfo(file.changeset.date)} ago)
131                    </th>
132                </tr>
133                <tr>
134                    <td class="message">${file.changeset.message}</td>
135                </tr>
136                <tr>
137                    <td><strong>File Size:</strong> ${sizeinfo(file.size)}</td>
138                </tr>
139            </py:if>
140            <py:if test="props">
141                <tr>
142                    <td colspan="2">
143                        <ul class="props">
144                            <li py:for="prop in props">
145                                Property <strong>${prop.name}</strong> set to
146                                <em><code>${prop.value}</code></em>
147                            </li>
148                        </ul>
149                    </td>
150                </tr>
151            </py:if>
152        </table>
153        <py:if test="not file">
154            <p class="help">To select a section of a file for review click on the filename to open the file preview.</p>
155            <div id="add-file">
156                <div>
157                    <input type="button" id="addfiles" value="Add selected files" disabled="1"/>
158                </div>
159                <input type="hidden" value="0" id="lineBox1"/>
160                <input type="hidden" value="0" id="lineBox2"/>
161                <input type="hidden" value="$revision" id="fileRevVal" name="revision"/>
162                <input type="hidden" value="$reponame" id="reponame_file" name="repofile"/>
163            </div>
164        </py:if>
165        <!--! The following is only shown for files -->
166        <py:if test="file">
167            <div id="file-preview">
168                <py:if test="not file.preview and file.max_file_size_reached">
169                    <div id="add-file">
170                        <div class="warning system-message">
171                            <p>
172                                <strong>Warning: </strong>No HTML preview is available (the file size exceeds
173                                ${sizeinfo(file.max_file_size)}) - you cannot add it to a code review.
174                            </p>
175                        </div>
176                        <p class="help">The allowed filesize can be set by an administrator.</p>
177                    </div>
178                </py:if>
179                <py:if test="not file.preview and not file.max_file_size_reached">
180                    <div id="add-file">
181                        <div class="warning system-message">
182                            <p>
183                                <strong>Warning: </strong>No HTML preview is available for this file - you cannot add it
184                                to a code review.
185                            </p>
186                        </div>
187                    </div>
188                </py:if>
189                <py:if test="file.preview">${file.preview}
190                </py:if>
191            </div>
192            <div id="add-file" py:if="file.preview">
193                <p class="help">Click on the line numbers to select start and end of the section.</p>
194
195                <div>
196                    <input type="button" onclick="addFile('${path}')" value="Add File" disabled="true"
197                           id="addFileButton"/> &nbsp;&nbsp;
198                </div>
199                <div class="field">
200                    <label>Start Line: <input type="text" onkeypress="lineEnter(event);" value=""
201                                              size="5" id="lineBox1" onchange="addButtonEnable();"/>
202                    </label>
203                    <label>End Line: <input type="text" onkeypress="lineEnter(event);" value=""
204                                            size="5" id="lineBox2" onchange="addButtonEnable();"/>
205                    </label>
206                </div>
207                <input type="hidden" name="revision" value="$revision" id="fileRevVal"/>
208            </div>
209
210        </py:if>
211
212    </div>
213</div>
Note: See TracBrowser for help on using the repository browser.