Latest Mess of work

This commit is contained in:
ahosking 2023-07-18 18:01:30 -04:00
parent 251ef2b56a
commit 7a8a921e72
34 changed files with 3401 additions and 238 deletions

View File

@ -19,5 +19,7 @@
"titleBar.inactiveForeground": "#15202b99",
"commandCenter.border": "#15202b99"
},
"peacock.color": "#f9e64f"
"peacock.color": "#f9e64f",
"python.linting.flake8Enabled": true,
"python.linting.enabled": true
}

View File

@ -33,7 +33,7 @@ DEBUG = env("DEBUG")
ALLOWED_HOSTS = ["localhost", "127.0.0.1", "192.168.1.187",
"192.168.1.23", "192.168.1.125", "0.0.0.0"]
INTERNAL_IPS = ['127.0.0.1', '0.0.0.0']
# Application definition
@ -51,6 +51,9 @@ INSTALLED_APPS = [
'rest_framework.authtoken',
'django_filters',
'accounts',
'tailwind',
'theme',
'django_browser_reload'
]
@ -62,6 +65,7 @@ MIDDLEWARE = [
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django_browser_reload.middleware.BrowserReloadMiddleware',
]
ROOT_URLCONF = 'api.urls'
@ -189,3 +193,5 @@ STATICFILES_DIRS = [
LOGIN_REDIRECT_URL = "index"
LOGOUT_REDIRECT_URL = "index"
TAILWIND_APP_NAME = 'theme'

View File

@ -1,65 +1,2 @@
{% extends 'header.html' %}
{% load static %}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap demo</title>
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet" />
</head>
<body>
<header class="p-3 text-bg-dark">
<div class="container">
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
<a href="/" class="d-flex align-items-center mb-2 mb-lg-0 text-white text-decoration-none">
<svg class="bi me-2" width="40" height="32" role="img" aria-label="Bootstrap"><use xlink:href="#bootstrap"></use></svg>
</a>
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
<li><a href="#" class="nav-link px-2 text-secondary">Home</a></li>
<li><a href="#" class="nav-link px-2 text-white">Features</a></li>
<li><a href="#" class="nav-link px-2 text-white">Pricing</a></li>
<li><a href="#" class="nav-link px-2 text-white">FAQs</a></li>
<li><a href="#" class="nav-link px-2 text-white">About</a></li>
</ul>
<form class="col-12 col-lg-auto mb-3 mb-lg-0 me-lg-3" role="search">
<input type="search" class="form-control form-control-dark text-bg-dark" placeholder="Search..." aria-label="Search">
</form>
<div class="text-end">
{% if user.is_authenticated %}
<a href="{% url 'logout' %}" class="btn btn-outline-light me-2">Logout</a>
{% else %}
<a href="{% url 'login' %}" class="btn btn-outline-light me-2">Login</a>
<a href="{% url 'signup' %}" class="btn btn-warning">Sign-up</a>
{% endif %}
<!-- <button type="button" class="btn btn-outline-light me-2">Login</button> -->
<!-- <button type="button" class="btn btn-warning">Sign-up</button> -->
</div>
</div>
</div>
</header>
<script src="{% static 'js/bootstrap.bundle.min.js' %}" crossorigin="anonymous"></script>
<!-- end header -->
<div class="col-lg-8 mx-auto p-4 py-md-5">
<!-- main -->
<main>
{% block content %}
<h1>{{ section.title }}</h1>
{% for story in story_list %}
<h2>
<a href="{{ story.get_absolute_url }}">
{{ story.headline|upper }}
</a>
</h2>
<p>{{ story.tease|truncatewords:"100" }}</p>
{% endfor %}
{% endblock %}
</main>
<!-- end main -->
</div>

View File

@ -1,4 +1,68 @@
<b>Bills!</b>
{% load static %}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bills!</title>
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet" />
</head>
<body>
<header class="p-3 text-bg-dark">
<div class="container">
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
<a href="/" class="d-flex align-items-center mb-2 mb-lg-0 text-white text-decoration-none">
<svg class="bi me-2" width="40" height="32" role="img" aria-label="Bootstrap"><use xlink:href="#bootstrap"></use></svg>
</a>
{% if user.is_authenticated %}
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
<li><div class="nav-link px-2 text-white"> Hi {{ user.username }}!</div></li>
<li><a href="{% url 'bills:index' %}" class="nav-link px-2 text-white">My Bills</a></li>
<!-- <li><a href="#" class="nav-link px-2 text-white">Features</a></li>
<li><a href="#" class="nav-link px-2 text-white">Pricing</a></li>
<li><a href="#" class="nav-link px-2 text-white">FAQs</a></li>
<li><a href="#" class="nav-link px-2 text-white">About</a></li> -->
</ul>
{% else %}
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
<li><a href="#" class="nav-link px-2 text-secondary">Home</a></li>
<li><a href="#" class="nav-link px-2 text-white">Features</a></li>
<li><a href="#" class="nav-link px-2 text-white">Pricing</a></li>
<li><a href="#" class="nav-link px-2 text-white">FAQs</a></li>
<li><a href="#" class="nav-link px-2 text-white">About</a></li>
</ul>
{% endif %}
<form class="col-12 col-lg-auto mb-3 mb-lg-0 me-lg-3" role="search">
<input type="search" class="form-control form-control-dark text-bg-dark" placeholder="Search..." aria-label="Search">
</form>
<div class="text-end">
{% if user.is_authenticated %}
<a href="{% url 'logout' %}" class="btn btn-outline-light me-2">Logout</a>
{% else %}
<a href="{% url 'login' %}" class="btn btn-outline-light me-2">Login</a>
<a href="{% url 'signup' %}" class="btn btn-warning">Sign-up</a>
{% endif %}
<!-- <button type="button" class="btn btn-outline-light me-2">Login</button> -->
<!-- <button type="button" class="btn btn-warning">Sign-up</button> -->
</div>
</div>
</div>
</header>
<script src="{% static 'js/bootstrap.bundle.min.js' %}" crossorigin="anonymous"></script>
<!-- end header -->
<div class="col-lg-8 mx-auto p-4 py-md-5">
<!-- main -->
<main>
<h1>Bills</h1>
<ul>
<li><a href="{% url 'bills:create' %}">Create Bill</a></li>
</ul>
@ -12,3 +76,64 @@
{% else %}
<p>No bills are available.</p>
{% endif %}
<!-- <p class="fs-5 col-md-8">Quickly and easily start adding your bills and service costs to get a better understanding of your operational expenses.</p>
<div class="mb-5">
<a href="#" class="btn btn-primary btn-lg px-4">Sign-up!</a>
</div>
<hr class="col-3 col-md-2 mb-5">
<div class="row g-5">
<div class="col-md-6">
<h2>Starter projects</h2>
<p>Ready to beyond the starter template? Check out these open source projects that you can quickly duplicate to a new GitHub repository.</p>
<ul class="icon-list ps-0">
<li class="d-flex align-items-start mb-1"><a href="https://github.com/twbs/bootstrap-npm-starter" rel="noopener" target="_blank">Bootstrap npm starter</a></li>
<li class="text-muted d-flex align-items-start mb-1">Bootstrap Parcel starter (coming soon!)</li>
</ul>
</div>
<div class="col-md-6">
<h2>Guides</h2>
<p>Read more detailed instructions and documentation on using or contributing to Bootstrap.</p>
<ul class="icon-list ps-0">
<li class="d-flex align-items-start mb-1"><a href="../getting-started/introduction/">Bootstrap quick start guide</a></li>
<li class="d-flex align-items-start mb-1"><a href="../getting-started/webpack/">Bootstrap Webpack guide</a></li>
<li class="d-flex align-items-start mb-1"><a href="../getting-started/parcel/">Bootstrap Parcel guide</a></li>
<li class="d-flex align-items-start mb-1"><a href="../getting-started/vite/">Bootstrap Vite guide</a></li>
<li class="d-flex align-items-start mb-1"><a href="../getting-started/contribute/">Contributing to Bootstrap</a></li>
</ul>
</div>
</div> -->
</main>
<!-- end main -->
</div>
{% block base %}
{% endblock %}
<!-- footer -->
<div class="container">
<footer class="d-flex flex-wrap justify-content-between align-items-center py-3 my-4 border-top">
<p class="col-md-4 mb-0 text-muted">© 2022 Automated Bytes Inc.</p>
<a href="/" class="col-md-4 d-flex align-items-center justify-content-center mb-3 mb-md-0 me-md-auto link-dark text-decoration-none">
<svg class="bi me-2" width="40" height="32"><use xlink:href="#bootstrap"></use></svg>
</a>
<ul class="nav col-md-4 justify-content-end">
<li class="nav-item"><a href="#" class="nav-link px-2 text-muted">Home</a></li>
<li class="nav-item"><a href="#" class="nav-link px-2 text-muted">Features</a></li>
<li class="nav-item"><a href="#" class="nav-link px-2 text-muted">Pricing</a></li>
<li class="nav-item"><a href="#" class="nav-link px-2 text-muted">FAQs</a></li>
<li class="nav-item"><a href="#" class="nav-link px-2 text-muted">About</a></li>
</ul>
</footer>
</div>
</body>
</html>

View File

@ -0,0 +1,71 @@
{% load static %}
{% load static tailwind_tags %}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bills!</title>
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet" />
{% tailwind_css %}
</head>
<body>
<header class="p-3 text-bg-dark">
<div class="container">
<div class="flex-wrap d-flex align-items-center justify-content-center justify-content-lg-start">
<a href="/" class="mb-2 text-white d-flex align-items-center mb-lg-0 text-decoration-none">
<svg class="bi me-2" width="40" height="32" role="img" aria-label="Bootstrap"><use xlink:href="#bootstrap"></use></svg>
</a>
{% if user.is_authenticated %}
<ul class="mb-2 nav col-12 col-lg-auto me-lg-auto justify-content-center mb-md-0">
<li><div class="px-2 text-white nav-link"> Hi {{ user.username }}!</div></li>
<li><a href="{% url 'bills:index' %}" class="px-2 text-white nav-link">My Bills</a></li>
<!-- <li><a href="#" class="px-2 text-white nav-link">Features</a></li>
<li><a href="#" class="px-2 text-white nav-link">Pricing</a></li>
<li><a href="#" class="px-2 text-white nav-link">FAQs</a></li>
<li><a href="#" class="px-2 text-white nav-link">About</a></li> -->
</ul>
{% else %}
<ul class="mb-2 nav col-12 col-lg-auto me-lg-auto justify-content-center mb-md-0">
<li><a href="#" class="px-2 nav-link text-secondary">Home</a></li>
<li><a href="#" class="px-2 text-white nav-link">Features</a></li>
<li><a href="#" class="px-2 text-white nav-link">Pricing</a></li>
<li><a href="#" class="px-2 text-white nav-link">FAQs</a></li>
<li><a href="#" class="px-2 text-white nav-link">About</a></li>
</ul>
{% endif %}
<form class="mb-3 col-12 col-lg-auto mb-lg-0 me-lg-3" role="search">
<input type="search" class="form-control form-control-dark text-bg-dark" placeholder="Search..." aria-label="Search">
</form>
<div class="text-end">
{% if user.is_authenticated %}
<a href="{% url 'logout' %}" class="btn btn-outline-light me-2">Logout</a>
{% else %}
<a href="{% url 'login' %}" class="btn btn-outline-light me-2">Login</a>
<a href="{% url 'signup' %}" class="btn btn-warning">Sign-up</a>
{% endif %}
<!-- <button type="button" class="btn btn-outline-light me-2">Login</button> -->
<!-- <button type="button" class="btn btn-warning">Sign-up</button> -->
</div>
</div>
</div>
</header>
<script src="{% static 'js/bootstrap.bundle.min.js' %}" crossorigin="anonymous"></script>
<!-- end header -->
<div class="p-4 mx-auto col-lg-8 py-md-5">
<!-- main -->
<main>
{% block content %}
{% endblock %}
</main>
<!-- end main -->
</div>

View File

@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap demo</title>
<title>Bills!</title>
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet" />
</head>
<body>

View File

@ -0,0 +1,248 @@
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>Manage My Bills</title>
<!-- Favicon-->
<link rel="icon" type="image/x-icon" href="{% static 'assets/favicon.ico' %}" />
<!-- Bootstrap icons-->
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" type="text/css" />
<!-- Google fonts-->
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css" />
<!-- Core theme CSS (includes Bootstrap)-->
<link href="{% static 'css/styles.css' %}" rel="stylesheet" />
</head>
<body>
<!-- Navigation-->
<nav class="navbar navbar-light bg-light static-top">
<div class="container">
<a class="navbar-brand" href="#!">Manage My Bills!</a>
<a class="btn btn-primary" href="#signup">Sign Up</a>
</div>
<div><a class="btn btn-secondary" href="{% url 'bills:create' %}">Log In</a>
</div>
</nav>
<!-- Masthead-->
<header class="masthead">
<div class="container position-relative">
<div class="row justify-content-center">
<div class="col-xl-6">
<div class="text-center text-white">
<!-- Page heading-->
<h1 class="mb-5">Generate more leads with a professional landing page!</h1>
<!-- Signup form-->
<!-- * * * * * * * * * * * * * * *-->
<!-- * * SB Forms Contact Form * *-->
<!-- * * * * * * * * * * * * * * *-->
<!-- This form is pre-integrated with SB Forms.-->
<!-- To make this form functional, sign up at-->
<!-- https://startbootstrap.com/solution/contact-forms-->
<!-- to get an API token!-->
<form class="form-subscribe" id="contactForm" data-sb-form-api-token="API_TOKEN">
<!-- Email address input-->
<div class="row">
<div class="col">
<input class="form-control form-control-lg" id="emailAddress" type="email" placeholder="Email Address" data-sb-validations="required,email" />
<div class="invalid-feedback text-white" data-sb-feedback="emailAddress:required">Email Address is required.</div>
<div class="invalid-feedback text-white" data-sb-feedback="emailAddress:email">Email Address Email is not valid.</div>
</div>
<div class="col-auto"><button class="btn btn-primary btn-lg disabled" id="submitButton" type="submit">Submit</button></div>
</div>
<!-- Submit success message-->
<!---->
<!-- This is what your users will see when the form-->
<!-- has successfully submitted-->
<div class="d-none" id="submitSuccessMessage">
<div class="text-center mb-3">
<div class="fw-bolder">Form submission successful!</div>
<p>To activate this form, sign up at</p>
<a class="text-white" href="https://startbootstrap.com/solution/contact-forms">https://startbootstrap.com/solution/contact-forms</a>
</div>
</div>
<!-- Submit error message-->
<!---->
<!-- This is what your users will see when there is-->
<!-- an error submitting the form-->
<div class="d-none" id="submitErrorMessage"><div class="text-center text-danger mb-3">Error sending message!</div></div>
</form>
</div>
</div>
</div>
</div>
</header>
<!-- Icons Grid-->
<section class="features-icons bg-light text-center">
<div class="container">
<div class="row">
<div class="col-lg-4">
<div class="features-icons-item mx-auto mb-5 mb-lg-0 mb-lg-3">
<div class="features-icons-icon d-flex"><i class="bi-window m-auto text-primary"></i></div>
<h3>Fully Responsive</h3>
<p class="lead mb-0">This theme will look great on any device, no matter the size!</p>
</div>
</div>
<div class="col-lg-4">
<div class="features-icons-item mx-auto mb-5 mb-lg-0 mb-lg-3">
<div class="features-icons-icon d-flex"><i class="bi-layers m-auto text-primary"></i></div>
<h3>Bootstrap 5 Ready</h3>
<p class="lead mb-0">Featuring the latest build of the new Bootstrap 5 framework!</p>
</div>
</div>
<div class="col-lg-4">
<div class="features-icons-item mx-auto mb-0 mb-lg-3">
<div class="features-icons-icon d-flex"><i class="bi-terminal m-auto text-primary"></i></div>
<h3>Easy to Use</h3>
<p class="lead mb-0">Ready to use with your own content, or customize the source files!</p>
</div>
</div>
</div>
</div>
</section>
<!-- Image Showcases-->
<section class="showcase">
<div class="container-fluid p-0">
<div class="row g-0">
<div class="col-lg-6 order-lg-2 text-white showcase-img" style="background-image: url('{% static "assets/img/bg-showcase-1.jpg" %}')"></div>
<div class="col-lg-6 order-lg-1 my-auto showcase-text">
<h2>Fully Responsive Design</h2>
<p class="lead mb-0">When you use a theme created by Start Bootstrap, you know that the theme will look great on any device, whether it's a phone, tablet, or desktop the page will behave responsively!</p>
</div>
</div>
<div class="row g-0">
<div class="col-lg-6 text-white showcase-img" style="background-image: url('{% static "assets/img/bg-showcase-2.jpg" %}')"></div>
<div class="col-lg-6 my-auto showcase-text">
<h2>Updated For Bootstrap 5</h2>
<p class="lead mb-0">Newly improved, and full of great utility classes, Bootstrap 5 is leading the way in mobile responsive web development! All of the themes on Start Bootstrap are now using Bootstrap 5!</p>
</div>
</div>
<div class="row g-0">
<div class="col-lg-6 order-lg-2 text-white showcase-img" style="background-image: url('{% static "assets/img/bg-showcase-3.jpg" %}')"></div>
<div class="col-lg-6 order-lg-1 my-auto showcase-text">
<h2>Easy to Use & Customize</h2>
<p class="lead mb-0">Landing Page is just HTML and CSS with a splash of SCSS for users who demand some deeper customization options. Out of the box, just add your content and images, and your new landing page will be ready to go!</p>
</div>
</div>
</div>
</section>
<!-- Testimonials-->
<section class="testimonials text-center bg-light">
<div class="container">
<h2 class="mb-5">What people are saying...</h2>
<div class="row">
<div class="col-lg-4">
<div class="testimonial-item mx-auto mb-5 mb-lg-0">
<img class="img-fluid rounded-circle mb-3" src="{% static 'assets/img/testimonials-1.jpg' %}" alt="..." />
<h5>Margaret E.</h5>
<p class="font-weight-light mb-0">"This is fantastic! Thanks so much guys!"</p>
</div>
</div>
<div class="col-lg-4">
<div class="testimonial-item mx-auto mb-5 mb-lg-0">
<img class="img-fluid rounded-circle mb-3" src="{% static 'assets/img/testimonials-2.jpg' %}" alt="..." />
<h5>Fred S.</h5>
<p class="font-weight-light mb-0">"Bootstrap is amazing. I've been using it to create lots of super nice landing pages."</p>
</div>
</div>
<div class="col-lg-4">
<div class="testimonial-item mx-auto mb-5 mb-lg-0">
<img class="img-fluid rounded-circle mb-3" src="{% static 'assets/img/testimonials-3.jpg' %}" alt="..." />
<h5>Sarah W.</h5>
<p class="font-weight-light mb-0">"Thanks so much for making these free resources available to us!"</p>
</div>
</div>
</div>
</div>
</section>
<!-- Call to Action-->
<section class="call-to-action text-white text-center" id="signup">
<div class="container position-relative">
<div class="row justify-content-center">
<div class="col-xl-6">
<h2 class="mb-4">Ready to get started? Sign up now!</h2>
<!-- Signup form-->
<!-- * * * * * * * * * * * * * * *-->
<!-- * * SB Forms Contact Form * *-->
<!-- * * * * * * * * * * * * * * *-->
<!-- This form is pre-integrated with SB Forms.-->
<!-- To make this form functional, sign up at-->
<!-- https://startbootstrap.com/solution/contact-forms-->
<!-- to get an API token!-->
<form class="form-subscribe" id="contactFormFooter" data-sb-form-api-token="API_TOKEN">
<!-- Email address input-->
<div class="row">
<div class="col">
<input class="form-control form-control-lg" id="emailAddressBelow" type="email" placeholder="Email Address" data-sb-validations="required,email" />
<div class="invalid-feedback text-white" data-sb-feedback="emailAddressBelow:required">Email Address is required.</div>
<div class="invalid-feedback text-white" data-sb-feedback="emailAddressBelow:email">Email Address Email is not valid.</div>
</div>
<div class="col-auto"><button class="btn btn-primary btn-lg disabled" id="submitButton" type="submit">Submit</button></div>
</div>
<!-- Submit success message-->
<!---->
<!-- This is what your users will see when the form-->
<!-- has successfully submitted-->
<div class="d-none" id="submitSuccessMessage">
<div class="text-center mb-3">
<div class="fw-bolder">Form submission successful!</div>
<p>To activate this form, sign up at</p>
<a class="text-white" href="https://startbootstrap.com/solution/contact-forms">https://startbootstrap.com/solution/contact-forms</a>
</div>
</div>
<!-- Submit error message-->
<!---->
<!-- This is what your users will see when there is-->
<!-- an error submitting the form-->
<div class="d-none" id="submitErrorMessage"><div class="text-center text-danger mb-3">Error sending message!</div></div>
</form>
</div>
</div>
</div>
</section>
<!-- Footer-->
<footer class="footer bg-light">
<div class="container">
<div class="row">
<div class="col-lg-6 h-100 text-center text-lg-start my-auto">
<ul class="list-inline mb-2">
<li class="list-inline-item"><a href="#!">About</a></li>
<li class="list-inline-item"></li>
<li class="list-inline-item"><a href="#!">Contact</a></li>
<li class="list-inline-item"></li>
<li class="list-inline-item"><a href="#!">Terms of Use</a></li>
<li class="list-inline-item"></li>
<li class="list-inline-item"><a href="#!">Privacy Policy</a></li>
</ul>
<p class="text-muted small mb-4 mb-lg-0">&copy; Your Website 2023. All Rights Reserved.</p>
</div>
<div class="col-lg-6 h-100 text-center text-lg-end my-auto">
<ul class="list-inline mb-0">
<li class="list-inline-item me-4">
<a href="#!"><i class="bi-facebook fs-3"></i></a>
</li>
<li class="list-inline-item me-4">
<a href="#!"><i class="bi-twitter fs-3"></i></a>
</li>
<li class="list-inline-item">
<a href="#!"><i class="bi-instagram fs-3"></i></a>
</li>
</ul>
</div>
</div>
</div>
</footer>
<!-- Bootstrap core JS-->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
<!-- Core theme JS-->
<script src="{% static 'js/scripts.js' %}"></script>
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *-->
<!-- * * SB Forms JS * *-->
<!-- * * Activate your form at https://startbootstrap.com/solution/contact-forms * *-->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *-->
<script src="https://cdn.startbootstrap.com/sb-forms-latest.js"></script>
</body>
</html>

View File

@ -24,5 +24,7 @@ urlpatterns = [
path('admin/', admin.site.urls),
path('accounts/', include('accounts.urls')),
path('accounts/', include('django.contrib.auth.urls')),
path('', TemplateView.as_view(template_name='index.html'), name='index'),
path('', views.index, name='index'),
# path('', TemplateView.as_view(template_name='index.html'), name='index'),
path("__reload__/", include("django_browser_reload.urls")),
]

View File

@ -1,14 +1,18 @@
from django.contrib.auth import logout
from django.http import HttpResponse
from django.http import HttpResponse, HttpResponseRedirect
from django.template import loader
from django.shortcuts import redirect
from django.urls import reverse
def index(request):
if request.user.is_authenticated:
return HttpResponseRedirect(reverse('bills:index'))
# return HttpResponse("Hi there! This is the API index")
template = loader.get_template('index.html')
context = {}
return HttpResponse(template.render(context, request))
else:
template = loader.get_template('index.html')
context = {}
return HttpResponse(template.render(context, request))
def logout(request):

15
api/bills/forms.py Normal file
View File

@ -0,0 +1,15 @@
from django import forms
from .models import Bill
class BillForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(BillForm, self).__init__(*args, **kwargs)
for visible in self.visible_fields():
visible.field.widget.attrs['class'] = 'form-control'
due = forms.DateField(label='Due Date', widget=forms.DateInput(
attrs={'class': 'form-control'}))
class Meta:
model = Bill
fields = '__all__'

View File

@ -1,23 +0,0 @@
# Generated by Django 3.2.9 on 2021-11-20 01:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bills', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='bill',
name='due',
field=models.DateField(verbose_name='due_date'),
),
migrations.AlterField(
model_name='bill',
name='paid_date',
field=models.DateField(blank=True, verbose_name='paid_date'),
),
]

