Add bootstrap frontend

This commit is contained in:
Ranga Gonnage
2023-04-27 10:01:35 +02:00
parent 1b45bda8dc
commit f46d3722e4
34 changed files with 20608 additions and 56 deletions

View File

@@ -1,7 +1,9 @@
import os
from pathlib import Path
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
@@ -106,4 +108,7 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATIC_URL = '/static/'
STATICFILES_DIRS = [BASE_DIR / "static",]

BIN
static/.DS_Store vendored Normal file

Binary file not shown.

BIN
static/assets/.DS_Store vendored Normal file

Binary file not shown.

BIN
static/assets/fonts/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,43 @@
Copyright (c) 2015, Chris Simpson, with Reserved Font Name: "Metropolis".
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.
The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the copyright statement(s).
"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.
"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.
5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.

BIN
static/assets/img/.DS_Store vendored Normal file

Binary file not shown.

BIN
static/assets/img/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
static/css/.DS_Store vendored Normal file

Binary file not shown.

20247
static/css/styles.css Normal file

File diff suppressed because it is too large Load Diff

50
static/js/scripts.js Normal file
View File

@@ -0,0 +1,50 @@
/*!
* Start Bootstrap - SB UI Kit Pro v2.0.3 (https://shop.startbootstrap.com/product/sb-ui-kit-pro)
* Copyright 2013-2021 Start Bootstrap
* Licensed under SEE_LICENSE (https://github.com/BlackrockDigital/sb-ui-kit-pro/blob/master/LICENSE)
*/
window.addEventListener('DOMContentLoaded', event => {
// Activate feather
feather.replace();
// Enable tooltips globally
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl);
});
// Enable popovers globally
var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'));
var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
return new bootstrap.Popover(popoverTriggerEl);
});
// Activate Bootstrap scrollspy for the sticky nav component
const navStick = document.body.querySelector('#navStick');
if (navStick) {
new bootstrap.ScrollSpy(document.body, {
target: '#navStick',
offset: 82,
});
}
// Collapse Navbar
// Add styling fallback for when a transparent background .navbar-marketing is scrolled
var navbarCollapse = function() {
const navbarMarketingTransparentFixed = document.body.querySelector('.navbar-marketing.bg-transparent.fixed-top');
if (!navbarMarketingTransparentFixed) {
return;
}
if (window.scrollY === 0) {
navbarMarketingTransparentFixed.classList.remove('navbar-scrolled')
} else {
navbarMarketingTransparentFixed.classList.add('navbar-scrolled')
}
};
// Collapse now if page is not at top
navbarCollapse();
// Collapse the navbar when page is scrolled
document.addEventListener('scroll', navbarCollapse);
});

67
templates/base.html Normal file
View File

@@ -0,0 +1,67 @@
<!DOCTYPE html>
{% load static %}
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>{% block title %}{% endblock title %}</title>
<link href="{% static 'css/styles.css' %}" rel="stylesheet" />
<link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />
<link rel="icon" type="image/x-icon" href="{% static 'assets/img/logo.png' %}" />
<script data-search-pseudo-elements defer src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/js/all.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/feather-icons/4.24.1/feather.min.js" crossorigin="anonymous"></script>
</head>
<body>
<div id="layoutDefault">
<div id="layoutDefault_content">
<main>
<!-- Navbar-->
<nav class="navbar navbar-expand-lg bg-white navbar-light">
<div class="container">
<a class="navbar-brand" href="{% url 'index'%}"><img class="img-responsive" src="{% static 'assets/img/logo.png' %}" width="70px" height="70px" alt="Logo Orange County Lettings"/></a>
<div>
<a class="btn fw-500 ms-lg-4 btn-primary" href="{% url 'profiles_index' %}">
Profiles
</a>
<a class="btn fw-500 ms-lg-4 btn-primary" href="{% url 'lettings_index' %}">
Lettings
</a>
</div>
</div>
</nav>
<hr class="m-0" />
{% block content %}{% endblock %}
</main>
</div>
<div id="layoutDefault_footer">
<footer class="footer pb-5 mt-auto bg-dark footer-dark">
<div class="container px-5">
<hr class="my-5" />
<div class="row gx-5 align-items-center">
<div class="col-md-6 small">Copyright &copy; Orange County Lettings 2023</div>
<div class="col-md-6 text-md-end small">
<a href="#!">Privacy Policy</a>
&middot;
<a href="#!">Terms &amp; Conditions</a>
</div>
</div>
</div>
</footer>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<script src="{% static 'js/scripts.js' %}"></script>
<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
<script>
AOS.init({
disable: 'mobile',
duration: 600,
once: true,
});
</script>
</body>
</html>

