Add templates!
This commit is contained in:
parent
1edd0892af
commit
24cdebe960
@ -183,6 +183,5 @@ JET_INDEX_DASHBOARD = 'dashboard.CustomIndexDashboard'
|
|||||||
|
|
||||||
STATICFILES_DIRS = [
|
STATICFILES_DIRS = [
|
||||||
BASE_DIR / "api/static",
|
BASE_DIR / "api/static",
|
||||||
("assets", BASE_DIR / "assets"),
|
("assets", BASE_DIR / "api/static/assets"),
|
||||||
"[os.path.join(BASE_DIR, 'static')",
|
|
||||||
]
|
]
|
||||||
|
@ -1,248 +1,100 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="description" content="" />
|
<title>Bootstrap demo</title>
|
||||||
<meta name="author" content="" />
|
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet" />
|
||||||
<title>Manage My Bills</title>
|
</head>
|
||||||
<!-- Favicon-->
|
<body>
|
||||||
<link rel="icon" type="image/x-icon" href="{% static 'assets/favicon.ico' %}" />
|
<header class="p-3 text-bg-dark">
|
||||||
<!-- Bootstrap icons-->
|
<div class="container">
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css" rel="stylesheet" type="text/css" />
|
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
|
||||||
<!-- Google fonts-->
|
<a href="/" class="d-flex align-items-center mb-2 mb-lg-0 text-white text-decoration-none">
|
||||||
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css" />
|
<svg class="bi me-2" width="40" height="32" role="img" aria-label="Bootstrap"><use xlink:href="#bootstrap"></use></svg>
|
||||||
<!-- Core theme CSS (includes Bootstrap)-->
|
</a>
|
||||||
<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>
|
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
|
||||||
<!-- Masthead-->
|
<li><a href="#" class="nav-link px-2 text-secondary">Home</a></li>
|
||||||
<header class="masthead">
|
<li><a href="#" class="nav-link px-2 text-white">Features</a></li>
|
||||||
<div class="container position-relative">
|
<li><a href="#" class="nav-link px-2 text-white">Pricing</a></li>
|
||||||
<div class="row justify-content-center">
|
<li><a href="#" class="nav-link px-2 text-white">FAQs</a></li>
|
||||||
<div class="col-xl-6">
|
<li><a href="#" class="nav-link px-2 text-white">About</a></li>
|
||||||
<div class="text-center text-white">
|
</ul>
|
||||||
<!-- Page heading-->
|
|
||||||
<h1 class="mb-5">Generate more leads with a professional landing page!</h1>
|
<form class="col-12 col-lg-auto mb-3 mb-lg-0 me-lg-3" role="search">
|
||||||
<!-- Signup form-->
|
<input type="search" class="form-control form-control-dark text-bg-dark" placeholder="Search..." aria-label="Search">
|
||||||
<!-- * * * * * * * * * * * * * * *-->
|
</form>
|
||||||
<!-- * * SB Forms Contact Form * *-->
|
|
||||||
<!-- * * * * * * * * * * * * * * *-->
|
<div class="text-end">
|
||||||
<!-- This form is pre-integrated with SB Forms.-->
|
<button type="button" class="btn btn-outline-light me-2">Login</button>
|
||||||
<!-- To make this form functional, sign up at-->
|
<button type="button" class="btn btn-warning">Sign-up</button>
|
||||||
<!-- 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>
|
</div>
|
||||||
</header>
|
</div>
|
||||||
<!-- Icons Grid-->
|
</div>
|
||||||
<section class="features-icons bg-light text-center">
|
</header>
|
||||||
<div class="container">
|
<script src="{% static 'js/bootstrap.bundle.min.js' %}" crossorigin="anonymous"></script>
|
||||||
<div class="row">
|
<!-- end header -->
|
||||||
<div class="col-lg-4">
|
<div class="col-lg-8 mx-auto p-4 py-md-5">
|
||||||
<div class="features-icons-item mx-auto mb-5 mb-lg-0 mb-lg-3">
|
<!-- main -->
|
||||||
<div class="features-icons-icon d-flex"><i class="bi-window m-auto text-primary"></i></div>
|
<main>
|
||||||
<h3>Fully Responsive</h3>
|
<h1>Bills</h1>
|
||||||
<p class="lead mb-0">This theme will look great on any device, no matter the size!</p>
|
<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>
|
|
||||||
</div>
|
<div class="mb-5">
|
||||||
<div class="col-lg-4">
|
<a href="#" class="btn btn-primary btn-lg px-4">Sign-up!</a>
|
||||||
<div class="features-icons-item mx-auto mb-5 mb-lg-0 mb-lg-3">
|
</div>
|
||||||
<div class="features-icons-icon d-flex"><i class="bi-layers m-auto text-primary"></i></div>
|
|
||||||
<h3>Bootstrap 5 Ready</h3>
|
<hr class="col-3 col-md-2 mb-5">
|
||||||
<p class="lead mb-0">Featuring the latest build of the new Bootstrap 5 framework!</p>
|
|
||||||
</div>
|
<div class="row g-5">
|
||||||
</div>
|
<div class="col-md-6">
|
||||||
<div class="col-lg-4">
|
<h2>Starter projects</h2>
|
||||||
<div class="features-icons-item mx-auto mb-0 mb-lg-3">
|
<p>Ready to beyond the starter template? Check out these open source projects that you can quickly duplicate to a new GitHub repository.</p>
|
||||||
<div class="features-icons-icon d-flex"><i class="bi-terminal m-auto text-primary"></i></div>
|
<ul class="icon-list ps-0">
|
||||||
<h3>Easy to Use</h3>
|
<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>
|
||||||
<p class="lead mb-0">Ready to use with your own content, or customize the source files!</p>
|
<li class="text-muted d-flex align-items-start mb-1">Bootstrap Parcel starter (coming soon!)</li>
|
||||||
</div>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
<div class="col-md-6">
|
||||||
</section>
|
<h2>Guides</h2>
|
||||||
<!-- Image Showcases-->
|
<p>Read more detailed instructions and documentation on using or contributing to Bootstrap.</p>
|
||||||
<section class="showcase">
|
<ul class="icon-list ps-0">
|
||||||
<div class="container-fluid p-0">
|
<li class="d-flex align-items-start mb-1"><a href="../getting-started/introduction/">Bootstrap quick start guide</a></li>
|
||||||
<div class="row g-0">
|
<li class="d-flex align-items-start mb-1"><a href="../getting-started/webpack/">Bootstrap Webpack guide</a></li>
|
||||||
<div class="col-lg-6 order-lg-2 text-white showcase-img" style="background-image: url('{% static "assets/img/bg-showcase-1.jpg" %}')"></div>
|
<li class="d-flex align-items-start mb-1"><a href="../getting-started/parcel/">Bootstrap Parcel guide</a></li>
|
||||||
<div class="col-lg-6 order-lg-1 my-auto showcase-text">
|
<li class="d-flex align-items-start mb-1"><a href="../getting-started/vite/">Bootstrap Vite guide</a></li>
|
||||||
<h2>Fully Responsive Design</h2>
|
<li class="d-flex align-items-start mb-1"><a href="../getting-started/contribute/">Contributing to Bootstrap</a></li>
|
||||||
<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>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row g-0">
|
</main>
|
||||||
<div class="col-lg-6 text-white showcase-img" style="background-image: url('{% static "assets/img/bg-showcase-2.jpg" %}')"></div>
|
<!-- end main -->
|
||||||
<div class="col-lg-6 my-auto showcase-text">
|
</div>
|
||||||
<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>
|
<!-- footer -->
|
||||||
<div class="row g-0">
|
<div class="container">
|
||||||
<div class="col-lg-6 order-lg-2 text-white showcase-img" style="background-image: url('{% static "assets/img/bg-showcase-3.jpg" %}')"></div>
|
<footer class="d-flex flex-wrap justify-content-between align-items-center py-3 my-4 border-top">
|
||||||
<div class="col-lg-6 order-lg-1 my-auto showcase-text">
|
<p class="col-md-4 mb-0 text-muted">© 2022 Automated Bytes Inc.</p>
|
||||||
<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>
|
<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">
|
||||||
</div>
|
<svg class="bi me-2" width="40" height="32"><use xlink:href="#bootstrap"></use></svg>
|
||||||
</div>
|
</a>
|
||||||
</div>
|
|
||||||
</section>
|
<ul class="nav col-md-4 justify-content-end">
|
||||||
<!-- Testimonials-->
|
<li class="nav-item"><a href="#" class="nav-link px-2 text-muted">Home</a></li>
|
||||||
<section class="testimonials text-center bg-light">
|
<li class="nav-item"><a href="#" class="nav-link px-2 text-muted">Features</a></li>
|
||||||
<div class="container">
|
<li class="nav-item"><a href="#" class="nav-link px-2 text-muted">Pricing</a></li>
|
||||||
<h2 class="mb-5">What people are saying...</h2>
|
<li class="nav-item"><a href="#" class="nav-link px-2 text-muted">FAQs</a></li>
|
||||||
<div class="row">
|
<li class="nav-item"><a href="#" class="nav-link px-2 text-muted">About</a></li>
|
||||||
<div class="col-lg-4">
|
</ul>
|
||||||
<div class="testimonial-item mx-auto mb-5 mb-lg-0">
|
</footer>
|
||||||
<img class="img-fluid rounded-circle mb-3" src="{% static 'assets/img/testimonials-1.jpg' %}" alt="..." />
|
</div>
|
||||||
<h5>Margaret E.</h5>
|
|
||||||
<p class="font-weight-light mb-0">"This is fantastic! Thanks so much guys!"</p>
|
</body>
|
||||||
</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">© 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>
|
</html>
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
|
from django.contrib.auth import logout
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django.template import loader
|
from django.template import loader
|
||||||
|
from django.shortcuts import redirect
|
||||||
|
|
||||||
|
|
||||||
def index(request):
|
def index(request):
|
||||||
@ -7,3 +9,8 @@ def index(request):
|
|||||||
template = loader.get_template('index.html')
|
template = loader.get_template('index.html')
|
||||||
context = {}
|
context = {}
|
||||||
return HttpResponse(template.render(context, request))
|
return HttpResponse(template.render(context, request))
|
||||||
|
|
||||||
|
|
||||||
|
def logout(request):
|
||||||
|
logout(request)
|
||||||
|
redirect(index)
|
||||||
|
@ -1,18 +1,23 @@
|
|||||||
# from django.shortcuts import render
|
# from django.shortcuts import render
|
||||||
|
from django.contrib.auth import authenticate, login
|
||||||
from django.http import HttpResponse, Http404
|
from django.http import HttpResponse, Http404
|
||||||
from django.template import loader
|
from django.template import loader
|
||||||
from django.shortcuts import render, get_object_or_404, get_list_or_404
|
from django.shortcuts import render, get_object_or_404, get_list_or_404, redirect
|
||||||
|
|
||||||
from .models import Bill
|
from .models import Bill
|
||||||
|
|
||||||
|
|
||||||
def index(request):
|
def index(request):
|
||||||
bills_list = Bill.objects.order_by('-due')
|
if request.user.is_authenticated:
|
||||||
# bills_list = get_list_or_404(Bill)
|
bills_list = Bill.objects.order_by('-due')
|
||||||
template = loader.get_template('bills/index.html')
|
# bills_list = get_list_or_404(Bill)
|
||||||
context = {'bills_list': bills_list, }
|
template = loader.get_template('bills/index.html')
|
||||||
print(bills_list)
|
context = {'bills_list': bills_list, }
|
||||||
return HttpResponse(template.render(context, request))
|
print(bills_list)
|
||||||
|
return HttpResponse(template.render(context, request))
|
||||||
|
else:
|
||||||
|
# return redirect(api.index)
|
||||||
|
return render(request, "index.html")
|
||||||
# return render(request, 'bills/index.html', context)
|
# return render(request, 'bills/index.html', context)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user