View File

@ -0,0 +1,90 @@
# Generated by Django 4.1.7 on 2023-07-12 13:09
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("bills", "0001_initial"),
]
operations = [
migrations.CreateModel(
name="Organization",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=64, verbose_name="Name")),
("address", models.CharField(max_length=64, verbose_name="Address")),
("phone", models.CharField(max_length=64, verbose_name="Phone")),
("email", models.CharField(max_length=64, verbose_name="Email")),
("website", models.CharField(max_length=64, verbose_name="Website")),
],
),
migrations.AddField(
model_name="bill",
name="created_by",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
),
),
migrations.AlterField(
model_name="bill",
name="due",
field=models.DateField(verbose_name="Due Date"),
),
migrations.AlterField(
model_name="bill",
name="is_missed",
field=models.BooleanField(default=False, verbose_name="Missed Payment"),
),
migrations.AlterField(
model_name="bill",
name="is_overdue",
field=models.BooleanField(default=False, verbose_name="Overdue"),
),
migrations.AlterField(
model_name="bill",
name="is_paid",
field=models.BooleanField(default=False, verbose_name="Paid"),
),
migrations.AlterField(
model_name="bill",
name="name",
field=models.CharField(max_length=64, verbose_name="Name"),
),
migrations.AlterField(
model_name="bill",
name="paid_date",
field=models.DateField(blank=True, null=True, verbose_name="Paid Date"),
),
migrations.AlterField(
model_name="bill",
name="type",
field=models.CharField(max_length=64, verbose_name="Type"),
),
migrations.AddField(
model_name="bill",
name="organization",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
to="bills.organization",
verbose_name="Organization",
),
),
]

