Mercurial > kallithea
annotate pylons_app/templates/admin.html @ 78:6f524697f79d
Implemented paging to admin user acion log
author | Marcin Kuzminski <marcin@python-blog.com> |
---|---|
date | Sat, 17 Apr 2010 19:07:29 +0200 |
parents | e2600310e0b2 |
children | 9fe23fdab9e9 |
rev | line source |
---|---|
43 | 1 ## -*- coding: utf-8 -*- |
44 | 2 <%inherit file="base/base.html"/> |
45 | 3 <%def name="get_form_error(element)"> |
4 %if type(c.form_errors) == dict: | |
5 %if c.form_errors.get(element,False): | |
6 <span class="error-message"> | |
7 ${c.form_errors.get(element,'')} | |
8 </span> | |
9 %endif | |
10 %endif | |
11 </%def> | |
44 | 12 <%def name="title()"> |
13 ${_('Repository managment')} | |
14 </%def> | |
15 <%def name="breadcrumbs()"> | |
16 ${h.link_to(u'Home',h.url('/'))} | |
17 / | |
18 ${h.link_to(u'Admin',h.url('admin_home'))} | |
19 </%def> | |
20 <%def name="page_nav()"> | |
21 <li>${h.link_to(u'Home',h.url('/'))}</li> | |
22 <li class="current">${_('Admin')}</li> | |
23 </%def> | |
24 <%def name="main()"> | |
25 %if c.admin_user: | |
26 <ul class="submenu"> | |
27 <li> | |
47
f6ac79182600
Added rest controllers for repos and users,
Marcin Kuzminski <marcin@python-blog.com>
parents:
45
diff
changeset
|
28 ${h.link_to(u'Repos',h.url('repos'))} |
44 | 29 </li> |
30 <li> | |
47
f6ac79182600
Added rest controllers for repos and users,
Marcin Kuzminski <marcin@python-blog.com>
parents:
45
diff
changeset
|
31 ${h.link_to(u'Users',h.url('users'))} |
44 | 32 </li> |
33 </ul> | |
34 <br/> | |
35 <div> | |
62
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
36 <h2>Welcome ${c.admin_username}</h2> |
77
e2600310e0b2
bugfix fot admin template
Marcin Kuzminski <marcin@python-blog.com>
parents:
75
diff
changeset
|
37 <div>${_('Last 10 user actions')}</div> |
62
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
38 %if c.users_log: |
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
39 <table> |
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
40 <tr> |
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
41 <td>${_('Username')}</td> |
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
42 <td>${_('Repository')}</td> |
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
43 <td>${_('Action')}</td> |
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
44 <td>${_('Date')}</td> |
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
45 </tr> |
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
46 %for cnt,l in enumerate(c.users_log): |
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
47 <tr class="parity${cnt%2}"> |
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
48 <td>${l.user.username}</td> |
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
49 <td>${l.repository}</td> |
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
50 <td>${l.action}</td> |
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
51 <td>${l.action_date}</td> |
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
52 </tr> |
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
53 %endfor |
78
6f524697f79d
Implemented paging to admin user acion log
Marcin Kuzminski <marcin@python-blog.com>
parents:
77
diff
changeset
|
54 <tr> |
6f524697f79d
Implemented paging to admin user acion log
Marcin Kuzminski <marcin@python-blog.com>
parents:
77
diff
changeset
|
55 <td>${c.users_log.pager('$link_previous ~2~ $link_next')}</td> |
6f524697f79d
Implemented paging to admin user acion log
Marcin Kuzminski <marcin@python-blog.com>
parents:
77
diff
changeset
|
56 </tr> |
62
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
57 </table> |
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
58 %else: |
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
59 ${_('No actions yet')} |
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
60 %endif |
4df4c0eac619
Updated admin to show last 5 actions + updated db model
Marcin Kuzminski <marcin@python-blog.com>
parents:
47
diff
changeset
|
61 |
43 | 62 </div> |
44 | 63 %else: |
64 <div> | |
65 <br /> | |
66 <h2>${_('Login')}</h2> | |
67 ${h.form(h.url.current())} | |
68 <table> | |
69 <tr> | |
70 <td>${_('Username')}</td> | |
71 <td>${h.text('username')}</td> | |
45 | 72 <td>${get_form_error('username')} </td> |
44 | 73 </tr> |
74 <tr> | |
75 <td>${_('Password')}</td> | |
45 | 76 <td>${h.password('password')}</td> |
77 <td>${get_form_error('password')}</td> | |
44 | 78 </tr> |
79 <tr> | |
80 <td></td> | |
81 <td>${h.submit('login','login')}</td> | |
82 </tr> | |
83 </table> | |
84 ${h.end_form()} | |
85 </div> | |
86 %endif | |
87 | |
88 </%def> |