Skip to content

Commit 0cfcb06

Browse files
committed
Add About page and version configuration to settings
1 parent 6f34432 commit 0cfcb06

File tree

5 files changed

+238
-0
lines changed

5 files changed

+238
-0
lines changed

src/config/settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@
239239

240240
# Yamtrack settings
241241

242+
VERSION = config("VERSION", default="dev")
243+
242244
ADMIN_ENABLED = config("ADMIN_ENABLED", default=False, cast=bool)
243245

244246
TZ = zoneinfo.ZoneInfo(TIME_ZONE)

src/templates/users/about.html

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
{% extends "users/base.html" %}
2+
3+
{% load socialaccount %}
4+
{% load static %}
5+
6+
{% block title %}
7+
Account - Yamtrack
8+
{% endblock title %}
9+
10+
{% block settings_content %}
11+
<div class="bg-[#2a2f35] rounded-lg p-6">
12+
<h2 class="text-2xl font-bold mb-6">About Yamtrack</h2>
13+
14+
<div class="space-y-6">
15+
<div class="space-y-2">
16+
<div class="flex items-center gap-2 text-lg font-medium text-gray-200">
17+
<svg xmlns="http://www.w3.org/2000/svg"
18+
width="24"
19+
height="24"
20+
viewBox="0 0 24 24"
21+
fill="none"
22+
stroke="currentColor"
23+
stroke-width="2"
24+
stroke-linecap="round"
25+
stroke-linejoin="round"
26+
class="w-5 h-5 text-indigo-400">
27+
<circle cx="12" cy="12" r="10"></circle>
28+
<path d="M12 16v-4"></path>
29+
<path d="M12 8h.01"></path>
30+
</svg>
31+
<h3>Description</h3>
32+
</div>
33+
<p class="text-gray-300 pl-7">
34+
Yamtrack is an open-source media tracker that helps you organize and track your media.
35+
</p>
36+
</div>
37+
38+
<div class="space-y-4">
39+
<div class="flex items-center gap-2 text-lg font-medium text-gray-200">
40+
<svg xmlns="http://www.w3.org/2000/svg"
41+
width="24"
42+
height="24"
43+
viewBox="0 0 24 24"
44+
fill="none"
45+
stroke="currentColor"
46+
stroke-width="2"
47+
stroke-linecap="round"
48+
stroke-linejoin="round"
49+
class="w-5 h-5 text-indigo-400">
50+
<path d="M15 3h6v6"></path>
51+
<path d="M10 14 21 3"></path>
52+
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
53+
</svg>
54+
<h3>Links</h3>
55+
</div>
56+
<div class="grid gap-3 pl-7">
57+
<a href="https://github.com/FuzzyGrim/Yamtrack"
58+
target="_blank"
59+
rel="noopener noreferrer"
60+
class="flex items-center gap-2 text-indigo-400 hover:text-indigo-300 transition-colors">
61+
<svg xmlns="http://www.w3.org/2000/svg"
62+
width="24"
63+
height="24"
64+
viewBox="0 0 24 24"
65+
fill="none"
66+
stroke="currentColor"
67+
stroke-width="2"
68+
stroke-linecap="round"
69+
stroke-linejoin="round"
70+
class="w-4 h-4">
71+
<path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4">
72+
</path>
73+
<path d="M9 18c-4.51 2-5-2-7-2"></path>
74+
</svg>
75+
<span>Source Code</span>
76+
<svg xmlns="http://www.w3.org/2000/svg"
77+
width="24"
78+
height="24"
79+
viewBox="0 0 24 24"
80+
fill="none"
81+
stroke="currentColor"
82+
stroke-width="2"
83+
stroke-linecap="round"
84+
stroke-linejoin="round"
85+
class="w-3 h-3 ml-1">
86+
<path d="M15 3h6v6"></path>
87+
<path d="M10 14 21 3"></path>
88+
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
89+
</svg>
90+
</a>
91+
92+
<a href="https://github.com/FuzzyGrim/Yamtrack/wiki"
93+
target="_blank"
94+
rel="noopener noreferrer"
95+
class="flex items-center gap-2 text-indigo-400 hover:text-indigo-300 transition-colors">
96+
<svg xmlns="http://www.w3.org/2000/svg"
97+
width="24"
98+
height="24"
99+
viewBox="0 0 24 24"
100+
fill="none"
101+
stroke="currentColor"
102+
stroke-width="2"
103+
stroke-linecap="round"
104+
stroke-linejoin="round"
105+
class="w-4 h-4">
106+
<path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path>
107+
<path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path>
108+
</svg>
109+
<span>Documentation</span>
110+
<svg xmlns="http://www.w3.org/2000/svg"
111+
width="24"
112+
height="24"
113+
viewBox="0 0 24 24"
114+
fill="none"
115+
stroke="currentColor"
116+
stroke-width="2"
117+
stroke-linecap="round"
118+
stroke-linejoin="round"
119+
class="w-3 h-3 ml-1">
120+
<path d="M15 3h6v6"></path>
121+
<path d="M10 14 21 3"></path>
122+
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
123+
</svg>
124+
</a>
125+
126+
<a href="https://github.com/FuzzyGrim/Yamtrack/issues"
127+
target="_blank"
128+
rel="noopener noreferrer"
129+
class="flex items-center gap-2 text-indigo-400 hover:text-indigo-300 transition-colors">
130+
<svg xmlns="http://www.w3.org/2000/svg"
131+
width="24"
132+
height="24"
133+
viewBox="0 0 24 24"
134+
fill="none"
135+
stroke="currentColor"
136+
stroke-width="2"
137+
stroke-linecap="round"
138+
stroke-linejoin="round"
139+
class="w-4 h-4">
140+
<path d="m8 2 1.88 1.88"></path>
141+
<path d="M14.12 3.88 16 2"></path>
142+
<path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"></path>
143+
<path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"></path>
144+
<path d="M12 20v-9"></path>
145+
<path d="M6.53 9C4.6 8.8 3 7.1 3 5"></path>
146+
<path d="M6 13H2"></path>
147+
<path d="M3 21c0-2.1 1.7-3.9 3.8-4"></path>
148+
<path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"></path>
149+
<path d="M22 13h-4"></path>
150+
<path d="M17.2 17c2.1.1 3.8 1.9 3.8 4"></path>
151+
</svg>
152+
<span>Bug Reports</span>
153+
<svg xmlns="http://www.w3.org/2000/svg"
154+
width="24"
155+
height="24"
156+
viewBox="0 0 24 24"
157+
fill="none"
158+
stroke="currentColor"
159+
stroke-width="2"
160+
stroke-linecap="round"
161+
stroke-linejoin="round"
162+
class="w-3 h-3 ml-1">
163+
<path d="M15 3h6v6"></path>
164+
<path d="M10 14 21 3"></path>
165+
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
166+
</svg>
167+
</a>
168+
</div>
169+
</div>
170+
171+
<div class="space-y-2">
172+
<div class="flex items-center gap-2 text-lg font-medium text-gray-200">
173+
<svg xmlns="http://www.w3.org/2000/svg"
174+
width="24"
175+
height="24"
176+
viewBox="0 0 24 24"
177+
fill="none"
178+
stroke="currentColor"
179+
stroke-width="2"
180+
stroke-linecap="round"
181+
stroke-linejoin="round"
182+
class="w-5 h-5 text-indigo-400">
183+
<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path>
184+
<path d="M14 2v4a2 2 0 0 0 2 2h4"></path>
185+
<path d="M10 9H8"></path>
186+
<path d="M16 13H8"></path>
187+
<path d="M16 17H8"></path>
188+
</svg>
189+
<h3>License</h3>
190+
</div>
191+
<p class="text-gray-300 pl-7">
192+
Yamtrack is licensed under the
193+
194+
<a href="https://github.com/FuzzyGrim/Yamtrack/blob/dev/LICENSE"
195+
target="_blank"
196+
rel="noopener noreferrer"
197+
class="text-indigo-400 hover:text-indigo-300 transition-colors">GNU Affero General Public License v3.0 (AGPL-3.0)</a>
198+
</p>
199+
</div>
200+
201+
<div class="mt-8 pt-4 border-t border-gray-700">
202+
<p class="text-gray-400 text-sm">
203+
Version: <span class="font-mono">{{ version }}</span>
204+
</p>
205+
</div>
206+
</div>
207+
</div>
208+
{% endblock settings_content %}

