Show More
@@ -1,376 +1,376 b'' | |||
|
1 | 1 | ## DATA TABLE RE USABLE ELEMENTS |
|
2 | 2 | ## usage: |
|
3 | 3 | ## <%namespace name="dt" file="/data_table/_dt_elements.mako"/> |
|
4 | 4 | <%namespace name="base" file="/base/base.mako"/> |
|
5 | 5 | |
|
6 | 6 | <%def name="metatags_help()"> |
|
7 | 7 | <table> |
|
8 | 8 | <% |
|
9 | 9 | example_tags = [ |
|
10 | 10 | ('state','[stable]'), |
|
11 | 11 | ('state','[stale]'), |
|
12 | 12 | ('state','[featured]'), |
|
13 | 13 | ('state','[dev]'), |
|
14 | 14 | ('state','[dead]'), |
|
15 | 15 | |
|
16 | 16 | ('label','[personal]'), |
|
17 | 17 | ('generic','[v2.0.0]'), |
|
18 | 18 | |
|
19 | 19 | ('lang','[lang => JavaScript]'), |
|
20 | 20 | ('license','[license => LicenseName]'), |
|
21 | 21 | |
|
22 | 22 | ('ref','[requires => RepoName]'), |
|
23 | 23 | ('ref','[recommends => GroupName]'), |
|
24 | 24 | ('ref','[conflicts => SomeName]'), |
|
25 | 25 | ('ref','[base => SomeName]'), |
|
26 | 26 | ('url','[url => [linkName](https://rhodecode.com)]'), |
|
27 | 27 | ('see','[see => http://rhodecode.com]'), |
|
28 | 28 | ] |
|
29 | 29 | %> |
|
30 | 30 | % for tag_type, tag in example_tags: |
|
31 | 31 | <tr> |
|
32 | 32 | <td>${tag|n}</td> |
|
33 | 33 | <td>${h.style_metatag(tag_type, tag)|n}</td> |
|
34 | 34 | </tr> |
|
35 | 35 | % endfor |
|
36 | 36 | </table> |
|
37 | 37 | </%def> |
|
38 | 38 | |
|
39 | 39 | ## REPOSITORY RENDERERS |
|
40 | 40 | <%def name="quick_menu(repo_name)"> |
|
41 | 41 | <i class="icon-more"></i> |
|
42 | 42 | <div class="menu_items_container hidden"> |
|
43 | 43 | <ul class="menu_items"> |
|
44 | 44 | <li> |
|
45 | 45 | <a title="${_('Summary')}" href="${h.route_path('repo_summary',repo_name=repo_name)}"> |
|
46 | 46 | <span>${_('Summary')}</span> |
|
47 | 47 | </a> |
|
48 | 48 | </li> |
|
49 | 49 | <li> |
|
50 | 50 | <a title="${_('Changelog')}" href="${h.route_path('repo_changelog',repo_name=repo_name)}"> |
|
51 | 51 | <span>${_('Changelog')}</span> |
|
52 | 52 | </a> |
|
53 | 53 | </li> |
|
54 | 54 | <li> |
|
55 | 55 | <a title="${_('Files')}" href="${h.route_path('repo_files:default_commit',repo_name=repo_name)}"> |
|
56 | 56 | <span>${_('Files')}</span> |
|
57 | 57 | </a> |
|
58 | 58 | </li> |
|
59 | 59 | <li> |
|
60 | 60 | <a title="${_('Fork')}" href="${h.route_path('repo_fork_new',repo_name=repo_name)}"> |
|
61 | 61 | <span>${_('Fork')}</span> |
|
62 | 62 | </a> |
|
63 | 63 | </li> |
|
64 | 64 | </ul> |
|
65 | 65 | </div> |
|
66 | 66 | </%def> |
|
67 | 67 | |
|
68 | 68 | <%def name="repo_name(name,rtype,rstate,private,fork_of,short_name=False,admin=False)"> |
|
69 | 69 | <% |
|
70 | 70 | def get_name(name,short_name=short_name): |
|
71 | 71 | if short_name: |
|
72 | 72 | return name.split('/')[-1] |
|
73 | 73 | else: |
|
74 | 74 | return name |
|
75 | 75 | %> |
|
76 | 76 | <div class="${'repo_state_pending' if rstate == 'repo_state_pending' else ''} truncate"> |
|
77 | 77 | ##NAME |
|
78 | 78 | <a href="${h.route_path('edit_repo',repo_name=name) if admin else h.route_path('repo_summary',repo_name=name)}"> |
|
79 | 79 | |
|
80 | 80 | ##TYPE OF REPO |
|
81 | 81 | %if h.is_hg(rtype): |
|
82 | <span title="${_('Mercurial repository')}"><i class="icon-hg"></i></span> | |
|
82 | <span title="${_('Mercurial repository')}"><i class="icon-hg" style="font-size: 14px;"></i></span> | |
|
83 | 83 | %elif h.is_git(rtype): |
|
84 | <span title="${_('Git repository')}"><i class="icon-git"></i></span> | |
|
84 | <span title="${_('Git repository')}"><i class="icon-git" style="font-size: 14px"></i></span> | |
|
85 | 85 | %elif h.is_svn(rtype): |
|
86 | <span title="${_('Subversion repository')}"><i class="icon-svn"></i></span> | |
|
86 | <span title="${_('Subversion repository')}"><i class="icon-svn" style="font-size: 14px"></i></span> | |
|
87 | 87 | %endif |
|
88 | 88 | |
|
89 | 89 | ##PRIVATE/PUBLIC |
|
90 | 90 | %if private and c.visual.show_private_icon: |
|
91 | 91 | <i class="icon-lock" title="${_('Private repository')}"></i> |
|
92 | 92 | %elif not private and c.visual.show_public_icon: |
|
93 | 93 | <i class="icon-unlock-alt" title="${_('Public repository')}"></i> |
|
94 | 94 | %else: |
|
95 | 95 | <span></span> |
|
96 | 96 | %endif |
|
97 | 97 | ${get_name(name)} |
|
98 | 98 | </a> |
|
99 | 99 | %if fork_of: |
|
100 | 100 | <a href="${h.route_path('repo_summary',repo_name=fork_of.repo_name)}"><i class="icon-code-fork"></i></a> |
|
101 | 101 | %endif |
|
102 | 102 | %if rstate == 'repo_state_pending': |
|
103 | 103 | <span class="creation_in_progress tooltip" title="${_('This repository is being created in a background task')}"> |
|
104 | 104 | (${_('creating...')}) |
|
105 | 105 | </span> |
|
106 | 106 | %endif |
|
107 | 107 | </div> |
|
108 | 108 | </%def> |
|
109 | 109 | |
|
110 | 110 | <%def name="repo_desc(description, stylify_metatags)"> |
|
111 | 111 | <% |
|
112 | 112 | tags, description = h.extract_metatags(description) |
|
113 | 113 | %> |
|
114 | 114 | |
|
115 | 115 | <div class="truncate-wrap"> |
|
116 | 116 | % if stylify_metatags: |
|
117 | 117 | % for tag_type, tag in tags: |
|
118 | 118 | ${h.style_metatag(tag_type, tag)|n} |
|
119 | 119 | % endfor |
|
120 | 120 | % endif |
|
121 | 121 | ${description} |
|
122 | 122 | </div> |
|
123 | 123 | |
|
124 | 124 | </%def> |
|
125 | 125 | |
|
126 | 126 | <%def name="last_change(last_change)"> |
|
127 | 127 | ${h.age_component(last_change)} |
|
128 | 128 | </%def> |
|
129 | 129 | |
|
130 | 130 | <%def name="revision(name,rev,tip,author,last_msg)"> |
|
131 | 131 | <div> |
|
132 | 132 | %if rev >= 0: |
|
133 | 133 | <code><a title="${h.tooltip('%s:\n\n%s' % (author,last_msg))}" class="tooltip" href="${h.route_path('repo_commit',repo_name=name,commit_id=tip)}">${'r%s:%s' % (rev,h.short_id(tip))}</a></code> |
|
134 | 134 | %else: |
|
135 | 135 | ${_('No commits yet')} |
|
136 | 136 | %endif |
|
137 | 137 | </div> |
|
138 | 138 | </%def> |
|
139 | 139 | |
|
140 | 140 | <%def name="rss(name)"> |
|
141 | 141 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
142 | 142 | <a title="${h.tooltip(_('Subscribe to %s rss feed')% name)}" href="${h.route_path('rss_feed_home', repo_name=name, _query=dict(auth_token=c.rhodecode_user.feed_token))}"><i class="icon-rss-sign"></i></a> |
|
143 | 143 | %else: |
|
144 | 144 | <a title="${h.tooltip(_('Subscribe to %s rss feed')% name)}" href="${h.route_path('rss_feed_home', repo_name=name)}"><i class="icon-rss-sign"></i></a> |
|
145 | 145 | %endif |
|
146 | 146 | </%def> |
|
147 | 147 | |
|
148 | 148 | <%def name="atom(name)"> |
|
149 | 149 | %if c.rhodecode_user.username != h.DEFAULT_USER: |
|
150 | 150 | <a title="${h.tooltip(_('Subscribe to %s atom feed')% name)}" href="${h.route_path('atom_feed_home', repo_name=name, _query=dict(auth_token=c.rhodecode_user.feed_token))}"><i class="icon-rss-sign"></i></a> |
|
151 | 151 | %else: |
|
152 | 152 | <a title="${h.tooltip(_('Subscribe to %s atom feed')% name)}" href="${h.route_path('atom_feed_home', repo_name=name)}"><i class="icon-rss-sign"></i></a> |
|
153 | 153 | %endif |
|
154 | 154 | </%def> |
|
155 | 155 | |
|
156 | 156 | <%def name="user_gravatar(email, size=16)"> |
|
157 | 157 | <div class="rc-user tooltip" title="${h.tooltip(h.author_string(email))}"> |
|
158 | 158 | ${base.gravatar(email, 16)} |
|
159 | 159 | </div> |
|
160 | 160 | </%def> |
|
161 | 161 | |
|
162 | 162 | <%def name="repo_actions(repo_name, super_user=True)"> |
|
163 | 163 | <div> |
|
164 | 164 | <div class="grid_edit"> |
|
165 | 165 | <a href="${h.route_path('edit_repo',repo_name=repo_name)}" title="${_('Edit')}"> |
|
166 | 166 | <i class="icon-pencil"></i>Edit</a> |
|
167 | 167 | </div> |
|
168 | 168 | <div class="grid_delete"> |
|
169 | 169 | ${h.secure_form(h.route_path('edit_repo_advanced_delete', repo_name=repo_name), method='POST', request=request)} |
|
170 | 170 | ${h.submit('remove_%s' % repo_name,_('Delete'),class_="btn btn-link btn-danger", |
|
171 | 171 | onclick="return confirm('"+_('Confirm to delete this repository: %s') % repo_name+"');")} |
|
172 | 172 | ${h.end_form()} |
|
173 | 173 | </div> |
|
174 | 174 | </div> |
|
175 | 175 | </%def> |
|
176 | 176 | |
|
177 | 177 | <%def name="repo_state(repo_state)"> |
|
178 | 178 | <div> |
|
179 | 179 | %if repo_state == 'repo_state_pending': |
|
180 | 180 | <div class="tag tag4">${_('Creating')}</div> |
|
181 | 181 | %elif repo_state == 'repo_state_created': |
|
182 | 182 | <div class="tag tag1">${_('Created')}</div> |
|
183 | 183 | %else: |
|
184 | 184 | <div class="tag alert2" title="${h.tooltip(repo_state)}">invalid</div> |
|
185 | 185 | %endif |
|
186 | 186 | </div> |
|
187 | 187 | </%def> |
|
188 | 188 | |
|
189 | 189 | |
|
190 | 190 | ## REPO GROUP RENDERERS |
|
191 | 191 | <%def name="quick_repo_group_menu(repo_group_name)"> |
|
192 | 192 | <i class="icon-more"></i> |
|
193 | 193 | <div class="menu_items_container hidden"> |
|
194 | 194 | <ul class="menu_items"> |
|
195 | 195 | <li> |
|
196 | 196 | <a href="${h.route_path('repo_group_home', repo_group_name=repo_group_name)}">${_('Summary')}</a> |
|
197 | 197 | </li> |
|
198 | 198 | |
|
199 | 199 | </ul> |
|
200 | 200 | </div> |
|
201 | 201 | </%def> |
|
202 | 202 | |
|
203 | 203 | <%def name="repo_group_name(repo_group_name, children_groups=None)"> |
|
204 | 204 | <div> |
|
205 | 205 | <a href="${h.route_path('repo_group_home', repo_group_name=repo_group_name)}"> |
|
206 | <i class="icon-folder-close" title="${_('Repository group')}"></i> | |
|
206 | <i class="icon-folder-close" title="${_('Repository group')}" style="font-size: 16px"></i> | |
|
207 | 207 | %if children_groups: |
|
208 | 208 | ${h.literal(' » '.join(children_groups))} |
|
209 | 209 | %else: |
|
210 | 210 | ${repo_group_name} |
|
211 | 211 | %endif |
|
212 | 212 | </a> |
|
213 | 213 | </div> |
|
214 | 214 | </%def> |
|
215 | 215 | |
|
216 | 216 | <%def name="repo_group_desc(description, personal, stylify_metatags)"> |
|
217 | 217 | |
|
218 | 218 | <% |
|
219 | 219 | tags, description = h.extract_metatags(description) |
|
220 | 220 | %> |
|
221 | 221 | |
|
222 | 222 | <div class="truncate-wrap"> |
|
223 | 223 | % if personal: |
|
224 | 224 | <div class="metatag" tag="personal">${_('personal')}</div> |
|
225 | 225 | % endif |
|
226 | 226 | |
|
227 | 227 | % if stylify_metatags: |
|
228 | 228 | % for tag_type, tag in tags: |
|
229 | 229 | ${h.style_metatag(tag_type, tag)|n} |
|
230 | 230 | % endfor |
|
231 | 231 | % endif |
|
232 | 232 | ${description} |
|
233 | 233 | </div> |
|
234 | 234 | |
|
235 | 235 | </%def> |
|
236 | 236 | |
|
237 | 237 | <%def name="repo_group_actions(repo_group_id, repo_group_name, gr_count)"> |
|
238 | 238 | <div class="grid_edit"> |
|
239 | 239 | <a href="${h.url('edit_repo_group',group_name=repo_group_name)}" title="${_('Edit')}">Edit</a> |
|
240 | 240 | </div> |
|
241 | 241 | <div class="grid_delete"> |
|
242 | 242 | ${h.secure_form(h.url('delete_repo_group', group_name=repo_group_name),method='delete')} |
|
243 | 243 | ${h.submit('remove_%s' % repo_group_name,_('Delete'),class_="btn btn-link btn-danger", |
|
244 | 244 | onclick="return confirm('"+_ungettext('Confirm to delete this group: %s with %s repository','Confirm to delete this group: %s with %s repositories',gr_count) % (repo_group_name, gr_count)+"');")} |
|
245 | 245 | ${h.end_form()} |
|
246 | 246 | </div> |
|
247 | 247 | </%def> |
|
248 | 248 | |
|
249 | 249 | |
|
250 | 250 | <%def name="user_actions(user_id, username)"> |
|
251 | 251 | <div class="grid_edit"> |
|
252 | 252 | <a href="${h.url('edit_user',user_id=user_id)}" title="${_('Edit')}"> |
|
253 | 253 | <i class="icon-pencil"></i>Edit</a> |
|
254 | 254 | </div> |
|
255 | 255 | <div class="grid_delete"> |
|
256 | 256 | ${h.secure_form(h.url('delete_user', user_id=user_id),method='delete')} |
|
257 | 257 | ${h.submit('remove_',_('Delete'),id="remove_user_%s" % user_id, class_="btn btn-link btn-danger", |
|
258 | 258 | onclick="return confirm('"+_('Confirm to delete this user: %s') % username+"');")} |
|
259 | 259 | ${h.end_form()} |
|
260 | 260 | </div> |
|
261 | 261 | </%def> |
|
262 | 262 | |
|
263 | 263 | <%def name="user_group_actions(user_group_id, user_group_name)"> |
|
264 | 264 | <div class="grid_edit"> |
|
265 | 265 | <a href="${h.route_path('edit_user_group', user_group_id=user_group_id)}" title="${_('Edit')}">Edit</a> |
|
266 | 266 | </div> |
|
267 | 267 | <div class="grid_delete"> |
|
268 | 268 | ${h.secure_form(h.route_path('user_groups_delete', user_group_id=user_group_id), method='POST', request=request)} |
|
269 | 269 | ${h.submit('remove_',_('Delete'),id="remove_group_%s" % user_group_id, class_="btn btn-link btn-danger", |
|
270 | 270 | onclick="return confirm('"+_('Confirm to delete this user group: %s') % user_group_name+"');")} |
|
271 | 271 | ${h.end_form()} |
|
272 | 272 | </div> |
|
273 | 273 | </%def> |
|
274 | 274 | |
|
275 | 275 | |
|
276 | 276 | <%def name="user_name(user_id, username)"> |
|
277 | 277 | ${h.link_to(h.person(username, 'username_or_name_or_email'), h.url('edit_user', user_id=user_id))} |
|
278 | 278 | </%def> |
|
279 | 279 | |
|
280 | 280 | <%def name="user_profile(username)"> |
|
281 | 281 | ${base.gravatar_with_user(username, 16)} |
|
282 | 282 | </%def> |
|
283 | 283 | |
|
284 | 284 | <%def name="user_group_name(user_group_id, user_group_name)"> |
|
285 | 285 | <div> |
|
286 | 286 | <a href="${h.route_path('edit_user_group', user_group_id=user_group_id)}"> |
|
287 | 287 | <i class="icon-group" title="${_('User group')}"></i> ${user_group_name}</a> |
|
288 | 288 | </div> |
|
289 | 289 | </%def> |
|
290 | 290 | |
|
291 | 291 | |
|
292 | 292 | ## GISTS |
|
293 | 293 | |
|
294 | 294 | <%def name="gist_gravatar(full_contact)"> |
|
295 | 295 | <div class="gist_gravatar"> |
|
296 | 296 | ${base.gravatar(full_contact, 30)} |
|
297 | 297 | </div> |
|
298 | 298 | </%def> |
|
299 | 299 | |
|
300 | 300 | <%def name="gist_access_id(gist_access_id, full_contact)"> |
|
301 | 301 | <div> |
|
302 | 302 | <b> |
|
303 | 303 | <a href="${h.route_path('gist_show', gist_id=gist_access_id)}">gist: ${gist_access_id}</a> |
|
304 | 304 | </b> |
|
305 | 305 | </div> |
|
306 | 306 | </%def> |
|
307 | 307 | |
|
308 | 308 | <%def name="gist_author(full_contact, created_on, expires)"> |
|
309 | 309 | ${base.gravatar_with_user(full_contact, 16)} |
|
310 | 310 | </%def> |
|
311 | 311 | |
|
312 | 312 | |
|
313 | 313 | <%def name="gist_created(created_on)"> |
|
314 | 314 | <div class="created"> |
|
315 | 315 | ${h.age_component(created_on, time_is_local=True)} |
|
316 | 316 | </div> |
|
317 | 317 | </%def> |
|
318 | 318 | |
|
319 | 319 | <%def name="gist_expires(expires)"> |
|
320 | 320 | <div class="created"> |
|
321 | 321 | %if expires == -1: |
|
322 | 322 | ${_('never')} |
|
323 | 323 | %else: |
|
324 | 324 | ${h.age_component(h.time_to_utcdatetime(expires))} |
|
325 | 325 | %endif |
|
326 | 326 | </div> |
|
327 | 327 | </%def> |
|
328 | 328 | |
|
329 | 329 | <%def name="gist_type(gist_type)"> |
|
330 | 330 | %if gist_type != 'public': |
|
331 | 331 | <div class="tag">${_('Private')}</div> |
|
332 | 332 | %endif |
|
333 | 333 | </%def> |
|
334 | 334 | |
|
335 | 335 | <%def name="gist_description(gist_description)"> |
|
336 | 336 | ${gist_description} |
|
337 | 337 | </%def> |
|
338 | 338 | |
|
339 | 339 | |
|
340 | 340 | ## PULL REQUESTS GRID RENDERERS |
|
341 | 341 | |
|
342 | 342 | <%def name="pullrequest_target_repo(repo_name)"> |
|
343 | 343 | <div class="truncate"> |
|
344 | 344 | ${h.link_to(repo_name,h.route_path('repo_summary',repo_name=repo_name))} |
|
345 | 345 | </div> |
|
346 | 346 | </%def> |
|
347 | 347 | <%def name="pullrequest_status(status)"> |
|
348 | 348 | <div class="${'flag_status %s' % status} pull-left"></div> |
|
349 | 349 | </%def> |
|
350 | 350 | |
|
351 | 351 | <%def name="pullrequest_title(title, description)"> |
|
352 | 352 | ${title} <br/> |
|
353 | 353 | ${h.shorter(description, 40)} |
|
354 | 354 | </%def> |
|
355 | 355 | |
|
356 | 356 | <%def name="pullrequest_comments(comments_nr)"> |
|
357 | 357 | <i class="icon-comment"></i> ${comments_nr} |
|
358 | 358 | </%def> |
|
359 | 359 | |
|
360 | 360 | <%def name="pullrequest_name(pull_request_id, target_repo_name, short=False)"> |
|
361 | 361 | <a href="${h.route_path('pullrequest_show',repo_name=target_repo_name,pull_request_id=pull_request_id)}"> |
|
362 | 362 | % if short: |
|
363 | 363 | #${pull_request_id} |
|
364 | 364 | % else: |
|
365 | 365 | ${_('Pull request #%(pr_number)s') % {'pr_number': pull_request_id,}} |
|
366 | 366 | % endif |
|
367 | 367 | </a> |
|
368 | 368 | </%def> |
|
369 | 369 | |
|
370 | 370 | <%def name="pullrequest_updated_on(updated_on)"> |
|
371 | 371 | ${h.age_component(h.time_to_utcdatetime(updated_on))} |
|
372 | 372 | </%def> |
|
373 | 373 | |
|
374 | 374 | <%def name="pullrequest_author(full_contact)"> |
|
375 | 375 | ${base.gravatar_with_user(full_contact, 16)} |
|
376 | 376 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now