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 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. </style>
  47. </head>
  48. <body>
  49. <div id="content">
  50. {% if is_admin %}
  51. <div class="admin">
  52. <h1>Admin</h1>
  53. <h2>Add Source</h2>
  54. <form action="/admin/addsource" method="post">
  55. <label>Name: <input type="text" name="name"/></label>
  56. <label>URL: <input type="text" name="url"/></label>
  57. <input type="submit" value="Add"/>
  58. </form>
  59. </div>
  60. {% endif %}
  61. <h1>My Accounts</h1>
  62. <table>
  63. <tr>
  64. <th>Source</th>
  65. <th>Credentials</th>
  66. </tr>
  67. {% for account in accounts %}
  68. <tr>
  69. <td>{{ account.source.name|escape }}</td>
  70. <td>{{ account.credentials|escape }}</td>
  71. <td>
  72. <form action="/worker/update" method="post">
  73. <input type="hidden" name="key" value="{{ account.key|escape }}"/>
  74. <input type="submit" value="Update now"/>
  75. </form>
  76. </td>
  77. </tr>
  78. {% endfor %}
  79. </table>
  80. <h2>Add account</h2>
  81. <form action="/addaccount" method="post">
  82. <label>Type:
  83. <select name="type">
  84. {% for account in sources %}
  85. <option value="{{ source.key|escape }}">{{ source.name|escape }}</option>
  86. {% endfor %}
  87. </select>
  88. </label>
  89. <label>Credentials: <input type="text" name="credentials"/></label>
  90. <input type="submit" value="Add"/>
  91. </form>
  92. <h1>My Achievements</h1>
  93. {% for achievement in achievements %}
  94. <div class="achievement">
  95. <p class="source">{{ achievement.achievement.source.name|escape }}</p>
  96. <div class="img">
  97. <img src="{{ achievement.achievement.image|escape }}"
  98. alt="{{ achievement.achievement.name|escape }}"/>
  99. </div>
  100. <p class="name">{{ achievement.achievement.name|escape }}</p>
  101. <p class="description">{{ achievement.achievement.description|escape }}</p>
  102. <p class="date">{{ achievement.awarded|escape }}</p>
  103. </div>
  104. {% endfor %}
  105. </div>
  106. </body>
  107. </html>