View File

@@ -1,4 +1,26 @@
<title>Holiday Homes</title>
<h1>Welcome to Holiday Homes</h1>
<div><a href="{% url 'profiles_index' %}">Profiles</a></div>
<div><a href="{% url 'lettings_index' %}">Lettings</a></div>
{% extends "base.html" %}
{% block title %}Holiday Homes{% endblock title %}
{% block content %}
<div class="container px-5 py-5 text-center">
<div class="row justify-content-center">
<div class="col-lg-8">
<h1 class="page-header-ui-title mb-3 display-6">Welcome to Holiday Homes</h1>
</div>
</div>
</div>
<div class="container px-5 py-5 text-center">
<div class="justify-content-center">
<a class="btn fw-500 ms-lg-4 btn-primary px-10" href="{% url 'profiles_index' %}">
Profiles
</a>
<a class="btn fw-500 ms-lg-4 btn-primary px-10" href="{% url 'lettings_index' %}">
Lettings
</a>
</div>
</div>
{% endblock %}

View File

@@ -1,8 +1,41 @@
<title>{{ title }}</title>
<h1>{{ title }}</h1>
<p>{{ address.number }} {{ address.street }}</p>
<p>{{ address.city }}, {{ address.state }} {{ address.zip_code }}</p>
<p>{{ address.country_iso_code }}</p>
<div><a href="{% url 'lettings_index' %}">Back</a></div>
<div><a href="{% url 'index' %}">Home</a></div>
<div><a href="{% url 'profiles_index' %}">Profiles</a></div>
{% extends "base.html" %}
{% load static %}
{% block title %}{{ title }}{% endblock title %}
{% block content %}
<div class="container px-5 py-5 text-center">
<div class="row justify-content-center">
<div class="col-lg-8">
<h1 class="page-header-ui-title mb-3 display-6">{{ title }}</h1>
</div>
</div>
</div>
<div class="container px-5 py-5 text-center">
<div class="card">
<div class="card-body">
<div class="icon-stack icon-stack-lg bg-primary text-white mb-3"><i data-feather="home"></i></div>
<p>{{ address.number }} {{ address.street }}</p>
<p>{{ address.city }}, {{ address.state }} {{ address.zip_code }}</p>
<p>{{ address.country_iso_code }}</p>
</div>
</div>
</div>
<div class="container px-5 py-5 text-center">
<div class="justify-content-center">
<a class="btn fw-500 ms-lg-4 btn-primary px-10" href="{% url 'lettings_index' %}">
<i class="ms-2" data-feather="arrow-right"></i>
Back
</a>
<a class="btn fw-500 ms-lg-4 btn-primary px-10" href="{% url 'index' %}">
Home
</a>
<a class="btn fw-500 ms-lg-4 btn-primary px-10" href="{% url 'profiles_index' %}">
Profiles
</a>
</div>
</div>
{% endblock %}

View File

@@ -1,17 +1,45 @@
<title>Lettings</title>
<h1>Lettings</h1>
{% if lettings_list %}
<ul>
{% for letting in lettings_list %}
<li>
<a href="{% url 'letting' letting_id=letting.id %}">
{{ letting.title }}
</a>
</li>
{% endfor %}
</ul>
{% else %}
<p>No lettings are available.</p>
{% endif %}
<div><a href="{% url 'index' %}">Home</a></div>
<div><a href="{% url 'profiles_index' %}">Profiles</a></div>
{% extends "base.html" %}
{% block title %}Lettings{% endblock title %}
{% block content %}
<div class="container px-5 py-5 text-center">
<div class="row justify-content-center">
<div class="col-lg-8">
<h1 class="page-header-ui-title mb-3 display-6">Lettings</h1>
</div>
</div>
</div>
<div class="container px-5">
<div class="row gx-5 justify-content-center">
<div class="col-lg-10">
<hr class="mb-0" />
{% if lettings_list %}
<ul class="list-group list-group-flush list-group-careers">
{% for letting in lettings_list %}
<li class="list-group-item">
<a href="{% url 'letting' letting_id=letting.id %}">{{ letting.title }}</a>
</li>
{% endfor %}
</ul>
{% else %}
<p>No lettings are available.</p>
{% endif %}
</div>
</div>
</div>
<div class="container px-5 py-5 text-center">
<div class="justify-content-center">
<a class="btn fw-500 ms-lg-4 btn-primary px-10" href="{% url 'index' %}">
Home
</a>
<a class="btn fw-500 ms-lg-4 btn-primary px-10" href="{% url 'profiles_index' %}">
Profiles
</a>
</div>
</div>
{% endblock %}

