diff --git a/core/__pycache__/forms.cpython-311.pyc b/core/__pycache__/forms.cpython-311.pyc new file mode 100644 index 0000000..30bcc0f Binary files /dev/null and b/core/__pycache__/forms.cpython-311.pyc differ diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index 1f807fa..f2e98fb 100644 Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 6867ddf..843b9c0 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/forms.py b/core/forms.py new file mode 100644 index 0000000..38c25d8 --- /dev/null +++ b/core/forms.py @@ -0,0 +1,11 @@ +from django import forms +from django.contrib.auth.forms import UserCreationForm +from django.contrib.auth.models import User + + +class SignUpForm(UserCreationForm): + email = forms.EmailField(max_length=254, help_text='Required. Inform a valid email address.') + + class Meta: + model = User + fields = ('username', 'email', 'password', 'password2') diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..600433c 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -3,7 +3,8 @@ - {% block title %}Knowledge Base{% endblock %} + + {% block title %}Notes Sharing Platform{% endblock %} {% if project_description %} @@ -13,13 +14,84 @@ {% endif %} + + + + + + + + + {% load static %} + {% block head %}{% endblock %} + + {% block content %}{% endblock %} + + + + + diff --git a/core/templates/core/index.html b/core/templates/core/index.html index faec813..332e74b 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,145 +1,65 @@ -{% extends "base.html" %} +{% extends 'base.html' %} +{% load static %} -{% block title %}{{ project_name }}{% endblock %} +{% block title %}Welcome to the #1 Notes Sharing Platform{% endblock %} {% block head %} - - - {% endblock %} {% block content %} -
-
-

Analyzing your requirements and generating your app…

-
- Loading… +
+
+
+

The Best Place for Your Study Notes

+

Upload, share, and discover study materials from students at your university. Say goodbye to scattered files and hello to collaborative learning.

+
-

AppWizzy AI is collecting your requirements and applying the first changes.

-

This page will refresh automatically as the plan is implemented.

-

- Runtime: Django {{ django_version }} · Python {{ python_version }} - — UTC {{ current_time|date:"Y-m-d H:i:s" }} -

-
- -{% endblock %} \ No newline at end of file + +
+
+

How It Works

+
+
+
+
1
+

Sign Up

+

Create your free account in seconds.

+
+
+
+
+
2
+

Upload

+

Share your notes, ppts, and assignments.

+
+
+
+
+
3
+

Share

+

Help other students by making your notes public.

+
+
+
+
+
4
+

Download

+

Access quality notes from your peers.

+
+
+
+ +{% endblock %} diff --git a/core/templates/core/login.html b/core/templates/core/login.html new file mode 100644 index 0000000..5f87229 --- /dev/null +++ b/core/templates/core/login.html @@ -0,0 +1,22 @@ +{% extends 'base.html' %} + +{% block content %} +
+
+
+
+
+

Login

+
+
+
+ {% csrf_token %} + {{ form.as_p }} + +
+
+
+
+
+
+{% endblock %} diff --git a/core/templates/core/signup.html b/core/templates/core/signup.html new file mode 100644 index 0000000..a681eae --- /dev/null +++ b/core/templates/core/signup.html @@ -0,0 +1,22 @@ +{% extends 'base.html' %} + +{% block content %} +
+
+
+
+
+

Sign Up