src/templates/users/base.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,26 @@ <h1 class="text-3xl font-bold">Settings</h1>
132132
</svg>
133133
<span>Export Data</span>
134134
</a>
135+
136+
{% url 'about' as about_url %}
137+
<a href="{{ about_url }}"
138+
class="w-full flex items-center space-x-3 px-2 py-2 rounded-md transition-colors text-left border-l-2 cursor-pointer text-sm {% if request.path == about_url %}bg-[#39404b] text-white border-indigo-500{% else %}text-gray-400 border-transparent hover:bg-[#313842] hover:text-white{% endif %}">
139+
<svg xmlns="http://www.w3.org/2000/svg"
140+
width="24"
141+
height="24"
142+
viewBox="0 0 24 24"
143+
fill="none"
144+
stroke="currentColor"
145+
stroke-width="2"
146+
stroke-linecap="round"
147+
stroke-linejoin="round"
148+
class="w-5 h-5">
149+
<circle cx="12" cy="12" r="10"></circle>
150+
<path d="M12 16v-4"></path>
151+
<path d="M12 8h.01"></path>
152+
</svg>
153+
<span>About</span>
154+
</a>
135155
</nav>
136156
</div>
137157
</div>

src/users/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
path("settings/integrations", views.integrations, name="integrations"),
2222
path("settings/import", views.import_data, name="import_data"),
2323
path("settings/export", views.export_data, name="export_data"),
24+
path("settings/about", views.about, name="about"),
2425
path(
2526
"delete_import_schedule",
2627
views.delete_import_schedule,

src/users/views.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import logging
22

33
import apprise
4+
from django.conf import settings
45
from django.contrib import messages
56
from django.contrib.auth import update_session_auth_hash
67
from django.db import IntegrityError
@@ -260,6 +261,12 @@ def export_data(request):
260261
return render(request, "users/export_data.html")
261262

262263

264+
@require_GET
265+
def about(request):
266+
"""Render the about page."""
267+
return render(request, "users/about.html", {"version": settings.VERSION})
268+
269+
263270
@require_POST
264271
def delete_import_schedule(request):
265272
"""Delete an import schedule."""

0 commit comments

Comments
 (0)