View File

@ -1,18 +0,0 @@
# Generated by Django 3.2.9 on 2021-11-20 01:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bills', '0002_auto_20211119_2041'),
]
operations = [
migrations.AlterField(
model_name='bill',
name='paid_date',
field=models.DateField(blank=True, null=True, verbose_name='paid_date'),
),
]

View File

@ -1,48 +0,0 @@
# Generated by Django 3.2.9 on 2021-12-03 20:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bills', '0003_alter_bill_paid_date'),
]
operations = [
migrations.AlterField(
model_name='bill',
name='due',
field=models.DateField(verbose_name='Due Date'),
),
migrations.AlterField(
model_name='bill',
name='is_missed',
field=models.BooleanField(default=False, verbose_name='Missed Payment'),
),
migrations.AlterField(
model_name='bill',
name='is_overdue',
field=models.BooleanField(default=False, verbose_name='Overdue'),
),
migrations.AlterField(
model_name='bill',
name='is_paid',
field=models.BooleanField(default=False, verbose_name='Paid'),
),
migrations.AlterField(
model_name='bill',
name='name',
field=models.CharField(max_length=64, verbose_name='Name'),
),
migrations.AlterField(
model_name='bill',
name='paid_date',
field=models.DateField(blank=True, null=True, verbose_name='Paid Date'),
),
migrations.AlterField(
model_name='bill',
name='type',
field=models.CharField(max_length=64, verbose_name='Type'),
),
]

