aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorBobby <[email protected]>2025-07-07 22:57:31 +0530
committerBobby <[email protected]>2025-07-07 22:57:31 +0530
commit52a0248c1c81a14699b3d33ba7efe0c56bbe7477 (patch)
tree02d35fee769d518beb5dd01715e84d13ea421d51 /templates
parentb6a04140f2668a0dcae4befcd272e05b75bd14e5 (diff)
downloadimageboard-52a0248c1c81a14699b3d33ba7efe0c56bbe7477.tar.xz
imageboard-52a0248c1c81a14699b3d33ba7efe0c56bbe7477.zip
massive y2k retro overhaul with sidebar, context processors, and proper database organization
Diffstat (limited to 'templates')
-rw-r--r--templates/home.django5
-rw-r--r--templates/layouts/main.django12
-rw-r--r--templates/partials/navbar.django27
-rw-r--r--templates/partials/sidebar.django44
4 files changed, 70 insertions, 18 deletions
diff --git a/templates/home.django b/templates/home.django
new file mode 100644
index 0000000..e23df14
--- /dev/null
+++ b/templates/home.django
@@ -0,0 +1,5 @@
+{% extends 'layouts/main.django' %}
+{% include 'partials/search.django' %}
+{% block content %}
+ <h2>{{ Title }}</h2>
+{% endblock %}
diff --git a/templates/layouts/main.django b/templates/layouts/main.django
index 2d9c241..6f0407e 100644
--- a/templates/layouts/main.django
+++ b/templates/layouts/main.django
@@ -7,17 +7,19 @@
</head>
<body>
{% include 'partials/navbar.django' %}
-
<main>
- {% block content %}
+ <aside class="sidebar">
+ {% include 'partials/sidebar.django' %}
+ </aside>
+ <section class="content">
+ {% block content %}
- {% endblock %}
+ {% endblock %}
+ </section>
</main>
<footer>
<p>&copy; 2025 {{ Appname }}. All rights reserved.</p>
</footer>
-
- <script src="/scripts/theme.js"></script>
</body>
</html>
diff --git a/templates/partials/navbar.django b/templates/partials/navbar.django
index 52596ee..70e7950 100644
--- a/templates/partials/navbar.django
+++ b/templates/partials/navbar.django
@@ -1,23 +1,24 @@
<nav>
<div class="nav-left">
- <a href="/">{{ Appname }}</a>
- <a href="/" class="{% if request.path == '/' %}active{% endif %}">POSTS</a>
- <a href="/comments" class="{% if request.path == '/comments' %}active{% endif %}">COMMENTS</a>
- <a href="/tags" class="{% if request.path == '/tags' %}active{% endif %}">TAGS</a>
- {% if User %}{% if User.IsAdmin %}
- <a href="/users" class="{% if request.path == '/users' %}active{% endif %}">USERS</a>
- {% endif %}{% endif %}
+ <a href="/" class="nav-title">★彡 {{ Appname }} 彡★</a>
+ <a href="/posts">Posts</a>
+ <a href="/comments">Comments</a>
+ <a href="/tags">Tags</a>
+ {% if User and User.IsJanitor %}
+ <a href="/users">Users</a>
+ {% endif %}
</div>
<div class="nav-right">
{% if User %}
- <a href="/account">{{ User.Username }}</a>
- <a href="/preferences" class="{% if request.path == '/preferences' %}active{% endif %}">⚙</a>
- <a href="/logout">LOGOUT</a>
+ <a href="/account" class="user-status">{{ User.Username }}</a>
+ <a href="/logout">Logout</a>
{% else %}
- <a href="/login" class="{% if request.path == '/login' %}active{% endif %}">LOGIN</a>
- <a href="/register" class="{% if request.path == '/register' %}active{% endif %}">REGISTER</a>
- <a href="/preferences" class="{% if request.path == '/preferences' %}active{% endif %}">⚙</a>
+ <span class="user-status">Guest</span>
+ <a href="/login">Login</a>
+ <a href="/register">Register</a>
{% endif %}
+ <a href="/preferences">Preferences</a>
+ <a href="/help">Help</a>
</div>
</nav>
diff --git a/templates/partials/sidebar.django b/templates/partials/sidebar.django
new file mode 100644
index 0000000..79a747b
--- /dev/null
+++ b/templates/partials/sidebar.django
@@ -0,0 +1,44 @@
+<div>
+ <h3>♡ Popular Tags</h3>
+ <div class="sidebar-content">
+ {% for tag in PopularTags %}
+ <a href="/posts?tags={{ tag.Name }}" style="color: {{ tag.Type.Color }};" class="sidebar-tag">{{ tag.Name }} <span class="tag-count">({{ tag.Count }})</span></a>
+ {% endfor %}
+ {% if not PopularTags %}
+ <p>No popular tags found.</p>
+ {% endif %}
+ </div>
+</div>
+
+<div>
+ <h3>☆ Site Stats</h3>
+ <div class="sidebar-content">
+ <p class="sidebar-stat">
+ Posts: <span class="sidebar-stat-value">{{ SiteStats.Posts }}</span>
+ </p>
+ <p class="sidebar-stat">
+ Tags: <span class="sidebar-stat-value">{{ SiteStats.Tags }}</span>
+ </p>
+ <p class="sidebar-stat">
+ Today: <span class="sidebar-stat-value">{{ SiteStats.Today }}</span>
+ </p>
+ <p class="sidebar-stat">
+ Storage: <span class="sidebar-stat-value">{{ SiteStats.Storage }}</span>
+ </p>
+ <p class="sidebar-stat">
+ Comments: <span class="sidebar-stat-value">{{ SiteStats.Comments }}</span>
+ </p>
+ </div>
+</div>
+
+<div>
+ <h3>★ Recent Tags</h3>
+ <div class="sidebar-content">
+ {% for tag in RecentTags %}
+ <a href="/posts?tags={{ tag.Name }}" style="color: {{ tag.Type.Color }};" class="sidebar-tag">{{ tag.Name }} <span class="tag-count">({{ tag.Count }})</span></a>
+ {% endfor %}
+ {% if not RecentTags %}
+ <p>No recent tags found.</p>
+ {% endif %}
+ </div>
+</div>