aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-08-03 00:00:14 +0530
committerBobby <[email protected]>2022-08-03 00:00:14 +0530
commitb8d23af07d03fa3cbbe76169572118290a879421 (patch)
treea511aa355b247c8e7cce22a47463d6ccc026bb2f
parent9a945c6c9bef1e465b44317844c79b4e39bce69c (diff)
downloadthatcomputerscientist-b8d23af07d03fa3cbbe76169572118290a879421.tar.xz
thatcomputerscientist-b8d23af07d03fa3cbbe76169572118290a879421.zip
Move templates to root directory
-rw-r--r--templates/blog/account.html93
-rw-r--r--templates/blog/home.html28
-rw-r--r--templates/blog/homepage.html7
-rw-r--r--templates/blog/partials/base.html23
-rw-r--r--templates/blog/partials/sidebar.html69
5 files changed, 220 insertions, 0 deletions
diff --git a/templates/blog/account.html b/templates/blog/account.html
new file mode 100644
index 00000000..e219e978
--- /dev/null
+++ b/templates/blog/account.html
@@ -0,0 +1,93 @@
+{% extends 'blog/partials/base.html' %} {% block content %}
+<div class="main">
+ <h1>My Account</h1>
+ <p>You can change account settings for <strong>{{ user.username }}</strong> here. If you wish to have additional support, please contact me at <a href="mailto:[email protected]?subject=[URGENT]%20Support%20Request%20for%20{{ user.username }}">[email protected]</a>. Please take care of the following points before you submit your support request:</p>
+ <ul>
+ <li>Please do not edit the subject line.</li>
+ <li>As an individual monitoring this email, I request you to refrain yourself from spamming.</li>
+ <li>Please do not include any sensitive information (like credit card numbers, passwords, etc.) in the email.</li>
+ <li>Allow me upto 48 hours to respond to your support request.</li>
+ <li>Do not send multiple support requests.</li>
+ <li>Please note that this is a support request related to your account. Please do not file any bugs here. If you have noticed a bug, please report it to the <a href="https://github.com/luciferreeves/thatcomputerscientist/issues">GitHub Issues</a> page.</li>
+ </ul>
+ <p>Your avatar is fetched from gravatar. Update your gravatar email to fetch the avatar. If you don't have an account, you can sign up for one <a href="https://en.gravatar.com/" target="_blank">here</a>. If you haven't set up your gravatar email, we would try to fetch your profile picture from your account email, by default. If your account email and gravatar email are the same, you do not need to set a gravatar email.</p>
+ {% if user_subdomain_url %}
+ {% load replace %}
+ <div class="alert" style="padding: 0 10px">
+ <p>Your account is publicly accessible at <a href="{{ user_subdomain_url }}">{{ user_subdomain_url|replace:"https://"|replace:"http://" }}</a>. If you wish to change your account to private, you can do so below.</p>
+ </div>
+ {% endif %}
+ {% for message in messages %}
+ <div class="alert {{message.tags}}">
+ <p>{{ message }}</p>
+ </div>
+ {% endfor %}
+ <div class="account">
+ <div class="ac-sidebar">
+ <fieldset>
+ <legend>Avatar</legend>
+ <img src="https://www.gravatar.com/avatar/{{avatar}}?s=200" alt="{{ user.username }}'s avatar" width="200" height="200"/>
+ </fieldset>
+ <form method="post" action="{% url 'users:changepassword' %}">
+ {% csrf_token %}
+ <fieldset>
+ <legend>Change Password</legend>
+ <label for="oldPassword">Current Password</label>
+ <input type="password" name="oldPassword" id="oldPassword" placeholder="Current Password" />
+ <label for="newPassword">New Password</label>
+ <input type="password" name="newPassword" id="newPassword" placeholder="New Password" />
+ <label for="confirmPassword">Confirm New Password</label>
+ <input type="password" name="confirmPassword" id="confirmPassword" placeholder="Confirm New Password" />
+ <input type="submit" value="Change Password" />
+ </fieldset>
+ </form>
+ <form method="post" onsubmit="event.preventDefault();">
+ <fieldset>
+ <legend class="error">Delete Account</legend>
+ <input type="submit" value="Delete Account" />
+ </fieldset>
+ </form>
+ </div>
+ <div class="ac-main">
+ <form method="post" action="{% url 'users:update' %} ">
+ {% csrf_token %}
+ <fieldset>
+ <legend>Account Details</legend>
+ <label for="firstname">First Name</label>
+ <input type="text" name="firstname" id="firstname" value="{{ user.first_name }}" placeholder="First Name" />
+ <label for="lastname">Last Name</label>
+ <input type="text" name="lastname" id="lastname" value="{{ user.last_name }}" placeholder="Last Name" />
+ <label for="gravatarEmail">Gravatar Email</label>
+ <input type="text" name="gravatarEmail" id="gravatarEmail" value="{{ user_profile.gravatar_email }}" placeholder="Gravatar Email" />
+ <label for="location">Location</label>
+ <input type="text" name="location" id="location" value="{{ user_profile.location }}" placeholder="Location" maxlength="50"/>
+ <label for="bio">Bio</label>
+ <textarea name="bio" id="bio" placeholder="Bio">{{ user_profile.bio }}</textarea>
+ <label for="isPublic">Account Visibility</label>
+ <select name="isPublic" id="isPublic">
+ <option value="1"{% if user_profile.is_public %} selected{% endif %}>Public</option>
+ <option value="0"{% if not user_profile.is_public %} selected{% endif %}>Private</option>
+ </select>
+ {% if user_profile.is_public %}
+ <label for="emailPublic">Email Visibility</label>
+ <select name="emailPublic" id="emailPublic">
+ <option value="1"{% if user_profile.email_public %} selected{% endif %}>Public</option>
+ <option value="0"{% if not user_profile.email_public %} selected{% endif %}>Private</option>
+ </select>
+ {% endif %}
+ <input type="submit" value="Update Account" />
+ </fieldset>
+ </form>
+ <form method="post" action = "{% url 'users:sendchangeuseremail' %}">
+ {% csrf_token %}
+ <fieldset>
+ <legend>Change Email</legend>
+ <label for="email">Your current registered email is <em><u>{{ user.email }}</u></em>. Please note that a verification email will be sent to the new email address in order to update the current email address. Please provide the new email address in the box below:</label>
+ <input type="email" name="email" id="email" placeholder="New Email" />
+ <input type="submit" value="Change Email" />
+ </fieldset>
+ </form>
+ </div>
+ </div>
+</div>
+{% endblock %}
diff --git a/templates/blog/home.html b/templates/blog/home.html
new file mode 100644
index 00000000..5f1e93f2
--- /dev/null
+++ b/templates/blog/home.html
@@ -0,0 +1,28 @@
+{% extends 'blog/partials/base.html' %} {% block content %}
+<div class="main">
+ <div class="alert">
+ <h1 class="center">That Computer Scientist</h1>
+ <p>
+ Welcome to the home of That Computer Scientist. This is my personal
+ website where I share all of my thoughts, ideas, and experiences. To know
+ more about me, please visit my <a href="/about">About</a> page. If you
+ would like to connect with me, please visit my
+ <a href="/contact">Contact</a> page. Please use the sidebar to navigate
+ the site.
+ </p>
+ </div>
+ <br />
+ <div class="alert" style="background-color: rgb(223, 255, 243)">
+ <p>
+ This website is a work in progress. I am currently working on adding more
+ features to this website. I aim to build a retro looking personal website,
+ where I will share my articles and Ideas, which will be built entirely
+ around the idea of "collaborative writing" — where anyone can write new
+ articles or edit existing ones.
+ </p>
+ </div>
+ <section>
+ <h2>Recent Posts</h2>
+ </section>
+</div>
+{% endblock %}
diff --git a/templates/blog/homepage.html b/templates/blog/homepage.html
new file mode 100644
index 00000000..0cd3051f
--- /dev/null
+++ b/templates/blog/homepage.html
@@ -0,0 +1,7 @@
+{% extends 'blog/partials/base.html' %} {% block content %}
+<div class="main">
+ <section>
+ <h2>My Homepage</h2>
+ </section>
+</div>
+{% endblock %}
diff --git a/templates/blog/partials/base.html b/templates/blog/partials/base.html
new file mode 100644
index 00000000..01310201
--- /dev/null
+++ b/templates/blog/partials/base.html
@@ -0,0 +1,23 @@
+{% load static %}
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta
+ name="description"
+ content="Welcome to the home of That Computer Scientist. I am Kumar Priyansh. This is my personal website where I share all of my thoughts, ideas, and experiences."
+ />
+ <title>That Computer Scientist - {{ title }}</title>
+ <link preload rel="stylesheet" href="{% static 'css/main.css' %}" />
+ <link rel="apple-touch-icon" sizes="180x180" href="{% static 'images/favicons/apple-touch-icon.png' %}">
+ <link rel="icon" type="image/png" sizes="32x32" href="{% static 'images/favicons/favicon-32x32.png' %}">
+ <link rel="icon" type="image/png" sizes="16x16" href="{% static 'images/favicons/favicon-16x16.png' %}">
+ <link rel="manifest" href="{% static 'images/favicons/site.webmanifest' %}">
+ </head>
+ <body>
+ {% include 'blog/partials/sidebar.html' %}
+ {% block content %} {% endblock %}
+ </body>
+</html>
diff --git a/templates/blog/partials/sidebar.html b/templates/blog/partials/sidebar.html
new file mode 100644
index 00000000..cd46c18a
--- /dev/null
+++ b/templates/blog/partials/sidebar.html
@@ -0,0 +1,69 @@
+{% load static %}
+<div class="sidebar">
+ <a href="/" class="title">
+ <img src="{% static 'images/logo.png' %}" alt="That Computer Scientist Logo" width="10rem" height="3.23rem">
+ <!-- Login Box -->
+ </a>
+ {% if user.is_authenticated %}
+ <div class="login-box">
+ <p>Welcome, {{ user.username }}!</p>
+ <button type="submit" onclick="location.href='{% url 'users:logout' %}'">Logout</button>
+ </div>
+ {% else %}
+ <fieldset>
+ <legend>Login Area</legend>
+ <form method="post" action="{% url 'users:login' %} ">
+ {% csrf_token %}
+ <label for="username">Username</label>
+ <input type="text" id="username" name="username" placeholder="Username" autocomplete="off">
+ <label for="password">Password</label>
+ <input type="password" id="password" name="password" placeholder="Password">
+ <input type="hidden" name="next" value="{{ request.path }}">
+ <input type="submit" value="Login">
+ </form>
+ {% for message in messages %}
+ {% if message.message == "EVERR" %}
+ <form method="post" action="{% url 'users:sendverificationemail' %}" >
+ <p class="{{message.tags}}">
+ Your email is unverified. Please check your inbox for a verification email or to request a new verification email by clicking{% csrf_token %}<input type="hidden" name="username"><input style="display: inline; background: none; border: none; color: blue; text-decoration: underline; cursor: pointer; margin: 0;" type="submit" value="here.">
+ </p>
+ </form>
+ {% else %}
+ <p class="{{message.tags}}">{{message.message}}</p>
+ {% endif %}
+ {% endfor %}
+ </fieldset>
+ {% endif %}
+ <br>
+ <fieldset>
+ <legend>Navigation</legend>
+ <nav>
+ <ul>
+ <li><a href="/">Home</a></li>
+ <li><a href="/about">About</a></li>
+ <li><a href="/contact">Contact</a></li>
+ <li><a href="/blog">Blog</a></li>
+ {% if user.is_authenticated %}
+ <li><a href="{% url 'account' %}">My Account</a></li>
+ <li><a href="{% url 'homepage' %}">My Homepage<a></li>
+ {% else %}
+ <li><a href="/register">Register</a></li>
+ {% endif %}
+ {% if user.is_superuser %}
+ <li><a href="/admin">Administration</a></li>
+ {% endif %}
+ </ul>
+ </nav>
+ </fieldset>
+</div>
+
+<script>
+ // get the username parameter from the url
+ var username = new URLSearchParams(window.location.search).get('username');
+ // if the username parameter is not empty, set the username input to the value of the username parameter
+ if (username) {
+ document.getElementsByName("username").forEach(function(input) {
+ input.value = username;
+ });
+ }
+</script>