+
+
+
+ {% csrf_token %} + {{ form.as_p }} + +
+
+
+
+
+
+{% endblock %} diff --git a/core/urls.py b/core/urls.py index 6299e3d..55f942b 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,7 +1,10 @@ from django.urls import path -from .views import home +from .views import home, login_view, logout_view, signup_view urlpatterns = [ path("", home, name="home"), + path("signup/", signup_view, name="signup"), + path("login/", login_view, name="login"), + path("logout/", logout_view, name="logout"), ] diff --git a/core/views.py b/core/views.py index c9aed12..2696b6c 100644 --- a/core/views.py +++ b/core/views.py @@ -2,9 +2,13 @@ import os import platform from django import get_version as django_version -from django.shortcuts import render +from django.contrib.auth import authenticate, login, logout +from django.contrib.auth.forms import AuthenticationForm +from django.shortcuts import redirect, render from django.utils import timezone +from .forms import SignUpForm + def home(request): """Render the landing screen with loader and environment details.""" @@ -23,3 +27,33 @@ def home(request): "project_image_url": os.getenv("PROJECT_IMAGE_URL", ""), } return render(request, "core/index.html", context) + + +def signup_view(request): + if request.method == 'POST': + form = SignUpForm(request.POST) + if form.is_valid(): + user = form.save() + login(request, user) + return redirect('home') + else: + form = SignUpForm() + return render(request, 'core/signup.html', {'form': form}) + + +def login_view(request): + if request.method == 'POST': + form = AuthenticationForm(data=request.POST) + if form.is_valid(): + user = form.get_user() + login(request, user) + return redirect('home') + else: + form = AuthenticationForm() + return render(request, 'core/login.html', {'form': form}) + + +def logout_view(request): + if request.method == 'POST': + logout(request) + return redirect('home') diff --git a/static/css/custom.css b/static/css/custom.css index 925f6ed..fc07a70 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,4 +1,120 @@ -/* Custom styles for the application */ +/* +Palette: +- Primary (Deep Blue): #0A2540 +- Secondary (White): #FFFFFF +- Accent (Bright Blue): #007BFF +- Neutral/Background (Light Gray): #F6F9FC +- Text (Dark Gray): #333333 +*/ + body { - font-family: system-ui, -apple-system, sans-serif; + font-family: 'Lato', sans-serif; + color: #333333; + background-color: #FFFFFF; } + +h1, h2, h3, h4, h5, h6, .navbar-brand { + font-family: 'Poppins', sans-serif; + font-weight: 700; +} + +.btn-primary { + background-color: #007BFF; + border-color: #007BFF; + font-weight: 600; + padding: 0.75rem 1.5rem; + border-radius: 0.5rem; + transition: background-color 0.3s ease, border-color 0.3s ease; +} + +.btn-primary:hover { + background-color: #0056b3; + border-color: #0056b3; +} + +.btn-secondary { + background-color: transparent; + border-color: #0A2540; + color: #0A2540; + font-weight: 600; + padding: 0.75rem 1.5rem; + border-radius: 0.5rem; + transition: background-color 0.3s ease, color 0.3s ease; +} + +.btn-secondary:hover { + background-color: #0A2540; + color: #FFFFFF; +} + +.navbar { + border-bottom: 1px solid #eee; +} + +.navbar-brand { + font-weight: 700; + color: #0A2540 !important; +} + +/* Hero Section */ +.hero-section { + background: linear-gradient(45deg, #0A2540, #007BFF); + color: #FFFFFF; + padding: 100px 0; + text-align: center; +} + +.hero-section h1 { + font-size: 3.5rem; + font-weight: 700; + margin-bottom: 1rem; +} + +.hero-section p { + font-size: 1.25rem; + margin-bottom: 2rem; + max-width: 600px; + margin-left: auto; + margin-right: auto; +} + +/* How it works section */ +.how-it-works { + padding: 80px 0; + background-color: #F6F9FC; +} + +.how-it-works h2 { + text-align: center; + margin-bottom: 4rem; + color: #0A2540; +} + +.step { + text-align: center; +} + +.step-icon { + font-size: 3rem; + color: #007BFF; + margin-bottom: 1rem; +} + +.step h3 { + font-size: 1.5rem; + color: #0A2540; + margin-bottom: 0.5rem; +} + +.avatar { + display: inline-block; + width: 40px; + height: 40px; + border-radius: 50%; + background-color: #007bff; + color: #fff; + text-align: center; + line-height: 40px; + font-weight: bold; + font-size: 20px; +} \ No newline at end of file