diff options
Diffstat (limited to 'src/templates')
| -rw-r--r-- | src/templates/confirm_deletion.php | 19 | ||||
| -rw-r--r-- | src/templates/create.php | 17 | ||||
| -rw-r--r-- | src/templates/edit.php | 19 | ||||
| -rw-r--r-- | src/templates/form_fields.php | 6 | ||||
| -rw-r--r-- | src/templates/index.php | 25 | 
5 files changed, 58 insertions, 28 deletions
diff --git a/src/templates/confirm_deletion.php b/src/templates/confirm_deletion.php index 06e133f..12c5cd1 100644 --- a/src/templates/confirm_deletion.php +++ b/src/templates/confirm_deletion.php @@ -4,13 +4,20 @@          <meta charset="utf-8">          <meta name="viewport" content="width=device-width, initial-scale=1">          <title>Confirm - Bookmarks</title> +        <link rel="shortcut icon" href="/images/favicon.png"> +        <link rel="stylesheet" href="/css/site.css">      </head>      <body> -        <a href="/">Back</a> -        <form action="/delete" method="POST"> -            <input type="hidden" name="id" value="<?php echo $bookmark->id; ?>"/> -            <?php echo htmlentities($bookmark->url.' '.$bookmark->title.' '.$bookmark->tag); ?> -            <button type="submit">Delete</button> -        </form> +        <section> +            <h1>Bookmarks</h1> +            <h2>Confirm Deletion</h2> +            <a href="/">Back</a> +            <form action="/delete" method="POST"> +                <input type="hidden" name="id" value="<?php echo $bookmark->id; ?>"/> +                <?php echo htmlentities("$bookmark->url | $bookmark->title | $bookmark->tag"); ?> +                <button type="submit">Delete</button> +            </form> +            <p>Copyright © 2021 David T. Sadler.</p> +        </section>      </body>  </html> diff --git a/src/templates/create.php b/src/templates/create.php index 37004ff..21df9a8 100644 --- a/src/templates/create.php +++ b/src/templates/create.php @@ -4,12 +4,19 @@          <meta charset="utf-8">          <meta name="viewport" content="width=device-width, initial-scale=1">          <title>Add - Bookmarks</title> +        <link rel="shortcut icon" href="/images/favicon.png"> +        <link rel="stylesheet" href="/css/site.css">      </head>      <body> -        <a href="/">Back</a> -        <form action="/store" method="POST"> -            <?php require_once('form_fields.php'); ?> -            <button type="submit">Add</button> -        </form> +        <section> +            <h1>Bookmarks</h1> +            <h2>Add</h2> +            <a href="/">Back</a> +            <form action="/store" method="POST"> +                <?php require_once('form_fields.php'); ?> +                <button type="submit">Add</button> +            </form> +            <p>Copyright © 2021 David T. Sadler.</p> +        </section>      </body>  </html> diff --git a/src/templates/edit.php b/src/templates/edit.php index b462e7e..100cd0e 100644 --- a/src/templates/edit.php +++ b/src/templates/edit.php @@ -4,13 +4,20 @@          <meta charset="utf-8">          <meta name="viewport" content="width=device-width, initial-scale=1">          <title>Edit - Bookmarks</title> +        <link rel="shortcut icon" href="/images/favicon.png"> +        <link rel="stylesheet" href="/css/site.css">      </head>      <body> -        <a href="/">Back</a> -        <form action="/update" method="POST"> -            <input type="hidden" name="id" value="<?php echo $bookmark->id; ?>"/> -            <?php require_once('form_fields.php'); ?> -            <button type="submit">Update</button> -        </form> +        <section> +            <h1>Bookmarks</h1> +            <h2>Edit</h2> +            <a href="/">Back</a> +            <form action="/update" method="POST"> +                <input type="hidden" name="id" value="<?php echo $bookmark->id; ?>"/> +                <?php require_once('form_fields.php'); ?> +                <button type="submit">Update</button> +            </form> +            <p>Copyright © 2021 David T. Sadler.</p> +        </section>      </body>  </html> diff --git a/src/templates/form_fields.php b/src/templates/form_fields.php index 3f54040..3005ee8 100644 --- a/src/templates/form_fields.php +++ b/src/templates/form_fields.php @@ -1,12 +1,12 @@ -<input type="text" name="url" maxlength="512" value="<?php echo htmlspecialchars($old->get('url', $bookmark->url)); ?>" autofocus><br> +<label>URL<input type="text" name="url" maxlength="512" value="<?php echo htmlspecialchars($old->get('url', $bookmark->url)); ?>" autofocus></label>  <?php if ($errors->has('url')) { ?>      <p><?php echo implode(', ', $errors->get('url')); ?></p>  <?php } ?> -<input type="text" name="title" maxlength="256" value="<?php echo htmlspecialchars($old->get('title', $bookmark->title)); ?>"><br> +<label>Title<input type="text" name="title" maxlength="256" value="<?php echo htmlspecialchars($old->get('title', $bookmark->title)); ?>"></label>  <?php if ($errors->has('title')) { ?>      <p><?php echo implode(', ', $errors->get('title')); ?></p>  <?php } ?> -<input type="text" name="tag" maxlength="8" value="<?php echo htmlspecialchars($old->get('tag', $bookmark->tag)); ?>"><br> +<label>Tag<input type="text" name="tag" maxlength="8" value="<?php echo htmlspecialchars($old->get('tag', $bookmark->tag)); ?>"></label>  <?php if ($errors->has('tag')) { ?>      <p><?php echo implode(', ', $errors->get('tag')); ?></p>  <?php } ?> diff --git a/src/templates/index.php b/src/templates/index.php index 4f76614..c046e6c 100644 --- a/src/templates/index.php +++ b/src/templates/index.php @@ -4,16 +4,25 @@          <meta charset="utf-8">          <meta name="viewport" content="width=device-width, initial-scale=1">          <title>Bookmarks</title> +        <link rel="shortcut icon" href="/images/favicon.png"> +        <link rel="stylesheet" href="/css/site.css">      </head>      <body> -        <?php if ($message) { ?> -            <p><?php echo $message; ?></p> -        <?php } ?> -        <a href="/create">Add</a> -        <ul> -            <?php foreach ($bookmarks as $bookmark) { ?> -                <li><a href="<?php echo htmlentities($bookmark->url); ?>"><?php echo $bookmark->title != '' ? htmlentities($bookmark->title) : htmlentities($bookmark->url); ?></a> <a href="/edit?id=<?php echo $bookmark->id; ?>">Edit</a> | <a href="/delete/confirm?id=<?php echo $bookmark->id; ?>">Delete</a></li> +        <section> +            <h1>Bookmarks</h1> +            <?php if ($message) { ?> +                <p class="message"><?php echo $message; ?></p>              <?php } ?> -        </ul> +            <a href="/create">Add Bookmark</a> +            <h2>Tags</h2> +            <a href="/">All</a> +            <h2>Bookmarks</h2> +            <ol> +                <?php foreach ($bookmarks as $bookmark) { ?> +                    <li><a href="<?php echo htmlentities($bookmark->url); ?>"><?php echo (new DateTime($bookmark->addedAt))->format('Y-m-d'); ?> - <?php echo $bookmark->title != '' ? htmlentities($bookmark->title) : htmlentities($bookmark->url); ?></a> | <a class="no-decoration" href="/edit?id=<?php echo $bookmark->id; ?>">Edit</a> | <a class="no-decoration" href="/delete/confirm?id=<?php echo $bookmark->id; ?>">Delete</a></li> +                <?php } ?> +            </ol> +            <p>Copyright © 2021 David T. Sadler.</p> +        </section>      </body>  </html>  | 
