Incomplete webapp to aggregate achievements/badges from various sources
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <html>
  2. <head>
  3. <title>Achievement Aggregator</title>
  4. <style type="text/css">
  5. body {
  6. font-family: sans-serif;
  7. }
  8. .achievement {
  9. border: 1px solid black;
  10. float: left;
  11. margin: 5px;
  12. padding: 2px;
  13. position: relative;
  14. display: block;
  15. width: 450px;
  16. height: 90px;
  17. }
  18. .achievement .img {
  19. width: 90px;
  20. height: 90px;
  21. float: left;
  22. text-align: center;
  23. }
  24. .achievement .source {
  25. text-transform: uppercase;
  26. font-size: small;
  27. display: inline;
  28. font-weight: bold;
  29. }
  30. .achievement .source:after {
  31. content: ':';
  32. }
  33. .achievement .name {
  34. display: inline;
  35. }
  36. .achievement .description {
  37. font-style: italic;
  38. }
  39. .achievement .date {
  40. position: absolute;
  41. margin: 0;
  42. top: 2px;
  43. right: 2px;
  44. font-size: small;
  45. }
  46. td.actions form {
  47. display: inline;
  48. }
  49. </style>
  50. </head>
  51. <body>
  52. <div id="content">
  53. {% if is_admin %}
  54. <div class="admin">
  55. <h1>Admin</h1>
  56. <h2>Add Source</h2>
  57. <form action="/admin/source/add" method="post">
  58. <label>Name: <input type="text" name="name"/></label>
  59. <label>URL: <input type="text" name="url"/></label>
  60. <input type="submit" value="Add"/>
  61. </form>
  62. </div>
  63. {% endif %}
  64. <h1>My Accounts</h1>
  65. <table>
  66. <tr>
  67. <th>Source</th>
  68. <th>Credentials</th>
  69. </tr>
  70. {% for account in accounts %}
  71. <tr>
  72. <td>{{ account.source.name|escape }}</td>
  73. <td>{{ account.credentials|escape }}</td>
  74. <td class="actions">
  75. <form action="/worker/update" method="post">
  76. <input type="hidden" name="key" value="{{ account.key|escape }}"/>
  77. <input type="submit" value="Update now"/>
  78. </form>
  79. <form action="/account/delete" method="post">
  80. <input type="hidden" name="key" value="{{ account.key|escape }}"/>
  81. <input type="submit" value="Delete"/>
  82. </form>
  83. </td>
  84. </tr>
  85. {% endfor %}
  86. </table>
  87. <h2>Add account</h2>
  88. <form action="/account/add" method="post">
  89. <label>Type:
  90. <select name="type">
  91. {% for source in sources %}
  92. <option value="{{ source.key|escape }}">{{ source.name|escape }}</option>
  93. {% endfor %}
  94. </select>
  95. </label>
  96. <label>Credentials: <input type="text" name="credentials"/></label>
  97. <input type="submit" value="Add"/>
  98. </form>
  99. <h1>My Achievements</h1>
  100. {% for achievement in achievements %}
  101. <div class="achievement">
  102. <p class="source">{{ achievement.achievement.source.name|escape }}</p>
  103. <div class="img">
  104. <img src="{{ achievement.achievement.image|escape }}"
  105. alt="{{ achievement.achievement.name|escape }}"/>
  106. </div>
  107. <p class="name">{{ achievement.achievement.name|escape }}</p>
  108. <p class="description">{{ achievement.achievement.description|escape }}</p>
  109. <p class="date">{{ achievement.awarded|escape }}</p>
  110. </div>
  111. {% endfor %}
  112. </div>
  113. </body>
  114. </html>