diff options
| author | Syndamia <kamen@syndamia.com> | 2025-02-01 11:55:53 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2025-02-01 11:55:53 +0200 |
| commit | 61c5b503352c983d4e532b5a59e2ae913e53e70c (patch) | |
| tree | 15ceba74eae8a30b413e56a64725d707a89554be /views | |
| parent | 0d87935bfd38f0cabecfaff374bd5ead221a494c (diff) | |
| download | nowayforward_human-61c5b503352c983d4e532b5a59e2ae913e53e70c.tar nowayforward_human-61c5b503352c983d4e532b5a59e2ae913e53e70c.tar.gz nowayforward_human-61c5b503352c983d4e532b5a59e2ae913e53e70c.zip | |
feat: Add create list button and improve new list page UI
Diffstat (limited to 'views')
| -rw-r--r-- | views/list/new/index.php | 12 | ||||
| -rw-r--r-- | views/profile/index.php | 12 | ||||
| -rw-r--r-- | views/styles.css | 13 |
3 files changed, 34 insertions, 3 deletions
diff --git a/views/list/new/index.php b/views/list/new/index.php index 72ac7a3..7f1aaf5 100644 --- a/views/list/new/index.php +++ b/views/list/new/index.php @@ -1,3 +1,7 @@ +<?php + if (isset($list_status) && $list_status === "") { + } +?> <script type="text/javascript"> if (!cookieStorage.getItem('token')) { window.location.href = '/login'; @@ -8,16 +12,20 @@ <hr class="new-section"/> -<form action="#" method="POST"> +<form action="#" method="POST" class="font-115 flex-col-centered max-width-20 center-margin"> <?php if (isset($list_status)): ?> <?php if ($list_status !== ""): ?> <p class="item error"><span> <strong>Error:</strong> <?= $list_status ?> </span></p> + <?php else: ?> + <script type="text/javascript"> + window.location.href = '/list/<?= $lid ?>'; + </script> <?php endif; ?> <?php endif; ?> <input type="text" name="name" placeholder="List title" minlength="1"> <textarea name="description" placeholder="Description"></textarea> - <input type="submit" value="Login"> + <input type="submit" value="Create"> </form> diff --git a/views/profile/index.php b/views/profile/index.php index c1e067d..4ade4e7 100644 --- a/views/profile/index.php +++ b/views/profile/index.php @@ -15,6 +15,18 @@ <div class="user-blank-afterspace"></div> + <section id="user-buttons" hidden> + <form action="/list/new" method="GET"> + <input type="submit" value="Create a new list"> + </form> + </section> + <script type="text/javascript"> + function showUserButtons() { + document.getElementById('user-buttons').hidden = false; + } + authenticated(showUserButtons); + </script> + <nav id="user-nav"> <button id="openArchives" onclick="openArchives()">Archives</button> <button id="openLists" onclick="openLists()" class="not-selected">Lists</button> diff --git a/views/styles.css b/views/styles.css index 440da4e..e2a712f 100644 --- a/views/styles.css +++ b/views/styles.css @@ -45,7 +45,7 @@ h1 { text-align: center; } -input, button { +input, button, textarea { color: inherit; background-image: url(/paper.jpg); @@ -63,6 +63,11 @@ input, button { box-shadow: 0 0 0.4em var(--dark-purple); } +textarea { + resize: vertical; + min-height: 4em; +} + input[type=text]:focus { outline: 2px solid var(--highlight-border-color); } @@ -394,6 +399,12 @@ hr.new-section { height: 4em; } +#user-buttons { + margin: 0 1em 2em 1em; + display: flex; + flex-direction: row; +} + #user-nav { display: flex; flex-direction: row; |
