/shabti/templates/authplus/+package+/templates/test.mako

https://bitbucket.org/gawel/shabti · 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. </head>
  19. <body>
  20. <h4>Users</h4>
  21. <table style="width:100%;padding:0 1em; font-size:75%">
  22. <tr>
  23. <th>name</th>
  24. <th>email</th>
  25. <th>created</th>
  26. <th>lastlogin</th>
  27. </tr>
  28. % for u in c.users:
  29. <tr>
  30. <td>${u.displayname}</td>
  31. <td>${u.email}</td>
  32. <td>${u.created}</td>
  33. <td>${u.last_login}</td>
  34. </tr>
  35. % endfor
  36. </table>
  37. <h4>Groups</h4>
  38. <table style="width:100%;padding:0 1em; font-size:75%">
  39. <tr>
  40. <th>name</th>
  41. <th>description</th>
  42. <th>created</th>
  43. <th>active</th>
  44. <th>users</th>
  45. <th>permissions</th>
  46. </tr>
  47. % for g in c.groups:
  48. <tr>
  49. <td>${g.name}</td>
  50. <td>${g.description}</td>
  51. <td>${g.created}</td><td>${g.active}</td>
  52. <td>${', '.join([u.displayname for u in g.users])}</td>
  53. <td>${', '.join([p.name for p in g.permissions])}</td>
  54. </tr>
  55. % endfor
  56. </table>
  57. <h4>Permissions</h4>
  58. <table style="width:100%;padding:0 1em; font-size:75%">
  59. <tr>
  60. <th>name</th>
  61. <th>description</th>
  62. <th>groups</th>
  63. </tr>
  64. % for p in c.permissions:
  65. <tr><td>${p.name}</td><td>${p.description}</td>
  66. <td>${', '.join([group.name for group in p.groups])}</td>
  67. </tr>
  68. % endfor
  69. </table>
  70. <p><a href="/demo/index">Public</a> :: <a href="/demo/privindex">Private</a></p>
  71. <p>
  72. % if session.get('logged_in'):
  73. Logged in as <span style="color:green">${session['displayname']}</span>
  74. ${h.link_to('Logout', url=url('account_logout'))}
  75. % else:
  76. Welcome <span style="color:red">Anonymous</span> ${h.link_to('Login', url=url('account_login'))}
  77. % endif
  78. </p>
  79. </body>
  80. </html>