summaryrefslogtreecommitdiff
path: root/src/templates
diff options
context:
space:
mode:
Diffstat (limited to 'src/templates')
-rw-r--r--src/templates/edit.php17
-rw-r--r--src/templates/index.php2
2 files changed, 18 insertions, 1 deletions
diff --git a/src/templates/edit.php b/src/templates/edit.php
new file mode 100644
index 0000000..a3c6930
--- /dev/null
+++ b/src/templates/edit.php
@@ -0,0 +1,17 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>Bookmarks</title>
+ </head>
+ <body>
+ <form action="/edit" method="POST">
+ <input type="hidden" name="id" value="<?php echo $bookmark->id; ?>"/>
+ <input type="text" name="url" maxlength="512" autofocus value="<?php echo $bookmark->url; ?>"><br>
+ <input type="text" name="title" maxlength="256" value="<?php echo $bookmark->title; ?>"><br>
+ <input type="text" name="tag" maxlength="8" value="<?php echo $bookmark->tag; ?>"><br>
+ <button type="submit">Update</button>
+ </form>
+ </body>
+</html>
diff --git a/src/templates/index.php b/src/templates/index.php
index 9656551..2703851 100644
--- a/src/templates/index.php
+++ b/src/templates/index.php
@@ -8,7 +8,7 @@
<body>
<ul>
<?php foreach ($bookmarks as $bookmark) { ?>
- <li><?php echo "[$bookmark->id] $bookmark->url"; ?></li>
+ <li><a href="/edit?id=<?php echo $bookmark->id; ?>"><?php echo $bookmark->title; ?></a></li>
<?php } ?>
</ul>
</body>