diff options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/layouts/main.django | 6 | ||||
| -rw-r--r-- | templates/login.django | 61 | ||||
| -rw-r--r-- | templates/partials/search.django | 24 | ||||
| -rw-r--r-- | templates/posts.django | 61 | ||||
| -rw-r--r-- | templates/preferences.django | 48 | ||||
| -rw-r--r-- | templates/register.django | 80 |
6 files changed, 148 insertions, 132 deletions
diff --git a/templates/layouts/main.django b/templates/layouts/main.django index 5c9eeb6..2d9c241 100644 --- a/templates/layouts/main.django +++ b/templates/layouts/main.django @@ -8,7 +8,11 @@ <body> {% include 'partials/navbar.django' %} - <main>{{ embed }}</main> + <main> + {% block content %} + + {% endblock %} + </main> <footer> <p>© 2025 {{ Appname }}. All rights reserved.</p> diff --git a/templates/login.django b/templates/login.django index e3d632a..9e5ab88 100644 --- a/templates/login.django +++ b/templates/login.django @@ -1,33 +1,36 @@ -<h2>Login to {{ Appname }}</h2> +{% extends 'layouts/main.django' %} -{% if Error %} - <div class="error">{{ Error }}</div> -{% endif %} +{% block content %} + <h2>Login to {{ Appname }}</h2> -<form action="/login" method="POST"> - <table> - <tr> - <th colspan="2">User Login</th> - </tr> - <tr> - <td><label for="username">Username or Email:</label></td> - <td><input type="text" id="username" name="username" required value="{{ Username }}" /></td> - </tr> - <tr> - <td><label for="password">Password:</label></td> - <td><input type="password" id="password" name="password" required /></td> - </tr> - <tr> - <td colspan="2" class="center"> + {% if Error %} + <div class="error">{{ Error }}</div> + {% endif %} + + <form action="/login" method="POST"> + <fieldset> + <legend>User Login</legend> + + <div class="form-group"> + <label for="username">Username or Email:</label> + <input type="text" id="username" name="username" required value="{{ Username }}" /> + </div> + + <div class="form-group"> + <label for="password">Password:</label> + <input type="password" id="password" name="password" required /> + </div> + + <div class="form-actions"> <input type="submit" value="LOGIN" /> - </td> - </tr> - </table> -</form> + </div> + </fieldset> + </form> -<p> - Don't have an account? <a href="/register">Register here</a> -</p> -<p> - <a href="/forgot-password">Forgot your password?</a> -</p> + <p> + Don't have an account? <a href="/register">Register here</a> + </p> + <p> + <a href="/forgot-password">Forgot your password?</a> + </p> +{% endblock %} diff --git a/templates/partials/search.django b/templates/partials/search.django index 58c2480..7b66170 100644 --- a/templates/partials/search.django +++ b/templates/partials/search.django @@ -1,16 +1,8 @@ -<form action="/" method="GET"> - <div class="search-box"> - <table> - <tr> - <th>Search Posts</th> - </tr> - <tr> - <td> - <input type="text" name="tags" placeholder="tags..." value="{{ SearchQuery }}" /> - <input type="submit" value="SEARCH" /> - <input type="button" value="CLEAR" onclick="this.form.reset(); window.location.href='/';" /> - </td> - </tr> - </table> - </div> -</form> +<aside> + <form action="/" method="GET"> + <h3>Search Posts</h3> + <input type="text" name="tags" placeholder="tags..." value="{{ SearchQuery }}" /> + <input type="submit" value="SEARCH" /> + <input type="button" value="CLEAR" onclick="this.form.reset(); window.location.href='/';" /> + </form> +</aside> diff --git a/templates/posts.django b/templates/posts.django index 1a22b97..111c959 100644 --- a/templates/posts.django +++ b/templates/posts.django @@ -1,39 +1,34 @@ +{% extends 'layouts/main.django' %} {% include 'partials/search.django' %} +{% block content %} + <h2>{{ Title }}</h2> -<h2>{{ Title }}</h2> - -<div class="posts-grid"> - {% if Posts %} - {% for post in Posts %} - <div class="post-cell"> - <img src="/uploads/thumbnails/{{ post.FileName }}" alt="{{ post.Title }}" class="post-img" /> - <div class="post-title"> - {% if post.Title %} - {{ post.Title }} - {% else %} - Post #{{ post.ID }} - {% endif %} + <div class="posts-grid"> + {% if Posts %} + {% for post in Posts %} + <div class="post-cell"> + <img src="/uploads/thumbnails/{{ post.FileName }}" alt="{{ post.Title }}" class="post-img" /> + <div class="post-title"> + {% if post.Title %} + {{ post.Title }} + {% else %} + Post #{{ post.ID }} + {% endif %} + </div> + <div class="post-info">{{ post.Tags|length }} tags</div> </div> - <div class="post-info">{{ post.Tags|length }} tags</div> + {% endfor %} + {% else %} + <div class="empty-state"> + <h3>NO POSTS FOUND!</h3> + <p>Be the first to share something awesome!</p> + <input type="button" value="UPLOAD IMAGE" onclick="location.href='/upload'" /> </div> - {% endfor %} - {% else %} - <table class="post-table"> - <tr> - <th>NO POSTS FOUND!</th> - </tr> - <tr> - <td class="center"> - Be the first to share something awesome!<br> - <input type="button" value="UPLOAD IMAGE" onclick="location.href='/upload'"> - </td> - </tr> - </table> - {% endif %} -</div> + {% endif %} + </div> -<p class="center"> - <input type="button" value="UPLOAD IMAGE" onclick="location.href='/upload'"> -</p> + <p class="center"> + <input type="button" value="UPLOAD IMAGE" onclick="location.href='/upload'" /> + </p> <button class="secondary" onclick="location.href='/tags'">BROWSE TAGS</button> -</div> +{% endblock %} diff --git a/templates/preferences.django b/templates/preferences.django index 837d94a..53fc2fc 100644 --- a/templates/preferences.django +++ b/templates/preferences.django @@ -1,21 +1,33 @@ -<h2>Site Preferences</h2> +{% extends 'layouts/main.django' %} -<form id="preferences-form"> - <div> - <label>Theme</label> - <div> - <input type="radio" name="theme" value="light" id="theme-light" /> - <label for="theme-light">Light Mode</label> - </div> - <div> - <input type="radio" name="theme" value="dark" id="theme-dark" /> - <label for="theme-dark">Dark Mode</label> - </div> - </div> +{% block content %} + <h2>Site Preferences</h2> - <button type="submit">SAVE PREFERENCES</button> -</form> + <form id="preferences-form"> + <fieldset> + <legend>Theme Settings</legend> -<p> - <a href="/">Back to Posts</a> -</p> + <div class="form-group"> + <label>Theme</label> + <div class="radio-group"> + <div> + <input type="radio" name="theme" value="light" id="theme-light" /> + <label for="theme-light">Light Mode</label> + </div> + <div> + <input type="radio" name="theme" value="dark" id="theme-dark" /> + <label for="theme-dark">Dark Mode</label> + </div> + </div> + </div> + + <div class="form-actions"> + <button type="submit">SAVE PREFERENCES</button> + </div> + </fieldset> + </form> + + <p> + <a href="/">Back to Posts</a> + </p> +{% endblock %} diff --git a/templates/register.django b/templates/register.django index c096104..2d0e8b2 100644 --- a/templates/register.django +++ b/templates/register.django @@ -1,35 +1,45 @@ -<h2>Join {{ Appname }}</h2> - -{% if Error %} - <div class="error-message">{{ Error }}</div> -{% endif %} - -<form action="/register" method="POST"> - <div> - <label for="username">Username</label> - <input type="text" id="username" name="username" required value="{{ Username }}" minlength="3" maxlength="72" pattern="[a-zA-Z0-9_-]+" /> - <small>3-72 characters, letters, numbers, underscores, and hyphens only</small> - </div> - - <div> - <label for="email">Email Address</label> - <input type="email" id="email" name="email" required value="{{ Email }}" /> - </div> - - <div> - <label for="password">Password</label> - <input type="password" id="password" name="password" required minlength="8" /> - <small>Minimum 8 characters</small> - </div> - - <div> - <label for="confirm_password">Confirm Password</label> - <input type="password" id="confirm_password" name="confirm_password" required /> - </div> - - <button type="submit">CREATE ACCOUNT</button> -</form> - -<p> - Already have an account? <a href="/login">Login here</a> -</p> +{% extends 'layouts/main.django' %} + +{% block content %} + <h2>Join {{ Appname }}</h2> + + {% if Error %} + <div class="error">{{ Error }}</div> + {% endif %} + + <form action="/register" method="POST"> + <fieldset> + <legend>Create Account</legend> + + <div class="form-group"> + <label for="username">Username</label> + <input type="text" id="username" name="username" required value="{{ Username }}" minlength="3" maxlength="72" pattern="[a-zA-Z0-9_-]+" /> + <small>3-72 characters, letters, numbers, underscores, and hyphens only</small> + </div> + + <div class="form-group"> + <label for="email">Email Address</label> + <input type="email" id="email" name="email" required value="{{ Email }}" /> + </div> + + <div class="form-group"> + <label for="password">Password</label> + <input type="password" id="password" name="password" required minlength="8" /> + <small>Minimum 8 characters</small> + </div> + + <div class="form-group"> + <label for="confirm_password">Confirm Password</label> + <input type="password" id="confirm_password" name="confirm_password" required /> + </div> + + <div class="form-actions"> + <button type="submit">CREATE ACCOUNT</button> + </div> + </fieldset> + </form> + + <p> + Already have an account? <a href="/login">Login here</a> + </p> +{% endblock %} |
