Add templates!
This commit is contained in:
parent
1edd0892af
commit
24cdebe960
@ -183,6 +183,5 @@ JET_INDEX_DASHBOARD = 'dashboard.CustomIndexDashboard'
|
||||
|
||||
STATICFILES_DIRS = [
|
||||
BASE_DIR / "api/static",
|
||||
("assets", BASE_DIR / "assets"),
|
||||
"[os.path.join(BASE_DIR, 'static')",
|
||||
("assets", BASE_DIR / "api/static/assets"),
|
||||
]
|
||||
|
@ -1,248 +1,100 @@
|
||||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<!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" />
|
||||
<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>
|
||||
<!-- Navigation-->
|
||||
<nav class="navbar navbar-light bg-light static-top">
|
||||
<header class="p-3 text-bg-dark">
|
||||
<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>
|
||||
<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>
|
||||
|
||||
</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>
|
||||
<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>
|
||||
|
||||
<div class="text-end">
|
||||
<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>
|
||||
<!-- 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>
|
||||
<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>
|
||||
</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>
|
||||
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
<!-- 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>
|
||||
<!-- 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>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
from django.contrib.auth import logout
|
||||
from django.http import HttpResponse
|
||||
from django.template import loader
|
||||
from django.shortcuts import redirect
|
||||
|
||||
|
||||
def index(request):
|
||||
@ -7,3 +9,8 @@ def index(request):
|
||||
template = loader.get_template('index.html')
|
||||
context = {}
|
||||
return HttpResponse(template.render(context, request))
|
||||
|
||||
|
||||
def logout(request):
|
||||
logout(request)
|
||||
redirect(index)
|
||||
|
@ -1,18 +1,23 @@
|
||||
# from django.shortcuts import render
|
||||
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
|
||||
from django.shortcuts import render, get_object_or_404, get_list_or_404, redirect
|
||||
|
||||
from .models import Bill
|
||||
|
||||
|
||||
def index(request):
|
||||
if request.user.is_authenticated:
|
||||
bills_list = Bill.objects.order_by('-due')
|
||||
# bills_list = get_list_or_404(Bill)
|
||||
template = loader.get_template('bills/index.html')
|
||||
context = {'bills_list': bills_list, }
|
||||
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)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user