View File

@ -1,24 +0,0 @@
# Generated by Django 4.1.7 on 2023-04-08 15:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bills', '0004_auto_20211203_1549'),
]
operations = [
migrations.CreateModel(
name='Organization',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=64, verbose_name='Name')),
('address', models.CharField(max_length=64, verbose_name='Address')),
('phone', models.CharField(max_length=64, verbose_name='Phone')),
('email', models.CharField(max_length=64, verbose_name='Email')),
('website', models.CharField(max_length=64, verbose_name='Website')),
],
),
]

View File

@ -1,19 +0,0 @@
# Generated by Django 4.1.7 on 2023-04-08 15:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('bills', '0005_organization'),
]
operations = [
migrations.AddField(
model_name='bill',
name='organization',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='bills.organization', verbose_name='Organization'),
),
]

View File

@ -1,3 +1,4 @@
from django.contrib.auth.models import User
from django.db import models
# Create your models here.
@ -15,6 +16,8 @@ class Bill(models.Model):
default=False, verbose_name='Missed Payment')
organization = models.ForeignKey(
'Organization', on_delete=models.CASCADE, verbose_name='Organization', null=True, blank=True)
created_by = models.ForeignKey(
User, on_delete=models.CASCADE, blank=True, null=True)
def overdue(self):
return self.is_overdue

