update signup form and admin panel

Nate created

Change summary

server/styles.css              |   4 +
server/templates/admin.hbs     | 130 +++++++++++++++++++----------------
server/templates/community.hbs |   5 
3 files changed, 79 insertions(+), 60 deletions(-)

Detailed changes

server/styles.css 🔗

@@ -58,6 +58,10 @@
     break-inside: avoid;
   }
 
+  .alternate-bg:nth-of-type(even) {
+    background-color: rgba(255,255,255,0.06);
+  }
+  
   /* This fixes scrollbar jump */
   @media screen and (min-width: 960px) {
     html {

server/templates/admin.hbs 🔗

@@ -20,66 +20,80 @@
     });
 </script>
 
-<div class="max-w-screen-lg p-20 mx-auto text-white text-main font-extralight">
-        <h1 class="mb-10 font-display font-extralight">Admin</h1>
-        <h2 class="mb-4 text-xl font-bold border-b border-gray-300">Users</h1>
-        <table class="table text-white" id="users">
-            <tr>
-                <th class="pr-2 text-left">GitHub Login</th>
-                <th class="pr-2 text-left">Admin</th>
-                <th></th>
-            </tr>
-            <form action="/users" method="post" class="m-0 mb-4">
-                <tr>
-                    <td>
-                        <input name="github_login" type="text" class="w-48 p-1 mr-2 border border-gray-300"
-                            placeholder="@github_handle">
-                    </td>
-                    <td>
-                        <input type="checkbox" id="admin" name="admin" value="true">
-                    </td>
-                    <td class="text-right">
-                        <button class="w-20 p-1 text-white bg-gray-600 rounded-md hover:bg-black">Add</button>
-                    </td>
-                </tr>
+<div class="h-screen text-white border-r border-white text-main font-extralight">
+    <div class="flex flex-row items-center justify-between p-5 border-b border-white pl-7 pr-7 admin-nav">
+        <h1 class="font-display font-extralight">Admin</h1>
+        <ul class="flex flex-row">
+            <li><a href="#userlist" class="mr-4 leading-loose no-underline lowercase text-main hover:underline">Users</a></li>
+            <li><a href="#signuplist" class="leading-loose no-underline lowercase text-main hover:underline">Signups</a></li>
+        </ul>
+    </div>
+
+    <h2 id="userlist" class="pt-10 mb-5 text-white pl-7 pr-7 font-display font-extralight">Users</h2>
+    
+    <div class="flex flex-col w-full pb-5 font-mono text-xs" id="users">
+        <div class="flex flex-row pl-5 pr-10 font-bold">
+            <p class="w-1/3 p-2">Github Username</p>
+            <p class="w-32 p-2 text-center">Admin</p>
+            <p class="w-24 p-2"> </p>
+        </div>
+        <div class="flex flex-col pl-5 pr-10 text-gray-100">
+            <form action="/users" method="post" class="m-0">
+                <div class="flex flex-row items-center">
+                    <p class="w-1/3 p-2"><input class="block w-full p-2 text-xs bg-transparent border border-white" type="text" name="github_login" required minlength="4" placeholder="@github_handle"></p>
+                    <p class="w-32 p-2 text-center"><input type="checkbox" id="admin" name="admin" value="true"></p>
+                    <p class="w-24 p-2"><button class="underline hover:no-underline">Add</button></p>
+                </div>
+            </form>
+        </div>
+    </div>
+    
+    <div class="flex flex-col w-full pb-10 font-mono text-xs border-b border-white">
+        <div class="flex flex-row pl-5 pr-10 font-bold">
+            <p class="w-1/3 p-2">Github Username</p>
+            <p class="w-32 p-2 text-center">Admin</p>
+            <p class="w-24 p-2"> </p>
+        </div>
+        {{#each users}}
+        <div class="flex flex-col pl-5 pr-10 text-gray-100 alternate-bg">
+            <form action="/users/{{id}}/delete" method="post" class="m-0">
+                <div class="flex flex-row items-center">
+                    <p class="w-1/3 p-2">{{github_login}}</p>
+                    <p class="w-32 p-2 text-center"><input action="/users/{{id}}" type="checkbox" {{#if admin}}checked{{/if}}></p>
+                    <p class="w-24 p-2"><button class="underline hover:no-underline">Remove</button></p>
+                </div>
             </form>
+        </div>
+        {{/each}}
+    </div>
 
-            {{#each users}}
-            <tr>
-                <form action="/users/{{id}}/delete" method="post">
-                    <td class="py-1 text-white">
-                        {{github_login}}
-                    </td>
-                    <td>
-                        <input action="/users/{{id}}" type="checkbox" {{#if admin}}checked{{/if}}>
-                    </td>
-                    <td class="text-right">
-                        <button class="w-20 p-1 text-white bg-gray-600 rounded-md hover:bg-black">Remove</button>
-                    </td>
-                </form>
-            </tr>
-            {{/each}}
-        </table>
+    <h2 class="pt-10 mb-5 text-white pl-7 pr-7 font-display font-extralight">Signups</h2>
 
-        <h2 class="mt-8 mb-4 text-xl font-bold border-b border-gray-300">Signups</h1>
-        <table class="table text-white">
-            {{#each signups}}
-            <tr>
-                <form action="/signups/{{id}}/delete" method="post">
-                    <td class="align-top">{{github_login}}</td>
-                    <td class="pl-4 align-top">{{email_address}}</td>
-                    <td class="pl-4 align-top">{{about}}</td>
-                    <td class="pl-4 align-top">
-                         {{#if wants_releases}}releases{{/if}}
-                         {{#if wants_updates}}updates{{/if}}
-                         {{#if wants_community}}community{{/if}}
-                     </td>
-                    <td class="text-right">
-                        <button class="w-20 p-1 text-white bg-gray-600 rounded-md hover:bg-black">Remove</button>
-                    </td>
-                </form>
-            </tr>
-            {{/each}}
-        </table>
+    <div class="flex flex-col w-full pb-10 font-mono text-xs border-b border-white">
+        
+        <div class="flex flex-row justify-between pl-5 pr-10 font-bold">
+            <p class="w-1/5 p-2">Email</p>
+            <p class="w-1/5 p-2">Github</p>
+            <p class="w-24 p-2 text-center">Releases</p>
+            <p class="w-24 p-2 text-center">Updates</p>
+            <p class="w-24 p-2 text-center">Community</p>
+            <p class="w-24 p-2 text-right">Remove</p>
+        </div>
+        {{#each signups}}
+        <div class="flex flex-col pb-1 pl-5 pr-10 text-gray-100 alternate-bg">
+            <form action="/signups/{{id}}/delete" method="post" class="m-0">
+                <div class="flex flex-row items-center justify-between">
+                    <p class="w-1/5 p-2 pb-1">{{email_address}}</p>
+                    <p class="w-1/5 p-2 pb-1">{{github_login}}</p>
+                    <p class="w-24 p-2 pb-1 text-center">{{#if wants_releases}}[✓]{{else}}[ ]{{/if}}</p>
+                    <p class="w-24 p-2 pb-1 text-center">{{#if wants_updates}}[✓]{{else}}[ ]{{/if}}</p>
+                    <p class="w-24 p-2 pb-1 text-center">{{#if wants_community}}[✓]{{else}}[ ]{{/if}}</p>
+                    <p class="w-24 p-2 pb-1 text-right"><button class="text-lg text-gray-500 hover:text-white">×</button></p>
+                </div>
+            </form>
+            <p class="max-w-full p-2 pt-0 overflow-hidden leading-normal text-gray-400 max-h-5 whitespace-nowrap overflow-ellipsis" title="{{about}}">{{about}}</p>
+        </div>
+        {{/each}}
+    </div>
 </div>
 {{/layout}}

server/templates/community.hbs 🔗

@@ -28,8 +28,9 @@
             </li>
         </ul>
         <input class="block w-2/3 p-5 mt-10 text-lg bg-transparent border border-white" type="text" id="form-email" name="email_address" required minlength="4" placeholder="Your email">
-        <input class="block w-2/3 p-5 mt-10 text-lg bg-transparent border border-white" type="text" id="form-gh" name="email_address" name="github_login" placeholder="Github Username">
-        
+        <input class="block w-2/3 p-5 mt-10 text-lg bg-transparent border border-white" type="text" id="form-gh" name="github_login" placeholder="Github Username">
+        <input class="block w-2/3 p-5 mt-10 text-lg bg-transparent border border-white" type="text" name="about">
+
         <button href="/story" class="block mt-10 text-lg underline">Join the waitlist.</button>
     </form>