diff --git a/myproject/Dockerfile b/myproject/Dockerfile index 7a8fc00a0db6ebcd262868b26a3cee7f58ae9cb4..5c0c8d92ec646f39341d138960e27fa663e2295a 100644 --- a/myproject/Dockerfile +++ b/myproject/Dockerfile @@ -15,7 +15,7 @@ COPY ./myapp/static ./myapp/static COPY tailwind.config.js ./ # Run the Tailwind build process -#RUN npx tailwindcss-cli build myapp/static/src/input.css -o myapp/static/src/output.css +# RUN npx tailwindcss-cli build myapp/static/src/input.css -o myapp/static/src/output.css # Use an official Python runtime as the final stage FROM python:3.11 diff --git a/myproject/myapp/receipts.py b/myproject/myapp/receipts.py new file mode 100644 index 0000000000000000000000000000000000000000..1194d56808eb17a228a1095f00a7350ee0a8d5fc --- /dev/null +++ b/myproject/myapp/receipts.py @@ -0,0 +1,8 @@ +# We want to generate receipts for user monthly billing. +# We want the function to accept a user +# It should return the user's username, blanked out details and cost +from fpdf import FPDF + +class PDF(FPDF): + pass # do nothing when it's executed + diff --git a/myproject/myapp/templates/_base.html b/myproject/myapp/templates/_base.html index ed8586a8d7ed226bb3f3b4c9284de6c1b63bdae9..5e35e256a65a6f7ea62658e727a4d1ee916fa7fb 100644 --- a/myproject/myapp/templates/_base.html +++ b/myproject/myapp/templates/_base.html @@ -12,7 +12,7 @@ </head> <body> - <nav class="bg-white border-gray-200 dark:bg-gray-900"> + <nav class=" border-gray-200 dark:bg-gray-900"> <div class="max-w-screen-xl flex flex-wrap items-center justify-between mx-auto p-4" > @@ -88,63 +88,87 @@ </div> </div> </nav> - <div class="container mx-auto mt-4"> + <div class="container mx-auto mt-6"> {% block content %} {% endblock content %} - </div> - <script src="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.3.0/flowbite.min.js"></script> - -</body> - -<footer class="bg-white dark:bg-gray-900 w-full"> - <div class="mx-auto w-full max-w-screen-xl py-6 lg:py-8"> - <div class="md:flex md:justify-between"> - <div class="mb-6 md:mb-0"> - <img src="https://upload.wikimedia.org/wikipedia/commons/1/11/UWE_Bristol_logo.svg" class="me-4" alt="UWE Logo" /> - </a> - </div> - <div class="grid grid-cols-2 gap-5 sm:gap-6 sm:grid-cols-3"> - <div> - <h2 class="mb-6 text-sm font-semibold text-gray-900 uppercase dark:text-white">Resources</h2> - <ul class="text-gray-500 dark:text-gray-400 font-medium"> - <li class="mb-4"> - <a href="https://flowbite.com/" class="hover:underline">Flowbite</a> - </li> - <li> - <a href="https://tailwindcss.com/" class="hover:underline">Tailwind CSS</a> - </li> - </ul> - </div> - <div> - <h2 class="mb-6 text-sm font-semibold text-gray-900 uppercase dark:text-white">Follow us</h2> - <ul class="text-gray-500 dark:text-gray-400 font-medium"> - <li class="mb-4"> - <a href="#" class="hover:underline ">Github</a> - </li> - <li> - <a href="#" class="hover:underline">Discord</a> - </li> - </ul> - </div> - <div> - <h2 class="mb-6 text-sm font-semibold text-gray-900 uppercase dark:text-white">Legal</h2> - <ul class="text-gray-500 dark:text-gray-400 font-medium"> - <li class="mb-4"> - <a href="{% url 'privacy_policy' %}" class="hover:underline">Privacy Policy</a> - </li> - <li> - <a href="{% url 'terms_conditions' %}" class="hover:underline">Terms & Conditions</a> - </li> - </ul> - </div> - </div> - </div> - <hr class="my-6 border-gray-200 sm:mx-auto dark:border-gray-700 lg:my-8" /> - <div class="sm:flex sm:items-center sm:justify-between"> - <span class="text-sm text-gray-500 sm:text-center dark:text-gray-400">© 2024 <a href="https://flowbite.com/" class="hover:underline">DESD Group 25</a>. All Rights Reserved. - </span> + </div> + <!-- <footer class="bg-white dark:bg-gray-900 fixed bottom-0 w-full"> --> + <footer class="bg- dark:bg-gray-900 bottom-0 w-full mt-6"> + <div class="mx-auto w-full max-w-screen-xl py-6 lg:py-8"> + <div class="md:flex md:justify-between"> + <div class="mb-2 md:mb-0"> + <img src="https://upload.wikimedia.org/wikipedia/commons/1/11/UWE_Bristol_logo.svg" class="h-10 me-4" alt="UWE Logo" /> + </a> + </div> + <div class="grid grid-cols-2 gap-5 sm:gap-6 sm:grid-cols-3"> + <div> + <h2 class="mb-6 text-sm font-semibold text-gray-900 uppercase dark:text-white">Resources</h2> + <ul class="text-gray-500 dark:text-gray-400 font-medium"> + <li class="mb-4"> + <a href="https://flowbite.com/" class="hover:underline">Flowbite</a> + </li> + <li> + <a href="https://tailwindcss.com/" class="hover:underline">Tailwind CSS</a> + </li> + </ul> + </div> + <div> + <h2 class="mb-6 text-sm font-semibold text-gray-900 uppercase dark:text-white">Follow us</h2> + <ul class="text-gray-500 dark:text-gray-400 font-medium"> + <li class="mb-4"> + <a href="#" class="hover:underline ">Github</a> + </li> + <li> + <a href="#" class="hover:underline">Discord</a> + </li> + </ul> + </div> + <div> + <h2 class="mb-6 text-sm font-semibold text-gray-900 uppercase dark:text-white">Legal</h2> + <ul class="text-gray-500 dark:text-gray-400 font-medium"> + <li class="mb-4"> + <a href="#" class="hover:underline">Privacy Policy</a> + </li> + <li> + <a href="#" class="hover:underline">Terms & Conditions</a> + </li> + </ul> + </div> + </div> </div> -</footer> - + <hr class="my-6 border-gray-200 sm:mx-auto dark:border-gray-700 lg:my-8" /> + <div class="sm:flex sm:items-center sm:justify-between"> + <span class="text-sm text-gray-500 sm:text-center dark:text-gray-400">© 2024 <a href="https://flowbite.com/" class="hover:underline">DESD Group 25</a>. All Rights Reserved. + </span> + <div class="flex mt-4 sm:justify-center sm:mt-0"> + {% comment %} <a href="#" class="text-gray-500 hover:text-gray-900 dark:hover:text-white"> + <svg class="w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 8 19"> + <path fill-rule="evenodd" d="M6.135 3H8V0H6.135a4.147 4.147 0 0 0-4.142 4.142V6H0v3h2v9.938h3V9h2.021l.592-3H5V3.591A.6.6 0 0 1 5.592 3h.543Z" clip-rule="evenodd"/> + </svg> {% endcomment %} + <span class="sr-only">Facebook page</span> + </a> + {% comment %} <a href="#" class="text-gray-500 hover:text-gray-900 dark:hover:text-white ms-5"> + <svg class="w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 21 16"> + <path d="M16.942 1.556a16.3 16.3 0 0 0-4.126-1.3 12.04 12.04 0 0 0-.529 1.1 15.175 15.175 0 0 0-4.573 0 11.585 11.585 0 0 0-.535-1.1 16.274 16.274 0 0 0-4.129 1.3A17.392 17.392 0 0 0 .182 13.218a15.785 15.785 0 0 0 4.963 2.521c.41-.564.773-1.16 1.084-1.785a10.63 10.63 0 0 1-1.706-.83c.143-.106.283-.217.418-.33a11.664 11.664 0 0 0 10.118 0c.137.113.277.224.418.33-.544.328-1.116.606-1.71.832a12.52 12.52 0 0 0 1.084 1.785 16.46 16.46 0 0 0 5.064-2.595 17.286 17.286 0 0 0-2.973-11.59ZM6.678 10.813a1.941 1.941 0 0 1-1.8-2.045 1.93 1.93 0 0 1 1.8-2.047 1.919 1.919 0 0 1 1.8 2.047 1.93 1.93 0 0 1-1.8 2.045Zm6.644 0a1.94 1.94 0 0 1-1.8-2.045 1.93 1.93 0 0 1 1.8-2.047 1.918 1.918 0 0 1 1.8 2.047 1.93 1.93 0 0 1-1.8 2.045Z"/> + </svg> {% endcomment %} + <span class="sr-only">Discord</span> + </a> + {% comment %} <a href="#" class="text-gray-500 hover:text-gray-900 dark:hover:text-white ms-5"> + <svg class="w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 17"> + <path fill-rule="evenodd" d="M20 1.892a8.178 8.178 0 0 1-2.355.635 4.074 4.074 0 0 0 1.8-2.235 8.344 8.344 0 0 1-2.605.98A4.13 4.13 0 0 0 13.85 0a4.068 4.068 0 0 0-4.1 4.038 4 4 0 0 0 .105.919A11.705 11.705 0 0 1 1.4.734a4.006 4.006 0 0 0 1.268 5.392 4.165 4.165 0 0 1-1.859-.5v.05A4.057 4.057 0 0 0 4.1 9.635a4.19 4.19 0 0 1-1.856.07 4.108 4.108 0 0 0 3.831 2.807A8.36 8.36 0 0 1 0 14.184 11.732 11.732 0 0 0 6.291 16 11.502 11.502 0 0 0 17.964 4.5c0-.177 0-.35-.012-.523A8.143 8.143 0 0 0 20 1.892Z" clip-rule="evenodd"/> + </svg> {% endcomment %} + <span class="sr-only">Twitter page</span> + </a> + <a href="#" class="text-gray-500 hover:text-gray-900 dark:hover:text-white ms-5"> + {% comment %} <svg class="w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"> + <path fill-rule="evenodd" d="M10 .333A9.911 9.911 0 0 0 6.866 19.65c.5.092.678-.215.678-.477 0-.237-.01-1.017-.014-1.845-2.757.6-3.338-1.169-3.338-1.169a2.627 2.627 0 0 0-1.1-1.451c-.9-.615.07-.6.07-.6a2.084 2.084 0 0 1 1.518 1.021 2.11 2.11 0 0 0 2.884.823c.044-.503.268-.973.63-1.325-2.2-.25-4.516-1.1-4.516-4.9A3.832 3.832 0 0 1 4.7 7.068a3.56 3.56 0 0 1 .095-2.623s.832-.266 2.726 1.016a9.409 9.409 0 0 1 4.962 0c1.89-1.282 2.717-1.016 2.717-1.016.366.83.402 1.768.1 2.623a3.827 3.827 0 0 1 1.02 2.659c0 3.807-2.319 4.644-4.525 4.889a2.366 2.366 0 0 1 .673 1.834c0 1.326-.012 2.394-.012 2.72 0 .263.18.572.681.475A9.911 9.911 0 0 0 10 .333Z" clip-rule="evenodd"/> + </svg> {% endcomment %} + <span class="sr-only">GitHub account</span> + </div> + </div> + </div> + </footer> + <script src="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.3.0/flowbite.min.js"></script> + </body> </html> diff --git a/myproject/myapp/templates/login.html b/myproject/myapp/templates/login.html index c1836bb3d5ab5c73e449837021803958ff2a727e..be83014bdd899f2b53b057eb3ed1da78d91b9592 100644 --- a/myproject/myapp/templates/login.html +++ b/myproject/myapp/templates/login.html @@ -1,7 +1,7 @@ {% extends "_base.html"%}{% block content %} <section class="my-10"> <div class="flex flex-col items-center justify-center px-6 py-8 mx-auto md:h-screen lg:py-0"> - <div class="w-full bg-white rounded-lg shadow dark:border md:mt-0 sm:max-w-md xl:p-0 dark:bg-gray-800 dark:border-gray-700"> + <div class="w-full bg-white rounded-lg shadow dark:border md:mt-0 sm:max-w-md lg:w-50 xl:p-0 dark:bg-gray-800 dark:border-gray-700"> <div class="p-6 space-y-4 md:space-y-6 sm:p-8"> <h1 class="text-xl font-bold leading-tight tracking-tight text-gray-900 md:text-2xl dark:text-white"> Sign in to your account diff --git a/myproject/myapp/templates/pricing.html b/myproject/myapp/templates/pricing.html index cc7b60b27275a82b97ffbfdfa226a58dd58ce253..66b2954f536f2966a322c262b68b0341cd95856e 100644 --- a/myproject/myapp/templates/pricing.html +++ b/myproject/myapp/templates/pricing.html @@ -1,3 +1,115 @@ {% extends "_base.html" %}{% block content %} -<h1>Pricing page</h1> + +<div class="grid grid-cols-2 content-start"> + <div class="w-full mx-auto max-w-sm p-4 bg-white border border-gray-200 rounded-lg shadow sm:p-8 dark:bg-gray-800 dark:border-gray-700"> + <h5 class="mb-4 text-xl font-medium text-gray-500 dark:text-gray-400">Trial plan</h5> + <div class="flex items-baseline text-gray-900 dark:text-white"> + <span class="text-5xl font-extrabold tracking-tight">Free</span> + </div> + <ul role="list" class="space-y-5 my-7"> + <li class="flex items-center"> + <svg class="flex-shrink-0 w-4 h-4 text-blue-700 dark:text-blue-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"> + <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 8.207-4 4a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L9 10.586l3.293-3.293a1 1 0 0 1 1.414 1.414Z"/> + </svg> + <span class="text-base font-normal leading-tight text-gray-500 dark:text-gray-400 ms-3">1 team member</span> + </li> + <li class="flex"> + <svg class="flex-shrink-0 w-4 h-4 text-blue-700 dark:text-blue-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"> + <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 8.207-4 4a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L9 10.586l3.293-3.293a1 1 0 0 1 1.414 1.414Z"/> + </svg> + <span class="text-base font-normal leading-tight text-gray-500 dark:text-gray-400 ms-3">0GB Cloud storage</span> + </li> + <li class="flex decoration-gray-500"> + <svg class="flex-shrink-0 w-4 h-4 text-blue-700 dark:text-gray-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"> + <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 8.207-4 4a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L9 10.586l3.293-3.293a1 1 0 0 1 1.414 1.414Z"/> + </svg> + <span class="text-base font-normal leading-tight text-gray-500 ms-3">1 File upload</span> + <span class="ms-1 text-sm font-normal text-gray-500 dark:text-gray-400">/month</span> + </li> + <li class="flex line-through decoration-gray-500"> + <svg class="flex-shrink-0 w-4 h-4 text-gray-400 dark:text-blue-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"> + <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 8.207-4 4a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L9 10.586l3.293-3.293a1 1 0 0 1 1.414 1.414Z"/> + </svg> + <span class="text-base font-normal leading-tight text-gray-500 dark:text-gray-400 ms-3">Integration help</span> + </li> + <li class="flex line-through decoration-gray-500"> + <svg class="flex-shrink-0 w-4 h-4 text-gray-400 dark:text-gray-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"> + <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 8.207-4 4a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L9 10.586l3.293-3.293a1 1 0 0 1 1.414 1.414Z"/> + </svg> + <span class="text-base font-normal leading-tight text-gray-500 ms-3">API Access</span> + </li> + <li class="flex line-through decoration-gray-500"> + <svg class="flex-shrink-0 w-4 h-4 text-gray-400 dark:text-gray-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"> + <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 8.207-4 4a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L9 10.586l3.293-3.293a1 1 0 0 1 1.414 1.414Z"/> + </svg> + <span class="text-base font-normal leading-tight text-gray-500 ms-3">Complete documentation</span> + </li> + <li class="flex line-through decoration-gray-500"> + <svg class="flex-shrink-0 w-4 h-4 text-gray-400 dark:text-gray-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"> + <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 8.207-4 4a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L9 10.586l3.293-3.293a1 1 0 0 1 1.414 1.414Z"/> + </svg> + <span class="text-base font-normal leading-tight text-gray-500 ms-3">24×7 phone & email support</span> + </li> + </ul> + <button type="button" class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-200 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-900 font-medium rounded-lg text-sm px-5 py-2.5 inline-flex justify-center w-full text-center">Choose plan</button> + </div> + + <div class="w-full mx-auto max-w-sm p-4 bg-white border border-gray-200 rounded-lg shadow sm:p-8 dark:bg-gray-800 dark:border-gray-700"> + <h5 class="mb-4 text-xl font-medium text-gray-500 dark:text-gray-400">Standard plan</h5> + <div class="flex items-baseline text-gray-900 dark:text-white"> + <span class="text-3xl font-semibold">£</span> + <span class="text-5xl font-extrabold tracking-tight">49</span> + <span class="ms-1 text-xl font-normal text-gray-500 dark:text-gray-400">/month</span> + </div> + <ul role="list" class="space-y-5 my-7"> + <li class="flex items-center"> + <svg class="flex-shrink-0 w-4 h-4 text-blue-700 dark:text-blue-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"> + <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 8.207-4 4a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L9 10.586l3.293-3.293a1 1 0 0 1 1.414 1.414Z"/> + </svg> + <span class="text-base font-normal leading-tight text-gray-500 dark:text-gray-400 ms-3">2 team members</span> + </li> + <li class="flex"> + <svg class="flex-shrink-0 w-4 h-4 text-blue-700 dark:text-blue-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"> + <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 8.207-4 4a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L9 10.586l3.293-3.293a1 1 0 0 1 1.414 1.414Z"/> + </svg> + <span class="text-base font-normal leading-tight text-gray-500 dark:text-gray-400 ms-3">20GB Cloud storage</span> + </li> + <li class="flex decoration-gray-500"> + <svg class="flex-shrink-0 w-4 h-4 text-blue-700 dark:text-gray-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"> + <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 8.207-4 4a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L9 10.586l3.293-3.293a1 1 0 0 1 1.414 1.414Z"/> + </svg> + <span class="text-base font-normal leading-tight text-gray-500 ms-3">100 File Uploads</span> + <span class="ms-1 text-sm font-normal text-gray-500 dark:text-gray-400">/month</span> + </li> + <li class="flex"> + <svg class="flex-shrink-0 w-4 h-4 text-blue-700 dark:text-blue-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"> + <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 8.207-4 4a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L9 10.586l3.293-3.293a1 1 0 0 1 1.414 1.414Z"/> + </svg> + <span class="text-base font-normal leading-tight text-gray-500 dark:text-gray-400 ms-3">Integration help</span> + </li> + <li class="flex decoration-gray-500"> + <svg class="flex-shrink-0 w-4 h-4 text-blue-700 dark:text-gray-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"> + <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 8.207-4 4a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L9 10.586l3.293-3.293a1 1 0 0 1 1.414 1.414Z"/> + </svg> + <span class="text-base font-normal leading-tight text-gray-500 ms-3">API Access</span> + </li> + <li class="flex decoration-gray-500"> + <svg class="flex-shrink-0 w-4 h-4 text-blue-700 dark:text-gray-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"> + <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 8.207-4 4a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L9 10.586l3.293-3.293a1 1 0 0 1 1.414 1.414Z"/> + </svg> + <span class="text-base font-normal leading-tight text-gray-500 ms-3">Complete documentation</span> + </li> + <li class="flex decoration-gray-500"> + <svg class="flex-shrink-0 w-4 h-4 text-blue-700 dark:text-gray-500" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20"> + <path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5Zm3.707 8.207-4 4a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L9 10.586l3.293-3.293a1 1 0 0 1 1.414 1.414Z"/> + </svg> + <span class="text-base font-normal leading-tight text-gray-500 ms-3">24×7 phone & email support</span> + </li> + </ul> + <button type="button" class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-200 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-900 font-medium rounded-lg text-sm px-5 py-2.5 inline-flex justify-center w-full text-center">Choose plan</button> + </div> + +</div> + + {% endblock content %} \ No newline at end of file diff --git a/myproject/myapp/templates/receipt_test.html b/myproject/myapp/templates/receipt_test.html new file mode 100644 index 0000000000000000000000000000000000000000..7378e0017c6b2dae6f6d05b5e460abec796e6439 --- /dev/null +++ b/myproject/myapp/templates/receipt_test.html @@ -0,0 +1,8 @@ +<!-- For testing the receipts ONLY. TODO: delete when working --> +{% extends "_base.html" %}{% block content %} +<h1>receipts</h1> +<a href="{% url 'generate_pdf' %}" download> + <button>Download PDF</button> +</a> + +{% endblock content %} \ No newline at end of file diff --git a/myproject/myapp/templates/user_page.html b/myproject/myapp/templates/user_page.html index 2e621e850141c95d9ca50eb548d320de4f7b7e95..c9f63dbd8618a5b8e38f4506c9cc0b2afcc3fe6d 100644 --- a/myproject/myapp/templates/user_page.html +++ b/myproject/myapp/templates/user_page.html @@ -232,12 +232,14 @@ required /> </div> + <a href="{% url 'generate_pdf' %}" <button type="submit" class="p-2 bg-blue-500 text-white rounded-md hover:bg-blue-600" > Download Financial Statement </button> + </a> </form> {% comment %} REPLACE WITH LOGIC TO CHECK PROPER USER {% endcomment %} </div> diff --git a/myproject/myapp/urls.py b/myproject/myapp/urls.py index 4b7449c4778b0730b4ab82a2e50c711015413272..e4a569e47d050e54dd3ffb487a607712ac8d55fb 100644 --- a/myproject/myapp/urls.py +++ b/myproject/myapp/urls.py @@ -12,6 +12,7 @@ from .views import handling_music_file from .views import pricing +from .views import generate_pdf urlpatterns = [ # path('', index, name='index'), <- uncomment when index/main page will be ready @@ -26,5 +27,7 @@ urlpatterns = [ path('pricay_policy/', privacy_policy, name='privacy_policy'), path('pricing/', pricing, name='pricing'), path('uploading_file/', handling_music_file, name='uploading_file'), - + path('generate_pdf/', generate_pdf, name='generate_pdf') + path('pricing/', pricing, name='pricing'), + path('generate_pdf/', generate_pdf, name='generate_pdf') ] diff --git a/myproject/myapp/views.py b/myproject/myapp/views.py index afe838746f41c477a1629b9a57f70d611d6cf93a..cfa8ed3c0d10a6aa466db187952e316b3a5e6363 100644 --- a/myproject/myapp/views.py +++ b/myproject/myapp/views.py @@ -34,6 +34,9 @@ def handling_music_file(request): log_data = get_log_data(Action.invalid_file, 'error') # create_log(None, log_data) return HttpResponse('File invalid',log_data) +from .models import User +from django.http import HttpResponse +from reportlab.pdfgen import canvas def index(request): #for now this authenication just returns the main view @@ -80,3 +83,16 @@ def privacy_policy(request): def pricing(request): return render(request, 'pricing.html') + +#For testing the receipts ONLY. TODO: delete when working +def generate_pdf(request): + response = HttpResponse(content_type='application/pdf') + response['Content-Disposition'] = 'attachment; filename="example.pdf"' + + p = canvas.Canvas(response) + p.drawString(100, 800, "Hello, this is a PDF!") + p.showPage() + p.save() + + return response + diff --git a/myproject/requirements.txt b/myproject/requirements.txt index edf7e90566d18aac9154bb5b9e4b05666b3e9de3..ba83400cc62f6f10a76948b71e3ca5b25081e705 100644 --- a/myproject/requirements.txt +++ b/myproject/requirements.txt @@ -32,4 +32,6 @@ soundfile==0.12.1 soxr==0.3.7 threadpoolctl==3.3.0 typing_extensions==4.10.0 -urllib3==2.2.1 \ No newline at end of file +urllib3==2.2.1 +typing_extensions==4.9.0 +reportlab==4.1.0 \ No newline at end of file diff --git a/myproject/test.pdf b/myproject/test.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bb5d8ca008dadef4d39f4128e65a2679ff1fec5e Binary files /dev/null and b/myproject/test.pdf differ