From 6f60851c068b7272270ffd1d222c5b0c0ba24069 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Mon, 8 Dec 2025 02:29:03 +0000 Subject: [PATCH] Numero 1 --- core/__pycache__/forms.cpython-311.pyc | Bin 0 -> 1052 bytes core/__pycache__/models.cpython-311.pyc | Bin 209 -> 1872 bytes core/__pycache__/urls.cpython-311.pyc | Bin 347 -> 657 bytes core/__pycache__/views.cpython-311.pyc | Bin 1364 -> 3939 bytes core/forms.py | 10 + core/migrations/0001_initial.py | 35 +++ .../__pycache__/0001_initial.cpython-311.pyc | Bin 0 -> 1939 bytes core/models.py | 23 +- core/templates/base.html | 29 +++ core/templates/core/index.html | 234 +++++++----------- core/templates/core/login.html | 20 ++ core/templates/core/signup.html | 20 ++ core/urls.py | 11 +- core/views.py | 88 +++++-- static/css/custom.css | 40 ++- staticfiles/css/custom.css | 55 ++-- 16 files changed, 376 insertions(+), 189 deletions(-) create mode 100644 core/__pycache__/forms.cpython-311.pyc create mode 100644 core/forms.py create mode 100644 core/migrations/0001_initial.py create mode 100644 core/migrations/__pycache__/0001_initial.cpython-311.pyc create mode 100644 core/templates/core/login.html create mode 100644 core/templates/core/signup.html diff --git a/core/__pycache__/forms.cpython-311.pyc b/core/__pycache__/forms.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d538a2250b77a4712f511b8ce203a2ee1c091830 GIT binary patch literal 1052 zcmZ`%%}*3D6mRE?Wiu$NM!^uXp3H_glX$?3Q4<5kL^(*f%)zm2%kJQOES(ueP8>Y& zAMhWbM*o;G;jrn|6DOA}Cl1EV=+g{ za0QeD!U?A#iKs^@>RPBpx~G@A9vYG9nUrYcIpM}9!cCzc>V$lQQHf`9YmKy~j?rvU zWo{-iNpjeU{2O-d-g_;!^FRvjG+)HXv&ow8Ss3u9h*%Id8Rt@@ zsngO_Jz_h4DB@1mRnuJ&_WVrjWE0e(tfdTZ!gNku=$^r;XL1e7qMuzoC*iyj8EYA; zmO~X{771mRc~z~)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zIuxsm~F z@L;r}}S=I)z$IFXKur(nVWKU|om+a3e?7^WGJ@G_bx@T#o8K@3RP z3rS;0oPqodW1ywH^w9C-m4sa}6R=BU>XiXC;ftIj&=Z2R7^GO_!} zQ6>&XJIZudnRb-v_Hr=TRjxV8wSj$*e!cqk$BwenRaP8j1sv)vOnK||mmPJ!tIj*> zeES|UeMvy7e@yzv!9x__*^Sex-qF@OSw9`>&06+Vd6o5L@tHx3BpZkOA>z z{R*Nd3W9J<#yjW#Jt-`}n{!d@&OKXrhvV-D&Qwak{eE1&82f$vo#%W19}(WU{sls$ Bs)7Ij literal 209 zcmZ3^%ge<81S>LrWmp2~#~=<2FhLogg@BCd3@HpLj5!Rsj8Tk?3@J>(44TX@K?*b( zZ?Wa(r=;c-`)M-W;!Md(%uCPLOGzqX21>4E_zY6>OHV%|KQ~psG^sSNq*On(A~m_R zB)>?%JijQrxF9h(RX;huC{-U~j9x+IFAf_ZyEG@&u80Guoe_wOWr4&8W=2NF8w@fR Ku%RM0pb7xTsWln^ diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index 1f807fae1897c89361c99c5e868a26d00799b73f..65aa3aabde49159bc6621fae0f866c19cd1e53a3 100644 GIT binary patch literal 657 zcmZ`$J5R$f5I#3{nlu!o!T=I`RjI-Y0tq1|BnBiF#1aNnYO4+8Q8@`MoftbXbc3-I z55bQ~r4ChACbmj!OxO(_ipu43{_eiJv(J7m77HK+?d~|+2;f6GGckU_*NX%Xz`;=btoyH~D8W%`rG;=0c{x z39}Y5OI&Bgzf1$$23tOb%F3r|UqLBu)uQI797;Ll#^LR-qNP^oH2k=Aq5QPq1`Ws0 zuqAO2N0|dDaeT%*s*PXscsHMw(NxbsSD%*BluXxdKC6~|22LtwYO$-D-w3v1;f6wu zElg#IGP*MAa)i2Np&lW%WTHHC#DyQe!j}xeca=5+kJI=v_M@2c4zI^iAZR-f*I}zx z=d>OONy{C!TDRZEz8A3A?Z%~L;1jKQG%;O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#J%sL@!&l|AG%k)J#mZ^d+2TP RH0en {% 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..466ead4 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,145 +1,93 @@ -{% extends "base.html" %} + + + + + + Book Club - Social Reading App + {% load static %} + + + + + -{% block title %}{{ project_name }}{% endblock %} - -{% block head %} - - - - -{% endblock %} - -{% block content %} -
-
-

Analyzing your requirements and generating your app…

-
- Loading… +
+
+

Welcome to the Book Club

+

Create or join a book club, discuss your favorite books, and connect with fellow readers.

+ Join a Club +
-

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" }} -

-
-
-
- Page updated: {{ current_time|date:"Y-m-d H:i:s" }} (UTC) -
-{% endblock %} \ No newline at end of file + +
+
+
+
+

Create a Club

+

Start your own book club and invite your friends to join.

+
+
+
+
+

Choose Your Books

+

Select from a wide range of books or recommend new ones.

+
+
+
+
+

Join the Discussion

+

Share your thoughts, write reviews, and engage in discussions.

+
+
+
+
+ +
+
+

Recommend a Book

+ {% if submitted %} + + {% endif %} + {% if captcha_error %} + + {% endif %} +
+ {% csrf_token %} +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + +
+ +
+
+
+ + + + diff --git a/core/templates/core/login.html b/core/templates/core/login.html new file mode 100644 index 0000000..e2cc17e --- /dev/null +++ b/core/templates/core/login.html @@ -0,0 +1,20 @@ +{% 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..a4e13cd --- /dev/null +++ b/core/templates/core/signup.html @@ -0,0 +1,20 @@ +{% 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..fcada4d 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,7 +1,10 @@ from django.urls import path - -from .views import home +from . import views +from .views import signup_view, login_view, logout_view urlpatterns = [ - path("", home, name="home"), -] + path('', views.index, name='index'), + path('signup/', signup_view, name='signup'), + path('login/', login_view, name='login'), + path('logout/', logout_view, name='logout'), +] \ No newline at end of file diff --git a/core/views.py b/core/views.py index c9aed12..a9eef7b 100644 --- a/core/views.py +++ b/core/views.py @@ -1,25 +1,71 @@ -import os -import platform +from django.shortcuts import render, redirect +from .models import Club, BookRecommendation +import random -from django import get_version as django_version -from django.shortcuts import render -from django.utils import timezone +def index(request): + if request.method == 'POST': + club_id = request.POST.get('club') + book_title = request.POST.get('book_title') + author = request.POST.get('author') + reason = request.POST.get('reason') + # Simple CAPTCHA + num1 = int(request.POST.get('num1')) + num2 = int(request.POST.get('num2')) + captcha = int(request.POST.get('captcha')) + + if captcha == num1 + num2: + club = Club.objects.get(id=club_id) + BookRecommendation.objects.create( + club=club, + book_title=book_title, + author=author, + reason=reason, + ) + return redirect('/?submitted=true') + else: + return redirect('/?captcha_error=true') -def home(request): - """Render the landing screen with loader and environment details.""" - host_name = request.get_host().lower() - agent_brand = "AppWizzy" if host_name == "appwizzy.com" else "Flatlogic" - now = timezone.now() + clubs = Club.objects.all() + num1 = random.randint(1, 10) + num2 = random.randint(1, 10) + submitted = request.GET.get('submitted') + captcha_error = request.GET.get('captcha_error') + return render(request, 'core/index.html', { + 'clubs': clubs, + 'num1': num1, + 'num2': num2, + 'submitted': submitted, + 'captcha_error': captcha_error, + }) - context = { - "project_name": "New Style", - "agent_brand": agent_brand, - "django_version": django_version(), - "python_version": platform.python_version(), - "current_time": now, - "host_name": host_name, - "project_description": os.getenv("PROJECT_DESCRIPTION", ""), - "project_image_url": os.getenv("PROJECT_IMAGE_URL", ""), - } - return render(request, "core/index.html", context) +from django.contrib.auth import login, logout +from django.contrib.auth.forms import AuthenticationForm +from .forms import SignUpForm + +def signup_view(request): + if request.method == 'POST': + form = SignUpForm(request.POST) + if form.is_valid(): + user = form.save() + login(request, user) + return redirect('/') + 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('/') + else: + form = AuthenticationForm() + return render(request, 'core/login.html', {'form': form}) + +def logout_view(request): + if request.method == 'POST': + logout(request) + return redirect('/') \ No newline at end of file diff --git a/static/css/custom.css b/static/css/custom.css index 925f6ed..8774ff6 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,4 +1,40 @@ -/* Custom styles for the application */ body { - font-family: system-ui, -apple-system, sans-serif; + font-family: 'Inter', sans-serif; + color: #333333; } + +.hero-section { + background: linear-gradient(45deg, #4F46E5, #9333EA); + color: white; + padding: 100px 0; + text-align: center; +} + +.hero-section h1 { + font-family: 'Poppins', sans-serif; + font-weight: 700; +} + +.feature-box { + padding: 30px; + border-radius: 10px; + background-color: #F5F5F5; + text-align: center; + margin-bottom: 20px; +} + +.recommendation-form { + padding: 40px; + border-radius: 10px; + background-color: #F5F5F5; +} + +.btn-primary { + background-color: #4F46E5; + border-color: #4F46E5; +} + +.btn-primary:hover { + background-color: #4338CA; + border-color: #4338CA; +} \ No newline at end of file diff --git a/staticfiles/css/custom.css b/staticfiles/css/custom.css index 108056f..8774ff6 100644 --- a/staticfiles/css/custom.css +++ b/staticfiles/css/custom.css @@ -1,21 +1,40 @@ - -:root { - --bg-color-start: #6a11cb; - --bg-color-end: #2575fc; - --text-color: #ffffff; - --card-bg-color: rgba(255, 255, 255, 0.01); - --card-border-color: rgba(255, 255, 255, 0.1); -} body { - margin: 0; font-family: 'Inter', sans-serif; - background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end)); - color: var(--text-color); - display: flex; - justify-content: center; - align-items: center; - min-height: 100vh; - text-align: center; - overflow: hidden; - position: relative; + color: #333333; } + +.hero-section { + background: linear-gradient(45deg, #4F46E5, #9333EA); + color: white; + padding: 100px 0; + text-align: center; +} + +.hero-section h1 { + font-family: 'Poppins', sans-serif; + font-weight: 700; +} + +.feature-box { + padding: 30px; + border-radius: 10px; + background-color: #F5F5F5; + text-align: center; + margin-bottom: 20px; +} + +.recommendation-form { + padding: 40px; + border-radius: 10px; + background-color: #F5F5F5; +} + +.btn-primary { + background-color: #4F46E5; + border-color: #4F46E5; +} + +.btn-primary:hover { + background-color: #4338CA; + border-color: #4338CA; +} \ No newline at end of file