소스 검색

added templates

allens 1 일 전
부모
커밋
86891beb75
2개의 변경된 파일55개의 추가작업 그리고 0개의 파일을 삭제
  1. 30 0
      templates/index.html
  2. 25 0
      templates/list.html

+ 30 - 0
templates/index.html

@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Checklist</title>
+    <script>
+        // Function to focus on the input field
+        function focusInput() {
+            document.getElementById('itemInput').focus();
+        }
+    </script>
+</head>
+<body onload="focusInput()">
+    <h1>Checklist</h1>
+    <form method="POST" onsubmit="focusInput()">
+        <input type="text" id="itemInput" name="item" placeholder="Add a new item" required>
+        <button type="submit">Add</button>
+    </form>
+    <ul>
+        {% for item in items %}
+            <li style="text-decoration: {{ 'line-through' if item.checked else 'none' }};">
+                {{ item.name }}
+                <a href="{{ url_for('check', item_id=loop.index0) }}">[Check]</a>
+            </li>
+        {% endfor %}
+    </ul>
+    <a href="{{ url_for('list') }}">View List</a>
+</body>
+</html>

+ 25 - 0
templates/list.html

@@ -0,0 +1,25 @@
+ 
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Today's to-do List</title>
+    <style>
+        body {
+            background-color: transparent;
+            color: black;
+        }
+    </style>
+</head>
+<body>
+    <h1>Today's to-do List</h1>
+    <ul>
+        {% for item in items %}
+            <li style="text-decoration: {{ 'line-through' if item.checked else 'none' }};">
+                {{ item.name }}
+            </li>
+        {% endfor %}
+    </ul>
+</body>
+</html>