/shabti/templates/authplus/+package+/templates/test.mako
Mako | 85 lines | 80 code | 5 blank | 0 comment | 5 complexity | e831804633ff895cbc4d0659fa138868 MD5 | raw file
1<?xml version="1.0" encoding="utf-8"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4<head>
5 <title>${c.title}</title>
6 <style type="text/css">
7 th {text-align: left; padding:0.25em 0;}
8 </style>
9 % if h.url.current().endswith('privindex'):
10 <style type="text/css">
11 th {background-color: #fee;}
12 </style>
13 % else:
14 <style type="text/css">
15 th {background-color: #eef;}
16 </style>
17 % endif
18
19</head>
20<body>
21
22 <h4>Users</h4>
23 <table style="width:100%;padding:0 1em; font-size:75%">
24 <tr>
25 <th>name</th>
26 <th>email</th>
27 <th>created</th>
28 <th>lastlogin</th>
29 </tr>
30 % for u in c.users:
31 <tr>
32 <td>${u.displayname}</td>
33 <td>${u.email}</td>
34 <td>${u.created}</td>
35 <td>${u.last_login}</td>
36 </tr>
37 % endfor
38 </table>
39
40 <h4>Groups</h4>
41 <table style="width:100%;padding:0 1em; font-size:75%">
42 <tr>
43 <th>name</th>
44 <th>description</th>
45 <th>created</th>
46 <th>active</th>
47 <th>users</th>
48 <th>permissions</th>
49 </tr>
50 % for g in c.groups:
51 <tr>
52 <td>${g.name}</td>
53 <td>${g.description}</td>
54 <td>${g.created}</td><td>${g.active}</td>
55 <td>${', '.join([u.displayname for u in g.users])}</td>
56 <td>${', '.join([p.name for p in g.permissions])}</td>
57 </tr>
58 % endfor
59 </table>
60
61 <h4>Permissions</h4>
62 <table style="width:100%;padding:0 1em; font-size:75%">
63 <tr>
64 <th>name</th>
65 <th>description</th>
66 <th>groups</th>
67 </tr>
68 % for p in c.permissions:
69 <tr><td>${p.name}</td><td>${p.description}</td>
70 <td>${', '.join([group.name for group in p.groups])}</td>
71 </tr>
72 % endfor
73 </table>
74 <p><a href="/demo/index">Public</a> :: <a href="/demo/privindex">Private</a></p>
75 <p>
76 % if session.get('logged_in'):
77 Logged in as <span style="color:green">${session['displayname']}</span>
78 ${h.link_to('Logout', url=url('account_logout'))}
79 % else:
80 Welcome <span style="color:red">Anonymous</span> ${h.link_to('Login', url=url('account_login'))}
81 % endif
82 </p>
83
84</body>
85</html>