Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions .idea/jukebox-django.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file added jukebox/YTUSRN/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions jukebox/YTUSRN/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions jukebox/YTUSRN/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class YtusrnConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'YTUSRN'
22 changes: 22 additions & 0 deletions jukebox/YTUSRN/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 5.1.1 on 2024-10-22 23:39

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='UserField',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('user_text', models.CharField(max_length=200)),
('date', models.DateTimeField(verbose_name='date published')),
],
),
]
Empty file.
11 changes: 11 additions & 0 deletions jukebox/YTUSRN/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from django.db import models
import datetime
from django.utils import timezone


class UserField(models.Model):
username = models.CharField(max_length=200)
date = models.DateTimeField("enter time")

def __str__(self):
return self.user_text
56 changes: 56 additions & 0 deletions jukebox/YTUSRN/templates/jukebox/THANKYOU.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Thank You</title>
<style>
body {
font-family: 'Helvetica Neue', Arial, sans-serif;
background-color: #121212;
color: #f0f0f0;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

.container {
width: 300px;
padding: 20px;
border: 1px solid #333;
border-radius: 6px;
background-color: #1e1e1e;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
text-align: center;
}

h1 {
font-size: 24px;
margin-bottom: 20px;
}

a {
text-decoration: none;
color: #f0f0f0;
background-color: #333;
padding: 10px 20px;
border-radius: 4px;
transition: background-color 0.3s;
}

a:hover {
background-color: #555;
}
</style>
</head>
<body>
<div class="container">
<h1>Thank you!</h1>
<p>Your URL has been submitted successfully.</p>
<!-- A security consideration here would be to sanitize and validate the URL input server-side before using it. -->
<a href="givemeYT">Go back</a>
</div>
</body>
</html>
67 changes: 67 additions & 0 deletions jukebox/YTUSRN/templates/jukebox/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Username Input</title>
<style>
body {
font-family: 'Helvetica Neue', Arial, sans-serif;
background-color: #121212;
color: #f0f0f0;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

.container {
width: 280px;
padding: 20px;
border: 1px solid #333;
border-radius: 6px;
background-color: #1e1e1e;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
text-align: center;
}

input[type="text"] {
width: 100%;
padding: 8px;
border: 1px solid #555;
border-radius: 4px;
background-color: #2e2e2e;
color: #f0f0f0;
font-size: 14px;
margin-bottom: 10px;
box-sizing: border-box;
}

button {
width: 100%;
padding: 10px;
border: none;
border-radius: 4px;
background-color: #f0f0f0;
color: #1e1e1e;
font-size: 14px;
cursor: pointer;
transition: background-color 0.3s;
}

button:hover {
background-color: #d0d0d0;
}
</style>
</head>
<body>
<div class="container">
<form action="/YTUSRN/" method="POST">
{% csrf_token %}
<input type="text" name="username" placeholder="Enter username" required>
<button type="submit">Submit</button>
</form>
</div>
</body>
</html>
79 changes: 79 additions & 0 deletions jukebox/YTUSRN/templates/jukebox/ytflp.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Submit a URL</title>
<style>
body {
font-family: 'Helvetica Neue', Arial, sans-serif;
background-color: #1a1a1a;
color: #e0e0e0;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

.container {
width: 320px;
padding: 30px;
border-radius: 8px;
background-color: #252525;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
text-align: center;
}

h2 {
font-size: 22px;
margin-bottom: 15px;
color: #ffcc00;
}

input[type="url"] {
width: 100%;
padding: 10px;
border: none;
border-radius: 6px;
background-color: #333;
color: #e0e0e0;
font-size: 16px;
margin-bottom: 20px;
box-sizing: border-box;
outline: none;
}

input[type="url"]::placeholder {
color: #aaa;
}

button {
width: 100%;
padding: 12px;
border: none;
border-radius: 6px;
background-color: #ffcc00;
color: #1a1a1a;
font-size: 16px;
font-weight: bold;
cursor: pointer;
transition: background-color 0.3s;
}

button:hover {
background-color: #e6b800;
}
</style>
</head>
<body>
<div class="container">
<h2>Submit a URL</h2>
<form action="/YTUSRN/givemeYT/" method="POST">
{% csrf_token %}
<input type="url" name="url" placeholder="Enter URL" required>
<button type="submit">Submit</button>
</form>
</div>
</body>
</html>
3 changes: 3 additions & 0 deletions jukebox/YTUSRN/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
11 changes: 11 additions & 0 deletions jukebox/YTUSRN/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from django.urls import path

from . import views

app_name = "YTUSRN"

urlpatterns = [
path("", views.index, name="index"),
path("givemeYT", views.ytflp, name="ytflp"),
path("THANKYOU!!", views.thankyou, name="thankyou"),
]
26 changes: 26 additions & 0 deletions jukebox/YTUSRN/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.db.models import F
from .models import UserField


def index(request):
try:
username_input = request.POST["username"]
print(username_input)
except KeyError:
return render(
request,
"jukebox/index.html",
)
else:
return HttpResponseRedirect(reverse("YTUSRN:ytflp"))


def ytflp(request):
return render(request, "jukebox/ytflp.html")


def thankyou(request):
return render(request, "jukebox/thankyou.html")
3 changes: 2 additions & 1 deletion jukebox/jukebox/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
# Application definition

INSTALLED_APPS = [
'YTUSRN.apps.YtusrnConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
Expand Down Expand Up @@ -105,7 +106,7 @@

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'
TIME_ZONE = 'US/Pacific'

USE_I18N = True

Expand Down
Loading