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

https://bitbucket.org/gawel/shabti · Mako · 67 lines · 64 code · 3 blank · 0 comment · 3 complexity · 9619b39462762e0c2cb24baab3b46cba 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; background-color: #eef; padding:0.25em 0;}
  8. </style>
  9. </head>
  10. <body>
  11. <h4>Users</h4>
  12. <table style="width:100%;padding:0 1em; font-size:75%">
  13. <tr>
  14. <th>username</th>
  15. <th>email</th>
  16. <th>password</th>
  17. <th>created</th>
  18. <th>active</th>
  19. </tr>
  20. % for u in c.users:
  21. <tr>
  22. <td>${u.username}</td>
  23. <td>${u.email}</td>
  24. <td>${u.password}</td>
  25. <td>${u.created}</td>
  26. <td>${u.active}</td>
  27. </tr>
  28. % endfor
  29. </table>
  30. <h4>Groups</h4>
  31. <table style="width:100%;padding:0 1em; font-size:75%">
  32. <tr>
  33. <th>name</th>
  34. <th>description</th>
  35. <th>created</th>
  36. <th>active</th>
  37. <th>users</th>
  38. <th>permissions</th>
  39. </tr>
  40. % for g in c.groups:
  41. <tr>
  42. <td>${g.name}</td>
  43. <td>${g.description}</td>
  44. <td>${g.created}</td><td>${g.active}</td>
  45. <td>${', '.join([u.username for u in g.users])}</td>
  46. <td>${', '.join([p.name for p in g.permissions])}</td>
  47. </tr>
  48. % endfor
  49. </table>
  50. <h4>Permissions</h4>
  51. <table style="width:100%;padding:0 1em; font-size:75%">
  52. <tr>
  53. <th>name</th>
  54. <th>description</th>
  55. <th>groups</th>
  56. </tr>
  57. % for p in c.permissions:
  58. <tr><td>${p.name}</td><td>${p.description}</td>
  59. <td>${', '.join([group.name for group in p.groups])}</td>
  60. </tr>
  61. % endfor
  62. </table>
  63. </body>
  64. </html>