diff options
Diffstat (limited to 'src/templates')
| -rw-r--r-- | src/templates/confirm_deletion.php (renamed from src/templates/delete.php) | 3 | ||||
| -rw-r--r-- | src/templates/create.php (renamed from src/templates/add.php) | 5 | ||||
| -rw-r--r-- | src/templates/edit.php | 5 | ||||
| -rw-r--r-- | src/templates/index.php | 11 |
4 files changed, 14 insertions, 10 deletions
diff --git a/src/templates/delete.php b/src/templates/confirm_deletion.php index 1be762b..77998ff 100644 --- a/src/templates/delete.php +++ b/src/templates/confirm_deletion.php @@ -6,10 +6,11 @@ <title>Bookmarks</title> </head> <body> + <a href="/">Back</a> <form action="/delete" method="POST"> <input type="hidden" name="id" value="<?php echo $bookmark->id; ?>"/> <?php echo $bookmark->url.' '.$bookmark->title.' '.$bookmark->tag; ?> - <button type="submit">Delete</button> + <button type="submit">Delete</button> </form> </body> </html> diff --git a/src/templates/add.php b/src/templates/create.php index a44c4d3..483e49e 100644 --- a/src/templates/add.php +++ b/src/templates/create.php @@ -6,11 +6,12 @@ <title>Bookmarks</title> </head> <body> - <form action="/add" method="POST"> + <a href="/">Back</a> + <form action="/store" method="POST"> <input type="text" name="url" maxlength="512" autofocus><br> <input type="text" name="title" maxlength="256" ><br> <input type="text" name="tag" maxlength="8" ><br> - <button type="submit">Add</button> + <button type="submit">Add</button> </form> </body> </html> diff --git a/src/templates/edit.php b/src/templates/edit.php index a3c6930..d5f5a08 100644 --- a/src/templates/edit.php +++ b/src/templates/edit.php @@ -6,12 +6,13 @@ <title>Bookmarks</title> </head> <body> - <form action="/edit" method="POST"> + <a href="/">Back</a> + <form action="/update" 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> + <button type="submit">Update</button> </form> </body> </html> diff --git a/src/templates/index.php b/src/templates/index.php index 1298985..ed84fd4 100644 --- a/src/templates/index.php +++ b/src/templates/index.php @@ -6,10 +6,11 @@ <title>Bookmarks</title> </head> <body> - <ul> - <?php foreach ($bookmarks as $bookmark) { ?> - <li><a href="/edit?id=<?php echo $bookmark->id; ?>"><?php echo $bookmark->title; ?></a> | <a href="/delete?id=<?php echo $bookmark->id; ?>">Delete</a></li> - <?php } ?> - </ul> + <a href="/create">Add</a> + <ul> + <?php foreach ($bookmarks as $bookmark) { ?> + <li><a href="/edit?id=<?php echo $bookmark->id; ?>"><?php echo $bookmark->title; ?></a> | <a href="/delete/confirm?id=<?php echo $bookmark->id; ?>">Delete</a></li> + <?php } ?> + </ul> </body> </html> |
