Karan Adhikari commited on
Refactor HTML structure and improve styling
Browse files
Backend/fastapi/templates/base.html
CHANGED
|
@@ -1,15 +1,16 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
-
<html lang="en">
|
| 3 |
-
|
| 4 |
<head>
|
| 5 |
<meta charset="UTF-8">
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
<title>{% block title %}Telegram Stremio{% endblock %}</title>
|
|
|
|
| 8 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"
|
| 10 |
|
| 11 |
<script>
|
| 12 |
tailwind.config = {
|
|
|
|
| 13 |
theme: {
|
| 14 |
extend: {
|
| 15 |
colors: {
|
|
@@ -25,120 +26,79 @@
|
|
| 25 |
}
|
| 26 |
}
|
| 27 |
</script>
|
|
|
|
| 28 |
<style>
|
| 29 |
body {
|
| 30 |
-
background-color: {
|
| 31 |
-
|
| 32 |
-
theme.colors.background
|
| 33 |
-
}
|
| 34 |
-
}
|
| 35 |
-
|
| 36 |
-
;
|
| 37 |
-
|
| 38 |
-
color: {
|
| 39 |
-
{
|
| 40 |
-
theme.colors.text
|
| 41 |
-
}
|
| 42 |
-
}
|
| 43 |
-
|
| 44 |
-
;
|
| 45 |
}
|
| 46 |
|
| 47 |
.theme-card {
|
| 48 |
-
background-color: {
|
| 49 |
-
|
| 50 |
-
theme.colors.card
|
| 51 |
-
}
|
| 52 |
-
}
|
| 53 |
-
|
| 54 |
-
;
|
| 55 |
}
|
| 56 |
|
| 57 |
.theme-primary {
|
| 58 |
-
background-color: {
|
| 59 |
-
{
|
| 60 |
-
theme.colors.primary
|
| 61 |
-
}
|
| 62 |
-
}
|
| 63 |
-
|
| 64 |
-
;
|
| 65 |
}
|
| 66 |
|
| 67 |
.theme-secondary {
|
| 68 |
-
background-color: {
|
| 69 |
-
{
|
| 70 |
-
theme.colors.secondary
|
| 71 |
-
}
|
| 72 |
-
}
|
| 73 |
-
|
| 74 |
-
;
|
| 75 |
}
|
| 76 |
|
| 77 |
.theme-accent {
|
| 78 |
-
background-color: {
|
| 79 |
-
{
|
| 80 |
-
theme.colors.accent
|
| 81 |
-
}
|
| 82 |
-
}
|
| 83 |
-
|
| 84 |
-
;
|
| 85 |
}
|
| 86 |
|
| 87 |
.theme-text-secondary {
|
| 88 |
-
color: {
|
| 89 |
-
{
|
| 90 |
-
theme.colors.text_secondary
|
| 91 |
-
}
|
| 92 |
-
}
|
| 93 |
-
|
| 94 |
-
;
|
| 95 |
}
|
| 96 |
</style>
|
| 97 |
</head>
|
| 98 |
|
| 99 |
-
<body class="min-h-screen">
|
| 100 |
<!-- Navigation -->
|
| 101 |
-
<nav class="theme-card shadow-lg border-b">
|
| 102 |
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 103 |
<div class="flex justify-between items-center h-16">
|
| 104 |
<div class="flex items-center space-x-4">
|
| 105 |
<h1 class="text-2xl font-bold text-primary">Telegram Stremio</h1>
|
| 106 |
{% if current_user %}
|
| 107 |
<div class="hidden md:flex space-x-4">
|
| 108 |
-
<a href="/"
|
| 109 |
-
|
| 110 |
-
<a href="/
|
| 111 |
-
class="text-text hover:text-primary px-3 py-2 rounded-md transition-colors">Media</a>
|
| 112 |
-
<a href="/admin/dashboard"
|
| 113 |
-
class="text-text hover:text-primary px-3 py-2 rounded-md transition-colors">Admin</a>
|
| 114 |
</div>
|
| 115 |
{% endif %}
|
| 116 |
</div>
|
| 117 |
|
| 118 |
<div class="flex items-center space-x-4">
|
| 119 |
<!-- Theme Selector -->
|
| 120 |
-
<
|
| 121 |
-
<
|
| 122 |
-
|
| 123 |
-
class="theme-card border border-gray-300 rounded-md px-3 py-2 text-sm">
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
</div>
|
| 132 |
|
| 133 |
{% if current_user %}
|
| 134 |
<div class="flex items-center space-x-4">
|
| 135 |
<span class="text-sm theme-text-secondary">{{ current_user }}</span>
|
| 136 |
<a href="/logout"
|
| 137 |
-
|
|
|
|
|
|
|
| 138 |
</div>
|
| 139 |
{% else %}
|
| 140 |
<a href="/login"
|
| 141 |
-
|
|
|
|
|
|
|
| 142 |
{% endif %}
|
| 143 |
</div>
|
| 144 |
</div>
|
|
@@ -151,19 +111,18 @@
|
|
| 151 |
</main>
|
| 152 |
|
| 153 |
<!-- Footer -->
|
| 154 |
-
<footer class="theme-card border-t mt-auto">
|
| 155 |
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6">
|
| 156 |
<div class="flex justify-between items-center">
|
| 157 |
<p class="theme-text-secondary text-sm">© 2025 Telegram Stremio. All rights reserved.</p>
|
| 158 |
<div class="flex space-x-4">
|
| 159 |
-
<a href="/status"
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
</div>
|
| 164 |
</div>
|
| 165 |
</div>
|
| 166 |
</footer>
|
| 167 |
</body>
|
| 168 |
-
|
| 169 |
-
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
+
<html lang="en" class="dark">
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>{% block title %}Telegram Stremio{% endblock %}</title>
|
| 7 |
+
|
| 8 |
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"/>
|
| 10 |
|
| 11 |
<script>
|
| 12 |
tailwind.config = {
|
| 13 |
+
darkMode: 'class',
|
| 14 |
theme: {
|
| 15 |
extend: {
|
| 16 |
colors: {
|
|
|
|
| 26 |
}
|
| 27 |
}
|
| 28 |
</script>
|
| 29 |
+
|
| 30 |
<style>
|
| 31 |
body {
|
| 32 |
+
background-color: {{ theme.colors.background }};
|
| 33 |
+
color: {{ theme.colors.text }};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
}
|
| 35 |
|
| 36 |
.theme-card {
|
| 37 |
+
background-color: {{ theme.colors.card }};
|
| 38 |
+
color: {{ theme.colors.text }};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
}
|
| 40 |
|
| 41 |
.theme-primary {
|
| 42 |
+
background-color: {{ theme.colors.primary }};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
}
|
| 44 |
|
| 45 |
.theme-secondary {
|
| 46 |
+
background-color: {{ theme.colors.secondary }};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
}
|
| 48 |
|
| 49 |
.theme-accent {
|
| 50 |
+
background-color: {{ theme.colors.accent }};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
}
|
| 52 |
|
| 53 |
.theme-text-secondary {
|
| 54 |
+
color: {{ theme.colors.text_secondary }};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
}
|
| 56 |
</style>
|
| 57 |
</head>
|
| 58 |
|
| 59 |
+
<body class="min-h-screen flex flex-col">
|
| 60 |
<!-- Navigation -->
|
| 61 |
+
<nav class="theme-card shadow-lg border-b text-text">
|
| 62 |
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 63 |
<div class="flex justify-between items-center h-16">
|
| 64 |
<div class="flex items-center space-x-4">
|
| 65 |
<h1 class="text-2xl font-bold text-primary">Telegram Stremio</h1>
|
| 66 |
{% if current_user %}
|
| 67 |
<div class="hidden md:flex space-x-4">
|
| 68 |
+
<a href="/" class="text-text hover:text-primary px-3 py-2 rounded-md transition-colors">Dashboard</a>
|
| 69 |
+
<a href="/media/manage" class="text-text hover:text-primary px-3 py-2 rounded-md transition-colors">Media</a>
|
| 70 |
+
<a href="/admin/dashboard" class="text-text hover:text-primary px-3 py-2 rounded-md transition-colors">Admin</a>
|
|
|
|
|
|
|
|
|
|
| 71 |
</div>
|
| 72 |
{% endif %}
|
| 73 |
</div>
|
| 74 |
|
| 75 |
<div class="flex items-center space-x-4">
|
| 76 |
<!-- Theme Selector -->
|
| 77 |
+
<form method="post" action="/set-theme" id="theme-form">
|
| 78 |
+
<select name="theme"
|
| 79 |
+
onchange="document.getElementById('theme-form').submit()"
|
| 80 |
+
class="theme-card border border-gray-300 dark:border-gray-700 rounded-md px-3 py-2 text-sm text-text focus:outline-none focus:ring-2 focus:ring-primary">
|
| 81 |
+
{% for theme_key, theme_data in themes.items() %}
|
| 82 |
+
<option value="{{ theme_key }}" {% if current_theme==theme_key %}selected{% endif %}>
|
| 83 |
+
{{ theme_data.name }}
|
| 84 |
+
</option>
|
| 85 |
+
{% endfor %}
|
| 86 |
+
</select>
|
| 87 |
+
</form>
|
|
|
|
| 88 |
|
| 89 |
{% if current_user %}
|
| 90 |
<div class="flex items-center space-x-4">
|
| 91 |
<span class="text-sm theme-text-secondary">{{ current_user }}</span>
|
| 92 |
<a href="/logout"
|
| 93 |
+
class="bg-red-600 text-white px-4 py-2 rounded-md hover:bg-red-700 transition-colors">
|
| 94 |
+
Logout
|
| 95 |
+
</a>
|
| 96 |
</div>
|
| 97 |
{% else %}
|
| 98 |
<a href="/login"
|
| 99 |
+
class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md transition-colors">
|
| 100 |
+
Login
|
| 101 |
+
</a>
|
| 102 |
{% endif %}
|
| 103 |
</div>
|
| 104 |
</div>
|
|
|
|
| 111 |
</main>
|
| 112 |
|
| 113 |
<!-- Footer -->
|
| 114 |
+
<footer class="theme-card border-t mt-auto text-text">
|
| 115 |
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6">
|
| 116 |
<div class="flex justify-between items-center">
|
| 117 |
<p class="theme-text-secondary text-sm">© 2025 Telegram Stremio. All rights reserved.</p>
|
| 118 |
<div class="flex space-x-4">
|
| 119 |
+
<a href="/status" class="theme-text-secondary hover:text-primary text-sm transition-colors">Status</a>
|
| 120 |
+
<a href="/stremio" class="theme-text-secondary hover:text-primary text-sm transition-colors">
|
| 121 |
+
Stremio Guide
|
| 122 |
+
</a>
|
| 123 |
</div>
|
| 124 |
</div>
|
| 125 |
</div>
|
| 126 |
</footer>
|
| 127 |
</body>
|
| 128 |
+
</html>
|
|
|