From 8977f8cec4ca88f13528792a453eb27328e22845 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Sun, 14 Nov 2021 08:49:37 +0000 Subject: Add description to todo --- public/css/site.css | 9 ++++++++- public/store/index.php | 1 + public/update/index.php | 1 + public/view/index.php | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 public/view/index.php (limited to 'public') diff --git a/public/css/site.css b/public/css/site.css index c1010a2..d34f380 100644 --- a/public/css/site.css +++ b/public/css/site.css @@ -18,6 +18,7 @@ body { h1, h2, +h3, label { font-weight: bold; font-size: 1.125rem; @@ -37,6 +38,10 @@ h2:before { content: "## "; } +h3 { + color: #86EFAC; +} + section { padding: 1rem; } @@ -71,13 +76,15 @@ label { } input, +textarea, button { border-radius: .25rem; display: block; width: 100%; } -input { +input, +textarea { border: 2px solid #FFFFFF; padding: .375rem .75rem; } diff --git a/public/store/index.php b/public/store/index.php index c4d24fa..0f472d8 100644 --- a/public/store/index.php +++ b/public/store/index.php @@ -40,6 +40,7 @@ $todos = new TodoRepository($config['path_to_repository']); $todo = new Todo(); $todo->task = $validated->task; +$todo->description = $validated->description; $todo->tag = $validated->tag; $todo->addedAt = date('Y-m-d H:i:s'); diff --git a/public/update/index.php b/public/update/index.php index 82b3c3f..749f429 100644 --- a/public/update/index.php +++ b/public/update/index.php @@ -45,6 +45,7 @@ if ($validator->errors->count()) { $validated = $validator->validated; $todo->task = $validated->task; +$todo->description = $validated->description; $todo->tag = $validated->tag; if (!$todos->update($todo)) { diff --git a/public/view/index.php b/public/view/index.php new file mode 100644 index 0000000..798cefd --- /dev/null +++ b/public/view/index.php @@ -0,0 +1,37 @@ +find($id); + +if ($todo === null) { + respondAndExit(404, 'Not Found'); +} + +$html = $template->render('view', compact( + 'todo' +)); + +respondAndExit(200, 'OK', $html); -- cgit v1.2.3-13-gbd6f