diff options
author | Matthew Lemon <y@yulqen.org> | 2024-11-26 17:03:16 +0000 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-11-26 17:03:16 +0000 |
commit | 04e490c0b0b65a21c531ac50a5ba321c79e14fa2 (patch) | |
tree | 428df0f34826b8aff22d9b37708ef286d3115015 | |
parent | 78fd102b49f339af5432c2f0bebfab7ff9ac39bd (diff) |
Got the basic form anbd privacy policy in place
-rw-r--r-- | alphabetlearning/payments/admin.py | 5 | ||||
-rw-r--r-- | alphabetlearning/payments/migrations/0009_emailsignup_alter_price_resource.py | 28 | ||||
-rw-r--r-- | alphabetlearning/payments/models.py | 7 | ||||
-rw-r--r-- | alphabetlearning/payments/urls.py | 4 | ||||
-rw-r--r-- | alphabetlearning/payments/views.py | 54 | ||||
-rw-r--r-- | alphabetlearning/templates/base.html | 85 | ||||
-rw-r--r-- | alphabetlearning/templates/pages/home.html | 356 | ||||
-rw-r--r-- | alphabetlearning/templates/pages/privacy_policy.html | 17 | ||||
-rw-r--r-- | alphabetlearning/templates/payments/success_email_signup.html | 11 | ||||
-rw-r--r-- | config/urls.py | 2 |
10 files changed, 136 insertions, 433 deletions
diff --git a/alphabetlearning/payments/admin.py b/alphabetlearning/payments/admin.py index 685af63..e9b70db 100644 --- a/alphabetlearning/payments/admin.py +++ b/alphabetlearning/payments/admin.py @@ -6,6 +6,7 @@ from .models import Product from .models import ShoppingCart from .models import Subscription from .models import SubscriptionPlan +from .models import EmailSignup from alphabetlearning.resources.models import Resource @@ -16,6 +17,9 @@ from alphabetlearning.resources.models import Resource # inlines = [PriceInlineAdmin] +class SuccessEmailSignupAdmin(admin.ModelAdmin): + list_display = ("email", "date_added") + class SubscriptionPlanAdmin(admin.ModelAdmin): list_display = ("name", "price", "description", "allowed_downloads") @@ -42,3 +46,4 @@ admin.site.register(Price) admin.site.register(ShoppingCart, ShoppingCartAdmin) admin.site.register(CartItem) admin.site.register(Subscription, SubscriptionAdmin) +admin.site.register(EmailSignup, SuccessEmailSignupAdmin)
\ No newline at end of file diff --git a/alphabetlearning/payments/migrations/0009_emailsignup_alter_price_resource.py b/alphabetlearning/payments/migrations/0009_emailsignup_alter_price_resource.py new file mode 100644 index 0000000..4be05a2 --- /dev/null +++ b/alphabetlearning/payments/migrations/0009_emailsignup_alter_price_resource.py @@ -0,0 +1,28 @@ +# Generated by Django 5.0.4 on 2024-11-25 11:32 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('payments', '0008_remove_price_product_price_resource'), + ('resources', '0020_remove_resource_price_resource_stripe_product_id'), + ] + + operations = [ + migrations.CreateModel( + name='EmailSignup', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('email', models.EmailField(max_length=254, unique=True)), + ('date_added', models.DateTimeField(auto_now_add=True)), + ], + ), + migrations.AlterField( + model_name='price', + name='resource', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='price_obj', to='resources.resource'), + ), + ] diff --git a/alphabetlearning/payments/models.py b/alphabetlearning/payments/models.py index 7bf4164..7a8c7bb 100644 --- a/alphabetlearning/payments/models.py +++ b/alphabetlearning/payments/models.py @@ -5,6 +5,13 @@ from django.db import models from alphabetlearning.resources.models import Resource +class EmailSignup(models.Model): + email = models.EmailField(unique=True) + date_added = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return self.email + class Product(models.Model): name = models.CharField(max_length=255) stripe_product_id = models.CharField(max_length=100) diff --git a/alphabetlearning/payments/urls.py b/alphabetlearning/payments/urls.py index 9bedaf7..12f445d 100644 --- a/alphabetlearning/payments/urls.py +++ b/alphabetlearning/payments/urls.py @@ -3,6 +3,7 @@ from django.urls import path from . import views from .views import CancelView from .views import SuccessView +from .views import privacy_policy # Import the new view app_name = "payments" @@ -20,4 +21,7 @@ urlpatterns = [ path("landing/", views.ProductLandingPageView.as_view(), name="landing"), path("delete-cart-item/<int:pk>", views. DeleteCartItem.as_view(), name="delete_cart_item"), path("webhooks/stripe/", views.stripe_webhook, name="stripe-webhook"), + path("email_signup/", views.email_signup, name="email_signup"), + path("success_email_signup/", views.SuccessEmailSignupView.as_view(), name="success_email_signup"), + path('privacy-policy/', privacy_policy, name='privacy_policy'), # Add this line ] diff --git a/alphabetlearning/payments/views.py b/alphabetlearning/payments/views.py index 92751c9..e9f2ded 100644 --- a/alphabetlearning/payments/views.py +++ b/alphabetlearning/payments/views.py @@ -1,23 +1,20 @@ -import stripe -from django.http import HttpResponse, HttpResponseBadRequest -from django.core.mail import send_mail -from django.urls import reverse_lazy from django.conf import settings from django.contrib.auth.decorators import login_required -from django.shortcuts import get_object_or_404 -from django.shortcuts import redirect -from django.shortcuts import render +from django.core.mail import send_mail +from django.http import HttpResponse, HttpResponseBadRequest +from django.shortcuts import get_object_or_404, render, redirect +from django.urls import reverse, reverse_lazy from django.views import View -from django.views.generic import TemplateView, DeleteView from django.views.decorators.csrf import csrf_exempt +from django.views.generic import TemplateView, DeleteView +from alphabetlearning.payments.models import EmailSignup from alphabetlearning.resources.models import Resource from alphabetlearning.users.models import User -from .models import CartItem -from .models import Price -from .models import Product -from .models import ShoppingCart +from .models import CartItem, Price, Product, ShoppingCart + +import stripe # TODO get the cart integrated with Stripe # Steps to convert our Cart into something that can be used with Stripe: @@ -40,6 +37,34 @@ from .models import ShoppingCart stripe.api_key = settings.STRIPE_SECRET_KEY +class SuccessEmailSignupView(TemplateView): + template_name = "payments/success_email_signup.html" + +def email_signup(request): + if request.method == 'POST': + email = request.POST.get('email') + if email: + EmailSignup.objects.get_or_create(email=email) + # Send email to user + send_mail( + "Thank you for signing up", + "You have successfully signed up for our newsletter.", + settings.DEFAULT_FROM_EMAIL, + [email], + fail_silently=False, + ) + # Send email to admin + admin_email = "admin@example.com" # Replace with actual admin email + send_mail( + "New Email Signup", + f"A new user has signed up with the email: {email}", + settings.DEFAULT_FROM_EMAIL, + [admin_email], + fail_silently=False, + ) + return redirect(reverse('payments:success_email_signup')) # Redirect to a success page or similar + return render(request, 'pages/home.html') # Adjust as necessary + def create_line_items(resources): price_objs = [r.price_obj.first() for r in resources] stripe_price_ids = [p.stripe_price_id for p in price_objs] @@ -89,7 +114,7 @@ def add_to_cart(request, resource_id): resource = get_object_or_404(Resource, id=resource_id) if not resource.price_obj.first(): return HttpResponseBadRequest( - f"There is no price assigned to this resource. Please contact Alphabet Learning Support." + "There is no price assigned to this resource. Please contact Alphabet Learning Support." ) cart, created = ShoppingCart.objects.get_or_create(user=request.user) cart_item, created = CartItem.objects.get_or_create(cart=cart, resource=resource) @@ -183,5 +208,8 @@ class DeleteCartItem(DeleteView): request.user.shoppingcart.delete() return redirect("resources:resource_list") +def privacy_policy(request): + return render(request, 'pages/privacy_policy.html') + diff --git a/alphabetlearning/templates/base.html b/alphabetlearning/templates/base.html index 8bc9416..e6531ab 100644 --- a/alphabetlearning/templates/base.html +++ b/alphabetlearning/templates/base.html @@ -93,7 +93,7 @@ </li> <li class="nav-item"> <a class="nav-link text-dark fw-bold" - href="https://www.tes.com/teaching-resources/shop/joannalemon" + href="https://www.tes.com/teaching-resources/shop/alphabetlearning" target="_blank">TES Shop</a> </li> <li class="nav-item"> @@ -101,7 +101,7 @@ target="_blank">Etsy</a> </li> <li class="nav-item"> - <a class="nav-link text-dark fw-bold" href="https://blog.joannalemon.com" + <a class="nav-link text-dark fw-bold" href="https://blog.joannalemon.com/blog" target="_blank">Blog</a> </li> <li> @@ -109,37 +109,6 @@ <a class="nav-link text-gray fw-bold" href="{% url "account_logout" %}">Log out</a> {% endif %} </li> - <li class="nav-item"> - - {% if request.user.shoppingcart %} - - <!- TODO - fix this, the logic should be different button if no cart -> - <! this is a problem because it seems you can have an empty cart -> - <div class="mx-2 gray-icon"> - <a href="{% url "payments:cart_detail" %}" class="full-basket-button"> - <span class="fw-bold px-1"> - Items in cart ( - {{ request.user.shoppingcart.items.count }} - ) - </span> - <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-bag" viewBox="0 0 16 16"> - <path d="M8 1a2.5 2.5 0 0 1 2.5 2.5V4h-5v-.5A2.5 2.5 0 0 1 8 1m3.5 3v-.5a3.5 3.5 0 1 0-7 0V4H1v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4zM2 5h12v9a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1z"/> - </svg> - </a> - </div> - - {% else %} - - <div class="mx-2 gray-icon"> - <button class="empty-basket-button" disabled><span class="fw-bold px-1">Empty Basket</span> - <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-bag-x" viewBox="0 0 16 16"> - <path fill-rule="evenodd" d="M6.146 8.146a.5.5 0 0 1 .708 0L8 9.293l1.146-1.147a.5.5 0 1 1 .708.708L8.707 10l1.147 1.146a.5.5 0 0 1-.708.708L8 10.707l-1.146 1.147a.5.5 0 0 1-.708-.708L7.293 10 6.146 8.854a.5.5 0 0 1 0-.708"/> - <path d="M8 1a2.5 2.5 0 0 1 2.5 2.5V4h-5v-.5A2.5 2.5 0 0 1 8 1m3.5 3v-.5a3.5 3.5 0 1 0-7 0V4H1v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4zM2 5h12v9a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1z"/> - </svg> - </button> - </div> - {% endif %} - </li> </ul> </div> </div> @@ -163,56 +132,6 @@ <div class="container"> {% block content %} {% endblock content %} - <footer class="pt-4 my-md-5 pt-md-5 border-top"> - <div class="row"> - <div class="col-12 col-md"> - <img class="mb-2" src="#" alt="" width="24" height="19"> - <small class="d-block mb-3 text-muted">© 2024</small> - </div> - <div class="col-6 col-md"> - <h5>Features</h5> - <ul class="list-unstyled text-small"> - <li class="mb-1"><a class="link-secondary text-decoration-none" href="#">Cool stuff</a> - </li> - <li class="mb-1"><a class="link-secondary text-decoration-none" href="#">Random - feature</a></li> - <li class="mb-1"><a class="link-secondary text-decoration-none" href="#">Team - feature</a></li> - <li class="mb-1"><a class="link-secondary text-decoration-none" href="#">Stuff for - developers</a></li> - <li class="mb-1"><a class="link-secondary text-decoration-none" href="#">Another one</a> - </li> - <li class="mb-1"><a class="link-secondary text-decoration-none" href="#">Last time</a> - </li> - </ul> - </div> - <div class="col-6 col-md"> - <h5>Pages on this site</h5> - <ul class="list-unstyled text-small"> - <li class="mb-1"><a class="link-secondary text-decoration-none" - href="{% url "resources:resource_list" %}">Resources</a></li> - <li class="mb-1"><a class="link-secondary text-decoration-none" href="#">Resource - name</a></li> - <li class="mb-1"><a class="link-secondary text-decoration-none" href="#">Another - resource</a></li> - <li class="mb-1"><a class="link-secondary text-decoration-none" href="#">Final - resource</a></li> - </ul> - </div> - <div class="col-6 col-md"> - <h5>About</h5> - <ul class="list-unstyled text-small"> - <li class="mb-1"><a class="link-secondary text-decoration-none" href="#">Team</a></li> - <li class="mb-1"><a class="link-secondary text-decoration-none" href="#">Locations</a> - </li> - <li class="mb-1"><a class="link-secondary text-decoration-none" href="#">Privacy</a> - </li> - <li class="mb-1"><a class="link-secondary text-decoration-none" href="#">Terms</a></li> - </ul> - </div> - </div> - </footer> - </div> {% endblock main %} {% endblock body %} diff --git a/alphabetlearning/templates/pages/home.html b/alphabetlearning/templates/pages/home.html index aa206f3..633c607 100644 --- a/alphabetlearning/templates/pages/home.html +++ b/alphabetlearning/templates/pages/home.html @@ -3,348 +3,32 @@ {% load static %} {% block content %} - <svg xmlns="http://www.w3.org/2000/svg" style="display: none;"> - <symbol id="check" viewBox="0 0 16 16"> - <title>Check</title> - <path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"/> - </symbol> - <symbol id="bootstrap" viewBox="0 0 118 94"> - <title>Bootstrap</title> - <path fill-rule="evenodd" clip-rule="evenodd" - d="M24.509 0c-6.733 0-11.715 5.893-11.492 12.284.214 6.14-.064 14.092-2.066 20.577C8.943 39.365 5.547 43.485 0 44.014v5.972c5.547.529 8.943 4.649 10.951 11.153 2.002 6.485 2.28 14.437 2.066 20.577C12.794 88.106 17.776 94 24.51 94H93.5c6.733 0 11.714-5.893 11.491-12.284-.214-6.14.064-14.092 2.066-20.577 2.009-6.504 5.396-10.624 10.943-11.153v-5.972c-5.547-.529-8.934-4.649-10.943-11.153-2.002-6.484-2.28-14.437-2.066-20.577C105.214 5.894 100.233 0 93.5 0H24.508zM80 57.863C80 66.663 73.436 72 62.543 72H44a2 2 0 01-2-2V24a2 2 0 012-2h18.437c9.083 0 15.044 4.92 15.044 12.474 0 5.302-4.01 10.049-9.119 10.88v.277C75.317 46.394 80 51.21 80 57.863zM60.521 28.34H49.948v14.934h8.905c6.884 0 10.68-2.772 10.68-7.727 0-4.643-3.264-7.207-9.012-7.207zM49.948 49.2v16.458H60.91c7.167 0 10.964-2.876 10.964-8.281 0-5.406-3.903-8.178-11.425-8.178H49.948z"></path> - </symbol> - <symbol id="home" viewBox="0 0 16 16"> - <path d="M8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4.5a.5.5 0 0 0 .5-.5v-4h2v4a.5.5 0 0 0 .5.5H14a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146zM2.5 14V7.707l5.5-5.5 5.5 5.5V14H10v-4a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v4H2.5z"/> - </symbol> - <symbol id="speedometer2" viewBox="0 0 16 16"> - <path d="M8 4a.5.5 0 0 1 .5.5V6a.5.5 0 0 1-1 0V4.5A.5.5 0 0 1 8 4zM3.732 5.732a.5.5 0 0 1 .707 0l.915.914a.5.5 0 1 1-.708.708l-.914-.915a.5.5 0 0 1 0-.707zM2 10a.5.5 0 0 1 .5-.5h1.586a.5.5 0 0 1 0 1H2.5A.5.5 0 0 1 2 10zm9.5 0a.5.5 0 0 1 .5-.5h1.5a.5.5 0 0 1 0 1H12a.5.5 0 0 1-.5-.5zm.754-4.246a.389.389 0 0 0-.527-.02L7.547 9.31a.91.91 0 1 0 1.302 1.258l3.434-4.297a.389.389 0 0 0-.029-.518z"/> - <path fill-rule="evenodd" - d="M0 10a8 8 0 1 1 15.547 2.661c-.442 1.253-1.845 1.602-2.932 1.25C11.309 13.488 9.475 13 8 13c-1.474 0-3.31.488-4.615.911-1.087.352-2.49.003-2.932-1.25A7.988 7.988 0 0 1 0 10zm8-7a7 7 0 0 0-6.603 9.329c.203.575.923.876 1.68.63C4.397 12.533 6.358 12 8 12s3.604.532 4.923.96c.757.245 1.477-.056 1.68-.631A7 7 0 0 0 8 3z"/> - </symbol> - <symbol id="table" viewBox="0 0 16 16"> - <path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm15 2h-4v3h4V4zm0 4h-4v3h4V8zm0 4h-4v3h3a1 1 0 0 0 1-1v-2zm-5 3v-3H6v3h4zm-5 0v-3H1v2a1 1 0 0 0 1 1h3zm-4-4h4V8H1v3zm0-4h4V4H1v3zm5-3v3h4V4H6zm4 4H6v3h4V8z"/> - </symbol> - <symbol id="people-circle" viewBox="0 0 16 16"> - <path d="M11 6a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"/> - <path fill-rule="evenodd" - d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8zm8-7a7 7 0 0 0-5.468 11.37C3.242 11.226 4.805 10 8 10s4.757 1.225 5.468 2.37A7 7 0 0 0 8 1z"/> - </symbol> - <symbol id="grid" viewBox="0 0 16 16"> - <path d="M1 2.5A1.5 1.5 0 0 1 2.5 1h3A1.5 1.5 0 0 1 7 2.5v3A1.5 1.5 0 0 1 5.5 7h-3A1.5 1.5 0 0 1 1 5.5v-3zM2.5 2a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zm6.5.5A1.5 1.5 0 0 1 10.5 1h3A1.5 1.5 0 0 1 15 2.5v3A1.5 1.5 0 0 1 13.5 7h-3A1.5 1.5 0 0 1 9 5.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zM1 10.5A1.5 1.5 0 0 1 2.5 9h3A1.5 1.5 0 0 1 7 10.5v3A1.5 1.5 0 0 1 5.5 15h-3A1.5 1.5 0 0 1 1 13.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zm6.5.5A1.5 1.5 0 0 1 10.5 9h3a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-3A1.5 1.5 0 0 1 9 13.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3z"/> - </symbol> - <symbol id="collection" viewBox="0 0 16 16"> - <path d="M2.5 3.5a.5.5 0 0 1 0-1h11a.5.5 0 0 1 0 1h-11zm2-2a.5.5 0 0 1 0-1h7a.5.5 0 0 1 0 1h-7zM0 13a1.5 1.5 0 0 0 1.5 1.5h13A1.5 1.5 0 0 0 16 13V6a1.5 1.5 0 0 0-1.5-1.5h-13A1.5 1.5 0 0 0 0 6v7zm1.5.5A.5.5 0 0 1 1 13V6a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-.5.5h-13z"/> - </symbol> - <symbol id="calendar3" viewBox="0 0 16 16"> - <path d="M14 0H2a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zM1 3.857C1 3.384 1.448 3 2 3h12c.552 0 1 .384 1 .857v10.286c0 .473-.448.857-1 .857H2c-.552 0-1-.384-1-.857V3.857z"/> - <path d="M6.5 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-9 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-9 3a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/> - </symbol> - <symbol id="chat-quote-fill" viewBox="0 0 16 16"> - <path d="M16 8c0 3.866-3.582 7-8 7a9.06 9.06 0 0 1-2.347-.306c-.584.296-1.925.864-4.181 1.234-.2.032-.352-.176-.273-.362.354-.836.674-1.95.77-2.966C.744 11.37 0 9.76 0 8c0-3.866 3.582-7 8-7s8 3.134 8 7zM7.194 6.766a1.688 1.688 0 0 0-.227-.272 1.467 1.467 0 0 0-.469-.324l-.008-.004A1.785 1.785 0 0 0 5.734 6C4.776 6 4 6.746 4 7.667c0 .92.776 1.666 1.734 1.666.343 0 .662-.095.931-.26-.137.389-.39.804-.81 1.22a.405.405 0 0 0 .011.59c.173.16.447.155.614-.01 1.334-1.329 1.37-2.758.941-3.706a2.461 2.461 0 0 0-.227-.4zM11 9.073c-.136.389-.39.804-.81 1.22a.405.405 0 0 0 .012.59c.172.16.446.155.613-.01 1.334-1.329 1.37-2.758.942-3.706a2.466 2.466 0 0 0-.228-.4 1.686 1.686 0 0 0-.227-.273 1.466 1.466 0 0 0-.469-.324l-.008-.004A1.785 1.785 0 0 0 10.07 6c-.957 0-1.734.746-1.734 1.667 0 .92.777 1.666 1.734 1.666.343 0 .662-.095.931-.26z"/> - </symbol> - <symbol id="cpu-fill" viewBox="0 0 16 16"> - <path d="M6.5 6a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3z"/> - <path d="M5.5.5a.5.5 0 0 0-1 0V2A2.5 2.5 0 0 0 2 4.5H.5a.5.5 0 0 0 0 1H2v1H.5a.5.5 0 0 0 0 1H2v1H.5a.5.5 0 0 0 0 1H2v1H.5a.5.5 0 0 0 0 1H2A2.5 2.5 0 0 0 4.5 14v1.5a.5.5 0 0 0 1 0V14h1v1.5a.5.5 0 0 0 1 0V14h1v1.5a.5.5 0 0 0 1 0V14h1v1.5a.5.5 0 0 0 1 0V14a2.5 2.5 0 0 0 2.5-2.5h1.5a.5.5 0 0 0 0-1H14v-1h1.5a.5.5 0 0 0 0-1H14v-1h1.5a.5.5 0 0 0 0-1H14v-1h1.5a.5.5 0 0 0 0-1H14A2.5 2.5 0 0 0 11.5 2V.5a.5.5 0 0 0-1 0V2h-1V.5a.5.5 0 0 0-1 0V2h-1V.5a.5.5 0 0 0-1 0V2h-1V.5zm1 4.5h3A1.5 1.5 0 0 1 11 6.5v3A1.5 1.5 0 0 1 9.5 11h-3A1.5 1.5 0 0 1 5 9.5v-3A1.5 1.5 0 0 1 6.5 5z"/> - </symbol> - <symbol id="gear-fill" viewBox="0 0 16 16"> - <path d="M9.405 1.05c-.413-1.4-2.397-1.4-2.81 0l-.1.34a1.464 1.464 0 0 1-2.105.872l-.31-.17c-1.283-.698-2.686.705-1.987 1.987l.169.311c.446.82.023 1.841-.872 2.105l-.34.1c-1.4.413-1.4 2.397 0 2.81l.34.1a1.464 1.464 0 0 1 .872 2.105l-.17.31c-.698 1.283.705 2.686 1.987 1.987l.311-.169a1.464 1.464 0 0 1 2.105.872l.1.34c.413 1.4 2.397 1.4 2.81 0l.1-.34a1.464 1.464 0 0 1 2.105-.872l.31.17c1.283.698 2.686-.705 1.987-1.987l-.169-.311a1.464 1.464 0 0 1 .872-2.105l.34-.1c1.4-.413 1.4-2.397 0-2.81l-.34-.1a1.464 1.464 0 0 1-.872-2.105l.17-.31c.698-1.283-.705-2.686-1.987-1.987l-.311.169a1.464 1.464 0 0 1-2.105-.872l-.1-.34zM8 10.93a2.929 2.929 0 1 1 0-5.86 2.929 2.929 0 0 1 0 5.858z"/> - </symbol> - <symbol id="speedometer" viewBox="0 0 16 16"> - <path d="M8 2a.5.5 0 0 1 .5.5V4a.5.5 0 0 1-1 0V2.5A.5.5 0 0 1 8 2zM3.732 3.732a.5.5 0 0 1 .707 0l.915.914a.5.5 0 1 1-.708.708l-.914-.915a.5.5 0 0 1 0-.707zM2 8a.5.5 0 0 1 .5-.5h1.586a.5.5 0 0 1 0 1H2.5A.5.5 0 0 1 2 8zm9.5 0a.5.5 0 0 1 .5-.5h1.5a.5.5 0 0 1 0 1H12a.5.5 0 0 1-.5-.5zm.754-4.246a.389.389 0 0 0-.527-.02L7.547 7.31A.91.91 0 1 0 8.85 8.569l3.434-4.297a.389.389 0 0 0-.029-.518z"/> - <path fill-rule="evenodd" - d="M6.664 15.889A8 8 0 1 1 9.336.11a8 8 0 0 1-2.672 15.78zm-4.665-4.283A11.945 11.945 0 0 1 8 10c2.186 0 4.236.585 6.001 1.606a7 7 0 1 0-12.002 0z"/> - </symbol> - <symbol id="toggles2" viewBox="0 0 16 16"> - <path d="M9.465 10H12a2 2 0 1 1 0 4H9.465c.34-.588.535-1.271.535-2 0-.729-.195-1.412-.535-2z"/> - <path d="M6 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm0 1a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm.535-10a3.975 3.975 0 0 1-.409-1H4a1 1 0 0 1 0-2h2.126c.091-.355.23-.69.41-1H4a2 2 0 1 0 0 4h2.535z"/> - <path d="M14 4a4 4 0 1 1-8 0 4 4 0 0 1 8 0z"/> - </symbol> - <symbol id="tools" viewBox="0 0 16 16"> - <path d="M1 0L0 1l2.2 3.081a1 1 0 0 0 .815.419h.07a1 1 0 0 1 .708.293l2.675 2.675-2.617 2.654A3.003 3.003 0 0 0 0 13a3 3 0 1 0 5.878-.851l2.654-2.617.968.968-.305.914a1 1 0 0 0 .242 1.023l3.356 3.356a1 1 0 0 0 1.414 0l1.586-1.586a1 1 0 0 0 0-1.414l-3.356-3.356a1 1 0 0 0-1.023-.242L10.5 9.5l-.96-.96 2.68-2.643A3.005 3.005 0 0 0 16 3c0-.269-.035-.53-.102-.777l-2.14 2.141L12 4l-.364-1.757L13.777.102a3 3 0 0 0-3.675 3.68L7.462 6.46 4.793 3.793a1 1 0 0 1-.293-.707v-.071a1 1 0 0 0-.419-.814L1 0zm9.646 10.646a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708l-3-3a.5.5 0 0 1 0-.708zM3 11l.471.242.529.026.287.445.445.287.026.529L5 13l-.242.471-.026.529-.445.287-.287.445-.529.026L3 15l-.471-.242L2 14.732l-.287-.445L1.268 14l-.026-.529L1 13l.242-.471.026-.529.445-.287.287-.445.529-.026L3 11z"/> - </symbol> - <symbol id="chevron-right" viewBox="0 0 16 16"> - <path fill-rule="evenodd" - d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/> - </symbol> - <symbol id="geo-fill" viewBox="0 0 16 16"> - <path fill-rule="evenodd" - d="M4 4a4 4 0 1 1 4.5 3.969V13.5a.5.5 0 0 1-1 0V7.97A4 4 0 0 1 4 3.999zm2.493 8.574a.5.5 0 0 1-.411.575c-.712.118-1.28.295-1.655.493a1.319 1.319 0 0 0-.37.265.301.301 0 0 0-.057.09V14l.002.008a.147.147 0 0 0 .016.033.617.617 0 0 0 .145.15c.165.13.435.27.813.395.751.25 1.82.414 3.024.414s2.273-.163 3.024-.414c.378-.126.648-.265.813-.395a.619.619 0 0 0 .146-.15.148.148 0 0 0 .015-.033L12 14v-.004a.301.301 0 0 0-.057-.09 1.318 1.318 0 0 0-.37-.264c-.376-.198-.943-.375-1.655-.493a.5.5 0 1 1 .164-.986c.77.127 1.452.328 1.957.594C12.5 13 13 13.4 13 14c0 .426-.26.752-.544.977-.29.228-.68.413-1.116.558-.878.293-2.059.465-3.34.465-1.281 0-2.462-.172-3.34-.465-.436-.145-.826-.33-1.116-.558C3.26 14.752 3 14.426 3 14c0-.599.5-1 .961-1.243.505-.266 1.187-.467 1.957-.594a.5.5 0 0 1 .575.411z"/> - </symbol> - </svg> - - <div class="container"> <div class="row"> <div class="px-4 py-5 my-5 text-center"> - <h1 class="display-5 fw-bold">High quality educational resources</h1> <div class="col-lg-6 mx-auto"> - <p class="lead mb-4">I am very good at making resources for young children and here I am, selling - them to you. - You will find that these are some of the best educational resoures on the internet.</p> - <div class="d-grid gap-2 d-sm-flex justify-content-sm-center"> - <button type="button" class="btn btn-primary btn-lg px-4 gap-3">Sign up for access</button> - <button type="button" class="btn btn-outline-secondary btn-lg px-4">More information</button> - </div> - </div> - </div> - </div> - - - {# Image section#} - <div class="container my-5"> - <div class="row"> - <div class="col-lg-6 mx-auto"> - <h2 class="display-5 fw-bold text-center mb-4">Sample Resources</h2> - <div class="ratio ratio-16x9 mb-4"> - <img src="#" class="img-fluid rounded" - alt="Sample Resource"> - </div> - <p class="lead text-center">This is a sample of the high-quality educational resources you can - access with our membership plans. Our resources are carefully crafted by experienced educators - to engage and inspire young learners.</p> - </div> - </div> - </div> - - - <div class="feature-divider"></div> - - <div class="row"> - - <div class="container px-4 py-5" id="hanging-icons"> - <div class="row g-4 py-5 row-cols-1 row-cols-lg-3"> - <div class="col d-flex align-items-start"> - <div class="icon-square bg-light text-dark flex-shrink-0 me-3"> - <svg class="bi" width="1em" height="1em"> - <use xlink:href="#toggles2"/> - </svg> - </div> - <div> - <h2>First benefit</h2> - <p>Some nice descriptive text about the feature here. Sell it and make - it really exciting!</p> - <a href="#" class="icon-link"> - Call to action - <svg class="bi" width="1em" height="1em"> - <use xlink:href="#chevron-right"/> - </svg> - </a> - </div> - </div> - <div class="col d-flex align-items-start"> - <div class="icon-square bg-light text-dark flex-shrink-0 me-3"> - <svg class="bi" width="1em" height="1em"> - <use xlink:href="#cpu-fill"/> - </svg> - </div> - <div> - <h2>Featured title</h2> - <p>Some nice descriptive text about the feature here. Sell it and make - it really exciting!</p> - <a href="#" class="icon-link"> - Call to action - <svg class="bi" width="1em" height="1em"> - <use xlink:href="#chevron-right"/> - </svg> - </a> - </div> - </div> - <div class="col d-flex align-items-start"> - <div class="icon-square bg-light text-dark flex-shrink-0 me-3"> - <svg class="bi" width="1em" height="1em"> - <use xlink:href="#tools"/> - </svg> - </div> - <div> - <h2>Featured title</h2> - <p>Some nice descriptive text about the feature here. Sell it and make - it really exciting!</p> - - <a href="#" class="icon-link"> - Call to action - <svg class="bi" width="1em" height="1em"> - <use xlink:href="#chevron-right"/> - </svg> - </a> - </div> - </div> - </div> - </div> - </div> - </div> - - <div class="feature-divider"></div> - - <div class="pricing-header p-3 pb-md-4 mx-auto text-center"> - <h1 class="display-4 fw-normal">Pricing</h1> - <p class="fs-5 text-muted">Quickly build an effective pricing table for your potential customers with this - Bootstrap example. It’s built with default Bootstrap components and utilities with little customization.</p> - </div> - - - <div class="row row-cols-1 row-cols-md-3 mb-3 text-center"> - <div class="col"> - <div class="card mb-4 rounded-3 shadow-sm"> - <div class="card-header py-3"> - <h4 class="my-0 fw-normal">Starter</h4> - </div> - <div class="card-body"> - <h1 class="card-title pricing-card-title">£0<small class="text-muted fw-light">/mo</small></h1> - <ul class="list-unstyled mt-3 mb-4"> - <li>20 resources included</li> - <li>Something else that is basic</li> - <li>Email support</li> - <li>Help center access</li> - </ul> - <button type="button" class="w-100 btn btn-lg btn-outline-primary">Sign up for free</button> - </div> - </div> - </div> - <div class="col"> - <div class="card mb-4 rounded-3 shadow-sm"> - <div class="card-header py-3"> - <h4 class="my-0 fw-normal">Learner</h4> - </div> - <div class="card-body"> - <h1 class="card-title pricing-card-title">£4.99<small class="text-muted fw-light">/mo</small></h1> - <ul class="list-unstyled mt-3 mb-4"> - <li>100 resources included</li> - <li>Something else that is pro</li> - <li>Email support</li> - <li>Help center access</li> - </ul> - <button type="button" class="w-100 btn btn-lg btn-primary">Get started</button> + <p class="lead mb-4 mt-4"> + Alphabet Learning is a brand new platform selling high quality educational resources. + As of November 2024, the site is currently in active development and will be launched soon. + </p> + <p class="lead mb-4">To be kept informed about the site launch and to receive <strong>50% off your first purchase</strong>, please submit your email address + to join our new-customer mailing list.</p> + <form method="post" action="{% url 'payments:email_signup' %}"> + {% csrf_token %} + <div class="mb-3"> + <label for="email" class="lead text-start form-label font-weight-bold">Your email address:</label> + <input type="email" class="form-control" id="email" name="email" required> + </div> + <button type="submit" class="btn btn-primary btn-lg">Submit</button> + </form> + <p class="text-start text-sm text-muted my-4"> + <small>By clicking 'Submit' you agree to us retaining your email address in accordance with our <a href="{% url 'payments:privacy_policy' %}">Privacy and Legal Notice</a>.</small> + </p> + <p class="my-4"> + + </p> </div> </div> </div> - <div class="col"> - <div class="card mb-4 rounded-3 shadow-sm border-primary"> - <div class="card-header py-3 text-white bg-primary border-primary"> - <h4 class="my-0 fw-normal">Member</h4> - </div> - <div class="card-body"> - <h1 class="card-title pricing-card-title">£8.99<small class="text-muted fw-light">/mo</small></h1> - <ul class="list-unstyled mt-3 mb-4"> - <li>All resources included</li> - <li>Something else that is really good</li> - <li>Email support</li> - <li>Help center access</li> - </ul> - <button type="button" class="w-100 btn btn-lg btn-primary">Get Started</button> - </div> - </div> - </div> - </div> - - <h2 class="display-6 text-center mb-4">Compare plans</h2> - - <div class="table-responsive"> - <table class="table text-center"> - <thead> - <tr> - <th style="width: 34%;"></th> - <th style="width: 22%;">Starter</th> - <th style="width: 22%;">Learner</th> - <th style="width: 22%;">Member</th> - </tr> - </thead> - <tbody> - <tr> - <th scope="row" class="text-start">Public</th> - <td> - <svg class="bi" width="24" height="24"> - <use xlink:href="#check"/> - </svg> - </td> - <td> - <svg class="bi" width="24" height="24"> - <use xlink:href="#check"/> - </svg> - </td> - <td> - <svg class="bi" width="24" height="24"> - <use xlink:href="#check"/> - </svg> - </td> - </tr> - <tr> - <th scope="row" class="text-start">Private</th> - <td></td> - <td> - <svg class="bi" width="24" height="24"> - <use xlink:href="#check"/> - </svg> - </td> - <td> - <svg class="bi" width="24" height="24"> - <use xlink:href="#check"/> - </svg> - </td> - </tr> - </tbody> - - <tbody> - <tr> - <th scope="row" class="text-start">Permissions</th> - <td> - <svg class="bi" width="24" height="24"> - <use xlink:href="#check"/> - </svg> - </td> - <td> - <svg class="bi" width="24" height="24"> - <use xlink:href="#check"/> - </svg> - </td> - <td> - <svg class="bi" width="24" height="24"> - <use xlink:href="#check"/> - </svg> - </td> - </tr> - <tr> - <th scope="row" class="text-start">Sharing</th> - <td></td> - <td> - <svg class="bi" width="24" height="24"> - <use xlink:href="#check"/> - </svg> - </td> - <td> - <svg class="bi" width="24" height="24"> - <use xlink:href="#check"/> - </svg> - </td> - </tr> - <tr> - <th scope="row" class="text-start">Unlimited members</th> - <td></td> - <td> - <svg class="bi" width="24" height="24"> - <use xlink:href="#check"/> - </svg> - </td> - <td> - <svg class="bi" width="24" height="24"> - <use xlink:href="#check"/> - </svg> - </td> - </tr> - <tr> - <th scope="row" class="text-start">Extra security</th> - <td></td> - <td></td> - <td> - <svg class="bi" width="24" height="24"> - <use xlink:href="#check"/> - </svg> - </td> - </tr> - </tbody> - </table> - </div> - - - {% endblock content %} diff --git a/alphabetlearning/templates/pages/privacy_policy.html b/alphabetlearning/templates/pages/privacy_policy.html new file mode 100644 index 0000000..df8544d --- /dev/null +++ b/alphabetlearning/templates/pages/privacy_policy.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} + +{% block content %} + <div class="container text-start"> + <h1 class="font-weight-bold my-4">Privacy and Data Policy</h1> + <p>Your privacy is important to us. This policy explains how we collect, use, and protect your information.</p> + <h3 class="font-weight-bold">Information We Collect</h3> + <p>We collect information that you provide to us directly, such as your email address when you sign up for our newsletter.</p> + <h3 class="font-weight-bold">How We Use Your Information</h3> + <p>Your information is used to send you updates about our services and promotions.</p> + <h3 class="font-weight-bold">Data Protection</h3> + <p>We take appropriate security measures to protect your personal information.</p> + <h3 class="font-weight-bold">Contact Us</h3> + <p>If you have any questions about this policy, please contact us.</p> + <p class="mt-4">Additionally, if you would like to have your email removed from our database, please email us at <a href="mailto:help@alphabetlearning.online">help@alphabetlearning.online</a> with your request.</p> + </div> +{% endblock content %}
\ No newline at end of file diff --git a/alphabetlearning/templates/payments/success_email_signup.html b/alphabetlearning/templates/payments/success_email_signup.html new file mode 100644 index 0000000..f953beb --- /dev/null +++ b/alphabetlearning/templates/payments/success_email_signup.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} + +{% load static %} + +{% block content %} + <div class="container my-5"> + <div class="row"> + <h2>Thanks for signing up!</h2> + <p>When we go live, we will be in touch with a 50% off discount code for your first purchase and other exclusive offers.</p> + </div> +{% endblock content %}
\ No newline at end of file diff --git a/config/urls.py b/config/urls.py index c77f187..e213522 100644 --- a/config/urls.py +++ b/config/urls.py @@ -15,7 +15,7 @@ from django.views.generic import TemplateView admin.site.site_header = "Blackbird Admin Panel" urlpatterns = [ - path("", login_required(TemplateView.as_view(template_name="pages/home.html")), name="home"), + path("", TemplateView.as_view(template_name="pages/home.html"), name="home"), path( "about/", TemplateView.as_view(template_name="pages/about.html"), |