home · contact · privacy
More refactor, and include previously forgotten decks.tpl.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 15 Nov 2020 18:15:55 +0000 (19:15 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 15 Nov 2020 18:15:55 +0000 (19:15 +0100)
views/_card.css [new file with mode: 0644]
views/_card.tpl [new file with mode: 0644]
views/_meta_foot.tpl [new file with mode: 0644]
views/_meta_head.tpl [new file with mode: 0644]
views/card.tpl
views/card_form.tpl
views/cards.tpl
views/cards_print.tpl
views/decks.tpl [new file with mode: 0644]
views/delete_card.tpl

diff --git a/views/_card.css b/views/_card.css
new file mode 100644 (file)
index 0000000..9e71295
--- /dev/null
@@ -0,0 +1,5 @@
+.card {
+    box-sizing: border-box;
+    border: 30px solid #aaaaaa;
+    width: 200px;
+    height: 400px; }
diff --git a/views/_card.tpl b/views/_card.tpl
new file mode 100644 (file)
index 0000000..d5a541a
--- /dev/null
@@ -0,0 +1,17 @@
+<div class="card">
+  % if card["type"] == 'guilt':
+  <h1 id="title">GUILT CARD</h1>
+  <p id="prompt">Choose at least one of these guilts as your own:</p>
+  <ul id="answers">
+  % for answer in card["answers"]:
+    <li>{{ answer }}</li>
+  % end
+  <ul/>
+  % end
+  % if card["type"] == 'action':
+  <h1 id="title">ACTION CARD<br />{{ card["title"] }}</h1>
+  % for paragraph in card["paragraphs"]:
+  <p>{{ paragraph }}</p>
+  % end
+  % end
+</div>
diff --git a/views/_meta_foot.tpl b/views/_meta_foot.tpl
new file mode 100644 (file)
index 0000000..5f85cab
--- /dev/null
@@ -0,0 +1 @@
+</html>
diff --git a/views/_meta_head.tpl b/views/_meta_head.tpl
new file mode 100644 (file)
index 0000000..2fe56b9
--- /dev/null
@@ -0,0 +1,2 @@
+<!DOCTYPE HTML>
+<html>
index 31749f4b2ee0b42f55844a4db71fc91fad191fce..f946b210ab7fea3945979d7d53ca9a8f42d6f46e 100644 (file)
@@ -1,30 +1,9 @@
-<!DOCTYPE HTML>
-<html>
+% include('_meta_head.tpl')
 <style>
 <style>
-  .card {
-      box-sizing: border-box;
-      border: 30px solid #aaaaaa;
-      width: 200px;
-      height: 400px; }
+% include('_card.css')
 </style>
 <body>
 </style>
 <body>
-  <div class="card">
-    % if card["type"] == 'guilt':
-    <h1 id="title">GUILT CARD</h1>
-    <p id="prompt">Choose at least one of these guilts as your own:</p>
-    <ul id="answers">
-    % for answer in card["answers"]:
-      <li>{{ answer }}</li>
-    % end
-    <ul/>
-    % end
-    % if card["type"] == 'action':
-    <h1 id="title">ACTION CARD<br />{{ card["title"] }}</h1>
-    % for paragraph in card["paragraphs"]:
-    <p>{{ paragraph }}</p>
-    % end
-    % end
-  </div>
+% include('_card.tpl')
 <a href="{{ web_path }}/decks/{{deck_id}}/cards">back to overview</a>
 </body>
 <a href="{{ web_path }}/decks/{{deck_id}}/cards">back to overview</a>
 </body>
-</html>
+% include('_meta_foot.tpl')
index 9e1e68763b407efe64d6a8d0e517ebe72c95c142..2454df51506408019a4967366f38f22ec3056f5b 100644 (file)
@@ -1,5 +1,4 @@
-<!DOCTYPE HTML>
-<html>
+% include('_meta_head.tpl')
 <body>
 <h1>Edit {{ card["type"] }} card</h1>
 <form action="{{ web_path }}/decks/{{deck_id}}/cards/{{ card_id }}" method="POST">
 <body>
 <h1>Edit {{ card["type"] }} card</h1>
 <form action="{{ web_path }}/decks/{{deck_id}}/cards/{{ card_id }}" method="POST">
@@ -35,4 +34,4 @@ Or would you rather <a href="{{ web_path }}/decks/{{deck_id}}/cards/{{ card_id }
 % end
 </form>
 </body>
 % end
 </form>
 </body>
-</html>
+% include('_meta_foot.tpl')
index d63aab12f533ab6bda138108024443d4abd92487..49d7617bcc6b4cd4da4b9c52cbd5e3560569c485 100644 (file)
@@ -1,5 +1,4 @@
-<!DOCTYPE HTML>
-<html>
+% include('_meta_head.tpl')
 <body>
 <h1>deck: {{deck_name}}</h1>
 <ul>
 <body>
 <h1>deck: {{deck_name}}</h1>
 <ul>
@@ -17,4 +16,4 @@ add another guilt card? name: <input type="text" name="card_name" /> type: <sele
 <a href="{{ web_path }}/decks">back to decks overview</a>
 </p>
 </body>
 <a href="{{ web_path }}/decks">back to decks overview</a>
 </p>
 </body>
-</html>
+% include('_meta_foot.tpl')
index 99f88b0fe3fc4484743ae06a3441d2639646ece1..b7b63a1aa19975e3d3c5abc13f68a56be4eb4d67 100644 (file)
@@ -1,32 +1,13 @@
-<!DOCTYPE HTML>
-<html>
+% include('_meta_head.tpl')
 <style>
 <style>
+% include('_card.css')
   .card {
       page-break-before: always;
   .card {
       page-break-before: always;
-      box-sizing: border-box;
-      border: 30px solid #aaaaaa;
-      width: 200px;
-      height: 400px; }
+  }
 </style>
 <body>
 % for card in cards:
 </style>
 <body>
 % for card in cards:
-  <div class="card">
-    % if card["type"] == 'guilt':
-    <h1 id="title">GUILT CARD</h1>
-    <p id="prompt">Choose at least one of these guilts as your own:</p>
-    <ul id="answers">
-    % for answer in card["answers"]:
-      <li>{{ answer }}</li>
-    % end
-    <ul/>
-    % end
-    % if card["type"] == 'action':
-    <h1 id="title">ACTION CARD<br />{{ card["title"] }}</h1>
-    % for paragraph in card["paragraphs"]:
-    <p>{{ paragraph }}</p>
-    % end
-    % end
-  </div>
+% include('_card.tpl')
 % end
 % end
-</body>
-</html>
+<body>
+% include('_meta_foot.tpl')
diff --git a/views/decks.tpl b/views/decks.tpl
new file mode 100644 (file)
index 0000000..9cbae2c
--- /dev/null
@@ -0,0 +1,12 @@
+% include('_meta_head.tpl')
+<body>
+<ul>
+% for deck_id in decks:
+<li><a href="{{ web_path }}/decks/{{deck_id}}">{{decks[deck_id]}}</a></li>
+% end
+</ul>
+<form action="{{ web_path }}/decks/" method="GET">
+add another deck? name: <input type="text" name="deck_name" />
+</form>
+</body>
+% include('_meta_foot.tpl')
index c9c067711de70e89bd1d1b1c66744edcd7280e21..2d7537557ed3f45df45bc996ebfd89744f6708a7 100644 (file)
@@ -1,9 +1,8 @@
-<!DOCTYPE HTML>
-<html>
+% include('_meta_head.tpl')
 <body>
 <form action="{{ web_path }}/decks/{{ deck_id }}/cards/{{ card_id }}/delete" method="POST">
 <input type="submit" value="delete {{card_name}}?" />
 </form>
 <a href="{{ web_path }}/decks/{{ deck_id }}/cards">Nah, better not …</a>
 </body>
 <body>
 <form action="{{ web_path }}/decks/{{ deck_id }}/cards/{{ card_id }}/delete" method="POST">
 <input type="submit" value="delete {{card_name}}?" />
 </form>
 <a href="{{ web_path }}/decks/{{ deck_id }}/cards">Nah, better not …</a>
 </body>
-</html>
+% include('_meta_foot.tpl')