mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-12-22 18:00:17 +00:00
initial template for login route
This commit is contained in:
parent
09584e43b8
commit
d250ed645a
41
tubearchivist/home/templates/home/login.html
Normal file
41
tubearchivist/home/templates/home/login.html
Normal file
@ -0,0 +1,41 @@
|
||||
{% 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">
|
||||
<title>TA | Welcome</title>
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'css/style.css' %}">
|
||||
<link rel="shortcut icon" type="image/png" href="{% static 'favicon.ico' %}"/>
|
||||
{% if colors == "dark" %}
|
||||
<link rel="stylesheet" href="{% static 'css/dark.css' %}">
|
||||
{% else %}
|
||||
<link rel="stylesheet" href="{% static 'css/light.css' %}">
|
||||
{% endif %}
|
||||
</head>
|
||||
<body>
|
||||
<div class="boxed-content login-page">
|
||||
{% if colors == 'dark' %}
|
||||
<img src="{% static 'img/logo-tube-archivist-dark.png' %}" alt="tube-archivist-logo">
|
||||
{% endif %}
|
||||
{% if colors == 'light' %}
|
||||
<img src="{% static 'img/logo-tube-archivist-light.png' %}" alt="tube-archivist-banner">
|
||||
{% endif %}
|
||||
<h1>Tube Archivist</h1>
|
||||
<h2>Your Self Hosted YouTube Media Server</h2>
|
||||
<form action="/login/" method="POST" name="login">
|
||||
{% csrf_token %}
|
||||
<input type="text" name="user" id="user" placeholder="Username"><br>
|
||||
<input type="password" name="password" id="password" placeholder="Password"><br>
|
||||
<button type="submit">Login</button>
|
||||
</form>
|
||||
<p class="login-links"><span><a href="https://github.com/bbilly1/tubearchivist" target="_blank">Github</a></span> <span><a href="https://github.com/bbilly1/tubearchivist#donate" target="_blank">Donate</a></span></p>
|
||||
</div>
|
||||
<div class="footer-colors">
|
||||
<div class="col-1"></div>
|
||||
<div class="col-2"></div>
|
||||
<div class="col-3"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -7,6 +7,7 @@ from home.views import (
|
||||
ChannelView,
|
||||
DownloadView,
|
||||
HomeView,
|
||||
LoginView,
|
||||
SettingsView,
|
||||
VideoView,
|
||||
)
|
||||
@ -15,6 +16,7 @@ from . import views
|
||||
|
||||
urlpatterns = [
|
||||
path("", HomeView.as_view(), name="home"),
|
||||
path("login/", LoginView.as_view(), name="login"),
|
||||
path("about/", AboutView.as_view(), name="about"),
|
||||
path("downloads/", DownloadView.as_view(), name="downloads"),
|
||||
path("settings/", SettingsView.as_view(), name="settings"),
|
||||
|
@ -126,6 +126,27 @@ class HomeView(View):
|
||||
return redirect(search_url, permanent=True)
|
||||
|
||||
|
||||
class LoginView(View):
|
||||
"""resolves to /login/
|
||||
Greeting and login page
|
||||
"""
|
||||
|
||||
def get(self, request):
|
||||
"""handle get requests"""
|
||||
colors = self.read_config()
|
||||
context = {
|
||||
"colors": colors,
|
||||
}
|
||||
return render(request, "home/login.html", context)
|
||||
|
||||
@staticmethod
|
||||
def read_config():
|
||||
"""read needed values from redis"""
|
||||
config_handler = AppConfig().config
|
||||
colors = config_handler["application"]["colors"]
|
||||
return colors
|
||||
|
||||
|
||||
class AboutView(View):
|
||||
"""resolves to /about/
|
||||
show helpful how to information
|
||||
|
@ -514,6 +514,63 @@ button:hover {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
/* login */
|
||||
.login-page {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
.login-page > * {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.login-page img {
|
||||
width: 100%;
|
||||
max-width: 200px;
|
||||
max-height: 200px;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.login-page form {
|
||||
margin: 30px 0;
|
||||
}
|
||||
|
||||
.login-page input {
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
.login-links a {
|
||||
text-decoration: underline;
|
||||
margin: 30px 0;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.footer-colors {
|
||||
grid-row-start: 2;
|
||||
grid-row-end: 3;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.footer-colors div {
|
||||
padding: 20px 0;
|
||||
width: 33.33%;
|
||||
}
|
||||
|
||||
.col-1 {
|
||||
background-color: var(--highlight-bg);
|
||||
}
|
||||
|
||||
.col-2 {
|
||||
background-color: var(--accent-font-dark);
|
||||
}
|
||||
|
||||
.col-3 {
|
||||
background-color: var(--accent-font-light);
|
||||
}
|
||||
|
||||
/* video page */
|
||||
.video-main video {
|
||||
max-height: 70vh;
|
||||
|
BIN
tubearchivist/static/img/logo-tube-archivist-dark.png
Normal file
BIN
tubearchivist/static/img/logo-tube-archivist-dark.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 212 KiB |
BIN
tubearchivist/static/img/logo-tube-archivist-light.png
Normal file
BIN
tubearchivist/static/img/logo-tube-archivist-light.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 218 KiB |
Loading…
Reference in New Issue
Block a user