View File

@@ -1,9 +1,40 @@
<title>{{ profile.user.username }}</title>
<h1>{{ profile.user.username }}</h1>
<p>First name: {{ profile.user.first_name }}</p>
<p>Last name: {{ profile.user.last_name }}</p>
<p>Email: {{ profile.user.email }}</p>
<p>Favorite city: {{ profile.favorite_city }}</p>
<div><a href="{% url 'profiles_index' %}">Back</a></div>
<div><a href="{% url 'index' %}">Home</a></div>
<div><a href="{% url 'lettings_index' %}">Lettings</a></div>
{% extends "base.html" %}
{% block title %}{{ profile.user.username }}{% endblock title %}
{% block content %}
<div class="container px-5 py-5 text-center">
<div class="row justify-content-center">
<div class="col-lg-8">
<h1 class="page-header-ui-title mb-3 display-6">{{ profile.user.username }}</h1>
</div>
</div>
</div>
<div class="container px-5 py-5 text-center">
<div class="card">
<div class="card-body">
<div class="icon-stack icon-stack-lg bg-primary text-white mb-3"><i data-feather="user"></i></div>
<p><strong>First name :</strong> {{ profile.user.first_name }}</p>
<p><strong>Last name :</strong> {{ profile.user.last_name }}</p>
<p><strong>Email :</strong> {{ profile.user.email }}</p>
<p><strong>Favorite city :</strong> {{ profile.favorite_city }}</p>
</div>
</div>
</div>
<div class="container px-5 py-5 text-center">
<div class="justify-content-center">
<a class="btn fw-500 ms-lg-4 btn-primary px-10" href="{% url 'profiles_index' %}">
<i class="ms-2" data-feather="arrow-left"></i>
Back
</a>
<a class="btn fw-500 ms-lg-4 btn-primary px-10" href="{% url 'index' %}">
Home
</a>
<a class="btn fw-500 ms-lg-4 btn-primary px-10" href="{% url 'lettings_index' %}">
Lettings
</a>
</div>
</div>
{% endblock %}

View File

@@ -1,17 +1,43 @@
<title>Profiles</title>
<h1>Profiles</h1>
{% if profiles_list %}
<ul>
{% for profile in profiles_list %}
<li>
<a href="{% url 'profile' username=profile.user.username %}">
{{ profile.user.username }}
</a>
</li>
{% endfor %}
</ul>
{% else %}
<p>No profiles are available.</p>
{% endif %}
<div><a href="{% url 'index' %}">Home</a></div>
<div><a href="{% url 'lettings_index' %}">Lettings</a></div>
{% extends "base.html" %}
{% block title %}Profiles{% endblock title %}
{% block content %}
<div class="container px-5 py-5 text-center">
<div class="row justify-content-center">
<div class="col-lg-8">
<h1 class="page-header-ui-title mb-3 display-6">Profiles</h1>
</div>
</div>
</div>
<div class="container px-5">
<div class="row gx-5 justify-content-center">
<div class="col-lg-10">
<hr class="mb-0" />
{% if profiles_list %}
<ul class="list-group list-group-flush list-group-careers">
{% for profile in profiles_list %}
<li class="list-group-item">
<a href="{% url 'profile' username=profile.user.username %}">{{ profile.user.username }}</a>
</li>
{% endfor %}
</ul>
{% else %}
<p>No profiles are available.</p>
{% endif %}
</div>
</div>
</div>
<div class="container px-5 py-5 text-center">
<div class="justify-content-center">
<a class="btn fw-500 ms-lg-4 btn-primary px-10" href="{% url 'index' %}">
Home
</a>
<a class="btn fw-500 ms-lg-4 btn-primary px-10" href="{% url 'lettings_index' %}">
Lettings
</a>
</div>
</div>
{% endblock %}