View File

@ -0,0 +1,32 @@
<!-- templates/home.html -->
{% extends 'base.html' %}
{% block title %}Home{% endblock %}
{% block content %}
{% if user.is_authenticated %}
<!-- <form action="{% url 'bills:create' %}" method="post">
{% csrf_token %}
<fieldset>
<legend><h1>Create a New Bill</h1></legend>
<div class="alert alert-danger" role="alert">
This page is not yet functional!
</div>
<label for="name">Bill Name:</label>
<input type="text" name="name" id="name" value="">
<br>
</fieldset>
<input type="submit" value="Create Bill">
</form> -->
<form method="post">{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Save">
</form>
{% else %}
<p>You are not logged in</p>
<a href="{% url 'login' %}">Log In</a>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,32 @@
<!-- templates/home.html -->
{% extends 'base.html' %}
{% block title %}Home{% endblock %}
{% block content %}
{% if user.is_authenticated %}
<!-- <form action="{% url 'bills:create' %}" method="post">
{% csrf_token %}
<fieldset>
<legend><h1>Create a New Bill</h1></legend>
<div class="alert alert-danger" role="alert">
This page is not yet functional!
</div>
<label for="name">Bill Name:</label>
<input type="text" name="name" id="name" value="">
<br>
</fieldset>
<input type="submit" value="Create Bill">
</form> -->
<form method="post">{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Save">
</form>
{% else %}
<p>You are not logged in</p>
<a href="{% url 'login' %}">Log In</a>
{% endif %}
{% endblock %}

View File

@ -1,10 +0,0 @@
<form action="{% url 'bills:create' %}" method="post">
{% csrf_token %}
<fieldset>
<legend><h1>Create a New Bill</h1></legend>
<label for="name">Bill Name:</label>
<input type="text" name="name" id="name" value="">
<br>
</fieldset>
<input type="submit" value="Create Bill">
</form>

View File

@ -1,10 +1,17 @@
<h1> {{bill.name }}</h1>
<!-- templates/home.html -->
{% extends 'base.html' %}
{{ bill.due}}
{% block title %}Home{% endblock %}
{% block content %}
{% if user.is_authenticated %}
<h1> {{bill.name }}</h1>
<hr>
Due: {{ bill.due}}
<br>
{{ bill.type }}
Type: {{ bill.type }}
<br>
{{ bill.amount}}
Amount: {{ bill.amount}}
<br>
{{ bill.is_paid}}
<br>
@ -15,3 +22,10 @@
{{ bill.is_missed}}
<br>
{{ bill.organization.name}}
{% else %}
<p>You are not logged in</p>
<a href="{% url 'login' %}">Log In</a>
{% endif %}
{% endblock %}

View File

@ -1,14 +1,126 @@
<b>Bills!</b>
<ul>
<li><a href="{% url 'bills:create' %}">Create Bill</a></li>
</ul>
<hr>
{% if bills_list %}
<ul>
{% for bill in bills_list %}
<li><a href="{% url 'bills:detail' bill.id %}"> {{ bill.name }}</a></li>
{% endfor %}
</ul>
{% load static %}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap demo</title>
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet" />
</head>
<body>
<header class="p-3 text-bg-dark">
<div class="container">
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
<a href="/" class="d-flex align-items-center mb-2 mb-lg-0 text-white text-decoration-none">
<svg class="bi me-2" width="40" height="32" role="img" aria-label="Bootstrap"><use xlink:href="#bootstrap"></use></svg>
</a>
{% if user.is_authenticated %}
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
<li><div class="nav-link px-2 text-white"> Hi {{ user.username }}!</div></li>
<li><a href="{% url 'bills:index' %}" class="nav-link px-2 text-white">My Bills</a></li>
<!-- <li><a href="#" class="nav-link px-2 text-white">Features</a></li>
<li><a href="#" class="nav-link px-2 text-white">Pricing</a></li>
<li><a href="#" class="nav-link px-2 text-white">FAQs</a></li>
<li><a href="#" class="nav-link px-2 text-white">About</a></li> -->
</ul>
{% else %}
<p>No bills are available.</p>
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
<li><a href="#" class="nav-link px-2 text-secondary">Home</a></li>
<li><a href="#" class="nav-link px-2 text-white">Features</a></li>
<li><a href="#" class="nav-link px-2 text-white">Pricing</a></li>
<li><a href="#" class="nav-link px-2 text-white">FAQs</a></li>
<li><a href="#" class="nav-link px-2 text-white">About</a></li>
</ul>
{% endif %}
<form class="col-12 col-lg-auto mb-3 mb-lg-0 me-lg-3" role="search">
<input type="search" class="form-control form-control-dark text-bg-dark" placeholder="Search..." aria-label="Search">
</form>
<div class="text-end">
{% if user.is_authenticated %}
<a href="{% url 'logout' %}" class="btn btn-outline-light me-2">Logout</a>
{% else %}
<a href="{% url 'login' %}" class="btn btn-outline-light me-2">Login</a>
<a href="{% url 'signup' %}" class="btn btn-warning">Sign-up</a>
{% endif %}
<!-- <button type="button" class="btn btn-outline-light me-2">Login</button> -->
<!-- <button type="button" class="btn btn-warning">Sign-up</button> -->
</div>
</div>
</div>
</header>
<script src="{% static 'js/bootstrap.bundle.min.js' %}" crossorigin="anonymous"></script>
<!-- end header -->
<div class="col-lg-8 mx-auto p-4 py-md-5">
<!-- main -->
<main>
<h1>Bills</h1>
<p class="fs-5 col-md-8">Quickly and easily start adding your bills and service costs to get a better understanding of your operational expenses.</p>
<div class="mb-5">
<a href="#" class="btn btn-primary btn-lg px-4">Sign-up!</a>
</div>
<hr class="col-3 col-md-2 mb-5">
<div class="row g-5">
<div class="col-md-6">
<h2>Starter projects</h2>
<p>Ready to beyond the starter template? Check out these open source projects that you can quickly duplicate to a new GitHub repository.</p>
<ul class="icon-list ps-0">
<li class="d-flex align-items-start mb-1"><a href="https://github.com/twbs/bootstrap-npm-starter" rel="noopener" target="_blank">Bootstrap npm starter</a></li>
<li class="text-muted d-flex align-items-start mb-1">Bootstrap Parcel starter (coming soon!)</li>
</ul>
</div>
<div class="col-md-6">
<h2>Guides</h2>
<p>Read more detailed instructions and documentation on using or contributing to Bootstrap.</p>
<ul class="icon-list ps-0">
<li class="d-flex align-items-start mb-1"><a href="../getting-started/introduction/">Bootstrap quick start guide</a></li>
<li class="d-flex align-items-start mb-1"><a href="../getting-started/webpack/">Bootstrap Webpack guide</a></li>
<li class="d-flex align-items-start mb-1"><a href="../getting-started/parcel/">Bootstrap Parcel guide</a></li>
<li class="d-flex align-items-start mb-1"><a href="../getting-started/vite/">Bootstrap Vite guide</a></li>
<li class="d-flex align-items-start mb-1"><a href="../getting-started/contribute/">Contributing to Bootstrap</a></li>
</ul>
</div>
</div>
</main>
<!-- end main -->
</div>
{% block base %}
{% endblock %}
<!-- footer -->
<div class="container">
<footer class="d-flex flex-wrap justify-content-between align-items-center py-3 my-4 border-top">
<p class="col-md-4 mb-0 text-muted">© 2022 Automated Bytes Inc.</p>
<a href="/" class="col-md-4 d-flex align-items-center justify-content-center mb-3 mb-md-0 me-md-auto link-dark text-decoration-none">
<svg class="bi me-2" width="40" height="32"><use xlink:href="#bootstrap"></use></svg>
</a>
<ul class="nav col-md-4 justify-content-end">
<li class="nav-item"><a href="#" class="nav-link px-2 text-muted">Home</a></li>
<li class="nav-item"><a href="#" class="nav-link px-2 text-muted">Features</a></li>
<li class="nav-item"><a href="#" class="nav-link px-2 text-muted">Pricing</a></li>
<li class="nav-item"><a href="#" class="nav-link px-2 text-muted">FAQs</a></li>
<li class="nav-item"><a href="#" class="nav-link px-2 text-muted">About</a></li>
</ul>
</footer>
</div>
</body>
</html>

View File

@ -9,7 +9,8 @@ app_name = 'bills'
urlpatterns = [
path('', views.index, name='index'),
path('<int:bill_id>/', views.detail, name='detail'),
path('create', views.create, name='create')
path('<int:bill_id>/', views.BillUpdateView.as_view(), name='detail'),
path('create', views.BillCreateView.as_view(), name='create'),
path('bill/<int:pk>/delete/', views.BillDeleteView.as_view(), name='bill-delete')
# path('admin/', admin.site.urls),
]

View File

@ -3,8 +3,11 @@ from django.contrib.auth import authenticate, login
from django.http import HttpResponse, Http404
from django.template import loader
from django.shortcuts import render, get_object_or_404, get_list_or_404, redirect
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.urls import reverse_lazy
from .models import Bill
from .forms import BillForm
def index(request):
@ -28,5 +31,26 @@ def detail(request, bill_id):
# view to retriev a users bills
def create(request):
return render(request, 'bills/create.html')
# def create(request, bill_name):
# return render(request, 'bills/create.html')
class BillCreateView(CreateView):
model = Bill
# fields = ['name', 'type', 'due']
form_class = BillForm
success_url = '/'
def form_valid(self, form):
form.instance.created_by = self.request.user
return super().form_valid(form)
class BillUpdateView(UpdateView):
model = Bill
fields = ['name', 'type', 'due']
template_name_suffix = '_update_form'
pk_url_kwarg = 'bill_id'
class BillDeleteView(DeleteView):
model = Bill
success_url = reverse_lazy('index')

0
api/theme/__init__.py Normal file
View File

5
api/theme/apps.py Normal file
View File

@ -0,0 +1,5 @@
from django.apps import AppConfig
class ThemeConfig(AppConfig):
name = 'theme'

845
api/theme/static/css/dist/styles.css vendored Normal file
View File

@ -0,0 +1,845 @@
/*
! tailwindcss v3.3.2 | MIT License | https://tailwindcss.com
*/
/*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/
*,
::before,
::after {
box-sizing: border-box;
/* 1 */
border-width: 0;
/* 2 */
border-style: solid;
/* 2 */
border-color: #e5e7eb;
/* 2 */
}
::before,
::after {
--tw-content: '';
}
/*
1. Use a consistent sensible line-height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
3. Use a more readable tab size.
4. Use the user's configured `sans` font-family by default.
5. Use the user's configured `sans` font-feature-settings by default.
6. Use the user's configured `sans` font-variation-settings by default.
*/
html {
line-height: 1.5;
/* 1 */
-webkit-text-size-adjust: 100%;
/* 2 */
-moz-tab-size: 4;
/* 3 */
-o-tab-size: 4;
tab-size: 4;
/* 3 */
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
/* 4 */
font-feature-settings: normal;
/* 5 */
font-variation-settings: normal;
/* 6 */
}
/*
1. Remove the margin in all browsers.
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
*/
body {
margin: 0;
/* 1 */
line-height: inherit;
/* 2 */
}
/*
1. Add the correct height in Firefox.
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
3. Ensure horizontal rules are visible by default.
*/
hr {
height: 0;
/* 1 */
color: inherit;
/* 2 */
border-top-width: 1px;
/* 3 */
}
/*
Add the correct text decoration in Chrome, Edge, and Safari.
*/
abbr:where([title]) {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
}
/*
Remove the default font size and weight for headings.
*/
h1,
h2,
h3,
h4,
h5,
h6 {
font-size: inherit;
font-weight: inherit;
}
/*
Reset links to optimize for opt-in styling instead of opt-out.
*/
a {
color: inherit;
text-decoration: inherit;
}
/*
Add the correct font weight in Edge and Safari.
*/
b,
strong {
font-weight: bolder;
}
/*
1. Use the user's configured `mono` font family by default.
2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp,
pre {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
/* 1 */
font-size: 1em;
/* 2 */
}
/*
Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/*
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/*
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
3. Remove gaps between table borders by default.
*/
table {
text-indent: 0;
/* 1 */
border-color: inherit;
/* 2 */
border-collapse: collapse;
/* 3 */
}
/*
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
3. Remove default padding in all browsers.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit;
/* 1 */
font-size: 100%;
/* 1 */
font-weight: inherit;
/* 1 */
line-height: inherit;
/* 1 */
color: inherit;
/* 1 */
margin: 0;
/* 2 */
padding: 0;
/* 3 */
}
/*
Remove the inheritance of text transform in Edge and Firefox.
*/
button,
select {
text-transform: none;
}
/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Remove default button styles.
*/
button,
[type='button'],
[type='reset'],
[type='submit'] {
-webkit-appearance: button;
/* 1 */
background-color: transparent;
/* 2 */
background-image: none;
/* 2 */
}
/*
Use the modern Firefox focus style for all focusable elements.
*/
:-moz-focusring {
outline: auto;
}
/*
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
*/
:-moz-ui-invalid {
box-shadow: none;
}
/*
Add the correct vertical alignment in Chrome and Firefox.
*/
progress {
vertical-align: baseline;
}
/*
Correct the cursor style of increment and decrement buttons in Safari.
*/
::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
height: auto;
}
/*
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/
[type='search'] {
-webkit-appearance: textfield;
/* 1 */
outline-offset: -2px;
/* 2 */
}
/*
Remove the inner padding in Chrome and Safari on macOS.
*/
::-webkit-search-decoration {
-webkit-appearance: none;
}
/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button;
/* 1 */
font: inherit;
/* 2 */
}
/*
Add the correct display in Chrome and Safari.
*/
summary {
display: list-item;
}
/*
Removes the default spacing and border for appropriate elements.
*/
blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
margin: 0;
}
fieldset {
margin: 0;
padding: 0;
}
legend {
padding: 0;
}
ol,
ul,
menu {
list-style: none;
margin: 0;
padding: 0;
}
/*
Prevent resizing textareas horizontally by default.
*/
textarea {
resize: vertical;
}
/*
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2. Set the default placeholder color to the user's configured gray 400 color.
*/
input::-moz-placeholder, textarea::-moz-placeholder {
opacity: 1;
/* 1 */
color: #9ca3af;
/* 2 */
}
input::placeholder,
textarea::placeholder {
opacity: 1;
/* 1 */
color: #9ca3af;
/* 2 */
}
/*
Set the default cursor for buttons.
*/
button,
[role="button"] {
cursor: pointer;
}
/*
Make sure disabled buttons don't get the pointer cursor.
*/
:disabled {
cursor: default;
}
/*
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
This can trigger a poorly considered lint error in some tools but is included by design.
*/
img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
display: block;
/* 1 */
vertical-align: middle;
/* 2 */
}
/*
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
*/
img,
video {
max-width: 100%;
height: auto;
}
/* Make elements with the HTML hidden attribute stay hidden by default */
[hidden] {
display: none;
}
[type='text'],[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background-color: #fff;
border-color: #6b7280;
border-width: 1px;
border-radius: 0px;
padding-top: 0.5rem;
padding-right: 0.75rem;
padding-bottom: 0.5rem;
padding-left: 0.75rem;
font-size: 1rem;
line-height: 1.5rem;
--tw-shadow: 0 0 #0000;
}
[type='text']:focus, [type='email']:focus, [type='url']:focus, [type='password']:focus, [type='number']:focus, [type='date']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='week']:focus, [multiple]:focus, textarea:focus, select:focus {
outline: 2px solid transparent;
outline-offset: 2px;
--tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: #2563eb;
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
border-color: #2563eb;
}
input::-moz-placeholder, textarea::-moz-placeholder {
color: #6b7280;
opacity: 1;
}
input::placeholder,textarea::placeholder {
color: #6b7280;
opacity: 1;
}
::-webkit-datetime-edit-fields-wrapper {
padding: 0;
}
::-webkit-date-and-time-value {
min-height: 1.5em;
}
::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field {
padding-top: 0;
padding-bottom: 0;
}
select {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
background-position: right 0.5rem center;
background-repeat: no-repeat;
background-size: 1.5em 1.5em;
padding-right: 2.5rem;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
[multiple] {
background-image: initial;
background-position: initial;
background-repeat: unset;
background-size: initial;
padding-right: 0.75rem;
-webkit-print-color-adjust: unset;
print-color-adjust: unset;
}
[type='checkbox'],[type='radio'] {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
padding: 0;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
display: inline-block;
vertical-align: middle;
background-origin: border-box;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
flex-shrink: 0;
height: 1rem;
width: 1rem;
color: #2563eb;
background-color: #fff;
border-color: #6b7280;
border-width: 1px;
--tw-shadow: 0 0 #0000;
}
[type='checkbox'] {
border-radius: 0px;
}
[type='radio'] {
border-radius: 100%;
}
[type='checkbox']:focus,[type='radio']:focus {
outline: 2px solid transparent;
outline-offset: 2px;
--tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
--tw-ring-offset-width: 2px;
--tw-ring-offset-color: #fff;
--tw-ring-color: #2563eb;
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
}
[type='checkbox']:checked,[type='radio']:checked {
border-color: transparent;
background-color: currentColor;
background-size: 100% 100%;
background-position: center;
background-repeat: no-repeat;
}
[type='checkbox']:checked {
background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
}
[type='radio']:checked {
background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");
}
[type='checkbox']:checked:hover,[type='checkbox']:checked:focus,[type='radio']:checked:hover,[type='radio']:checked:focus {
border-color: transparent;
background-color: currentColor;
}
[type='checkbox']:indeterminate {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");
border-color: transparent;
background-color: currentColor;
background-size: 100% 100%;
background-position: center;
background-repeat: no-repeat;
}
[type='checkbox']:indeterminate:hover,[type='checkbox']:indeterminate:focus {
border-color: transparent;
background-color: currentColor;
}
[type='file'] {
background: unset;
border-color: inherit;
border-width: 0;
border-radius: 0;
padding: 0;
font-size: unset;
line-height: inherit;
}
[type='file']:focus {
outline: 1px solid ButtonText;
outline: 1px auto -webkit-focus-ring-color;
}
*, ::before, ::after {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-gradient-from-position: ;
--tw-gradient-via-position: ;
--tw-gradient-to-position: ;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(59 130 246 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
}
::backdrop {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-gradient-from-position: ;
--tw-gradient-via-position: ;
--tw-gradient-to-position: ;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(59 130 246 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
}
.container {
width: 100%;
}
@media (min-width: 640px) {
.container {
max-width: 640px;
}
}
@media (min-width: 768px) {
.container {
max-width: 768px;
}
}
@media (min-width: 1024px) {
.container {
max-width: 1024px;
}
}
@media (min-width: 1280px) {
.container {
max-width: 1280px;
}
}
@media (min-width: 1536px) {
.container {
max-width: 1536px;
}
}
.static {
position: static;
}
.mx-auto {
margin-left: auto;
margin-right: auto;
}
.my-4 {
margin-top: 1rem;
margin-bottom: 1rem;
}
.mb-0 {
margin-bottom: 0px;
}
.mb-1 {
margin-bottom: 0.25rem;
}
.mb-2 {
margin-bottom: 0.5rem;
}
.mb-3 {
margin-bottom: 0.75rem;
}
.mb-5 {
margin-bottom: 1.25rem;
}
.me-2 {
-webkit-margin-end: 0.5rem;
margin-inline-end: 0.5rem;
}
.block {
display: block;
}
.flex {
display: flex;
}
.h-screen {
height: 100vh;
}
.flex-wrap {
flex-wrap: wrap;
}
.items-center {
align-items: center;
}
.justify-center {
justify-content: center;
}
.bg-gray-50 {
--tw-bg-opacity: 1;
background-color: rgb(249 250 251 / var(--tw-bg-opacity));
}
.p-3 {
padding: 0.75rem;
}
.p-4 {
padding: 1rem;
}
.px-2 {
padding-left: 0.5rem;
padding-right: 0.5rem;
}
.px-4 {
padding-left: 1rem;
padding-right: 1rem;
}
.py-3 {
padding-top: 0.75rem;
padding-bottom: 0.75rem;
}
.ps-0 {
-webkit-padding-start: 0px;
padding-inline-start: 0px;
}
.text-end {
text-align: end;
}
.font-serif {
font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}
.text-5xl {
font-size: 3rem;
line-height: 1;
}
.leading-normal {
line-height: 1.5;
}
.tracking-normal {
letter-spacing: 0em;
}
.text-white {
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
}

1
api/theme/static_src/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules

1620
api/theme/static_src/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,29 @@
{
"name": "theme",
"version": "3.6.0",
"description": "",
"scripts": {
"start": "npm run dev",
"build": "npm run build:clean && npm run build:tailwind",
"build:clean": "rimraf ../static/css/dist",
"build:tailwind": "cross-env NODE_ENV=production tailwindcss --postcss -i ./src/styles.css -o ../static/css/dist/styles.css --minify",
"dev": "cross-env NODE_ENV=development tailwindcss --postcss -i ./src/styles.css -o ../static/css/dist/styles.css -w",
"tailwindcss": "node ./node_modules/tailwindcss/lib/cli.js"
},
"keywords": [],
"author": "",
"license": "MIT",
"devDependencies": {
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.3",
"@tailwindcss/line-clamp": "^0.4.4",
"@tailwindcss/typography": "^0.5.9",
"cross-env": "^7.0.3",
"postcss": "^8.4.24",
"postcss-import": "^15.1.0",
"postcss-nested": "^6.0.1",
"postcss-simple-vars": "^7.0.1",
"rimraf": "^5.0.1",
"tailwindcss": "^3.3.2"
}
}

View File

@ -0,0 +1,7 @@
module.exports = {
plugins: {
"postcss-import": {},
"postcss-simple-vars": {},
"postcss-nested": {}
},
}

View File

@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

View File

@ -0,0 +1,58 @@
/**
* This is a minimal config.
*
* If you need the full config, get it from here:
* https://unpkg.com/browse/tailwindcss@latest/stubs/defaultConfig.stub.js
*/
module.exports = {
content: [
/**
* HTML. Paths to Django template files that will contain Tailwind CSS classes.
*/
/* Templates within theme app (<tailwind_app_name>/templates), e.g. base.html. */
'../templates/**/*.html',
/*
* Main templates directory of the project (BASE_DIR/templates).
* Adjust the following line to match your project structure.
*/
'../../templates/**/*.html',
/*
* Templates in other django apps (BASE_DIR/<any_app_name>/templates).
* Adjust the following line to match your project structure.
*/
'../../**/templates/**/*.html',
/**
* JS: If you use Tailwind CSS in JavaScript, uncomment the following lines and make sure
* patterns match your project structure.
*/
/* JS 1: Ignore any JavaScript in node_modules folder. */
// '!../../**/node_modules',
/* JS 2: Process all JavaScript files in the project. */
// '../../**/*.js',
/**
* Python: If you use Tailwind CSS classes in Python, uncomment the following line
* and make sure the pattern below matches your project structure.
*/
// '../../**/*.py'
],
theme: {
extend: {},
},
plugins: [
/**
* '@tailwindcss/forms' is the forms plugin that provides a minimal styling
* for forms. If you don't like it or have own styling for forms,
* comment the line below to disable '@tailwindcss/forms'.
*/
require('@tailwindcss/forms'),
require('@tailwindcss/typography'),
require('@tailwindcss/line-clamp'),
require('@tailwindcss/aspect-ratio'),
],
}

View File

@ -0,0 +1,19 @@
{% load static tailwind_tags %}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Django Tailwind</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
{% tailwind_css %}
</head>
<body class="bg-gray-50 font-serif leading-normal tracking-normal">
<div class="container mx-auto">
<section class="flex items-center justify-center h-screen">
<h1 class="text-5xl">Django + Tailwind = ❤️</h1>
</section>
</div>
</body>
</html>