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

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

PeerReviewPlugin: several improvements:

  • Show repository and revision on main project file admin page
  • Show warning on a projects details page when a repository is gone
  • Ensure compatibility for project data of V3.0
  • Some refactoring and removal of obsolete code

Refs #12792

File size: 7.5 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 or nonode">
20        <div class="warning system-message"><p class="">${nonode if nonode else norepo}</p>
21        </div>
22    </div>
23
24    <div py:if="show_repo_idx" id="repo_idx">
25        <div id="repo_gone" class="browser" py:if="repo_gone">
26            <div class="warning system-message"><p class="">The repository '$repo_gone' is not available anymore. You may select a new repository and root folder now.</p>
27            </div>
28        </div>
29        <table class="listing" id="sel_repo_table">
30            <thead>
31                <tr>
32                    <th>Name</th>
33                    <th>Description</th>
34                </tr>
35            </thead>
36            <tr py:for="key, val in all_repos.iteritems()">
37                <td><a class="link_repo_idx" href="${browse_url+'?repo='+val.name}">${val.name if val.name else '(default)'}</a></td>
38                <td>${wiki_to_oneliner(context('wiki'), val.description)}</td>
39            </tr>
40        </table>
41        <p class="help">Select a repository from the list.</p>
42    </div>
43
44    <div id="repo" class="browser" py:if="not norepo and not show_repo_idx">
45        <div>
46            <p py:if="reponame">Current repository: ${repo.reponame}</p>
47            <p py:if="not reponame">Current repository: (default)</p>
48            <p>
49                Current path:
50                <xi:include href="path_links.html"/>
51            </p>
52        </div>
53
54        <div id="jumprev">
55            <div>
56                <label for="switch_rev"
57                       title="${stickyrev and 'Hint: clear the field to view latest revision' or None}">
58                    View revision:</label>
59                <input type="text" id="switch_rev" name="newrev" value="$stickyrev" size="6"/>
60            </div>
61        </div>
62
63
64        <table py:if="dir" class="listing dirlist" id="dirlist">
65            <thead>
66                <tr>
67                    <th></th>
68                    <th class="name">Name</th>
69                    <th class="size">Size</th>
70                    <th class="rev">Rev</th>
71                    <th class="date">Age</th>
72                    <th class="author">Author</th>
73                    <th class="change">Last Change</th>
74                </tr>
75            </thead>
76            <tbody style="overflow: auto; max-height: 400px">
77                <py:if test="'up' in chrome.links">
78                    <tr class="even">
79                        <td class="name" colspan="7">
80                            <a class="parent" title="Parent Directory" href="${chrome.links.up[0].href}">../</a>
81                        </td>
82                    </tr>
83                </py:if>
84                <py:for each="idx, item in enumerate(dir['items'])">
85                    <py:with vars="change = dir.changes[item.rev]">
86                        <tr class="${idx % 2 and 'even' or 'odd'}">
87                            <td class="'sel">
88                            </td>
89                            <td class="name">
90                                <py:if test="not item.permission">
91                                    <span class="${item.is_dir and 'dir' or 'file'}" title="Access Denied" href="">${item.name}</span>
92                                </py:if>
93                                <py:if test="item.permission">
94                                    <a py:if="item.is_dir" class="dir"
95                                       title="Browse Directory"
96                                       href="${item.browser_href}">${item.name}</a>
97                                    <div py:if="not item.is_dir">${item.name}</div>
98                                </py:if>
99                            </td>
100                            <td class="size">${item.size}</td>
101                            <td class="rev">
102                                <py:if test="not item.permission">${item.rev}</py:if>
103                                <py:if test="item.permission">
104                                    <a title="View Revision Log" href="${item.log_href}">${item.rev}</a>
105                                </py:if>
106                            </td>
107                            <td class="age">
108                                <span title="${dir.changes[item.rev].date}">${dir.changes[item.rev] and dateinfo(dir.changes[item.rev].date) or '-'}</span>
109                            </td>
110                            <td class="author">
111                                ${dir.changes[item.rev].author}
112                            </td>
113                            <td class="change">
114                                <py:if test="wiki_format_messages">
115                                    ${wiki_to_oneliner(context('changeset', item.rev, parent=repo.resource),
116                                    dir.changes[item.rev].message, shorten=True)}
117                                </py:if>
118                                <py:if test="not wiki_format_messages">
119                                    ${shorten_line(dir.changes[item.rev].message)}
120                                </py:if>
121                            </td>
122                        </tr>
123                    </py:with>
124                </py:for>
125            </tbody>
126        </table>
127
128        <!--! Properties -->
129        <table py:if="props or file" id="info" summary="Revision info">
130            <py:if test="file">
131                <tr>
132                    <th scope="row">
133                        Revision <a href="${href.changeset(rev)}">${rev}</a>
134                        (checked in by ${authorinfo(file.changeset.author)}, ${dateinfo(file.changeset.date)} ago)
135                    </th>
136                </tr>
137                <tr>
138                    <td class="message">${file.changeset.message}</td>
139                </tr>
140                <tr>
141                    <td><strong>File Size:</strong> ${sizeinfo(file.size)}</td>
142                </tr>
143            </py:if>
144            <py:if test="props">
145                <tr>
146                    <td colspan="2">
147                        <ul class="props">
148                            <li py:for="prop in props">
149                                Property <strong>${prop.name}</strong> set to
150                                <em><code>${prop.value}</code></em>
151                            </li>
152                        </ul>
153                    </td>
154                </tr>
155            </py:if>
156        </table>
157        <p class="help"> If you don't specify a revision the current head revision will be used. This head revision is
158        saved with the file information so the current files will be correctly identified in the future.</p>
159    </div>
160    <div>
161        <input type="hidden" value="$path" id="root_path"/>
162        <input type="hidden" value="$revision" id="fileRevVal" name="rev"/>
163        <input type="hidden" value="$reponame" id="reponame" name="reponame"/>
164    </div>
165
166</div>
Note: See TracBrowser for help on using the repository browser.