Skip to content
Snippets Groups Projects
Commit 2a89eff5 authored by Arianne Bayliss's avatar Arianne Bayliss
Browse files

Merge branch...

Merge branch '3-as-a-moderator-i-want-to-be-able-to-add-new-locations-spaces-features' into 'development'

Changes to CSS.

Closes #3

See merge request !28
parents 3b1b1e9e 71ce702d
No related branches found
No related tags found
1 merge request!28Changes to CSS.
import os
import csv
import sqlite3
from flask import Flask, redirect, request, render_template, jsonify
app = Flask(__name__)
DATABASE = "project_db.db"
ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'])
......@@ -26,10 +27,12 @@ def addRecord():
recordCheckinInstructions = request.form['recordCheckinInstructions']
recordData = [recordName, recordAddress, recordMainPhotos, recordAdditionalPhotos, recordDescription, recordWebsite, recordEmail, recordPhoneNumber, recordOpeningHours, recordCheckinInstructions]
with open('coworking_spaces.csv', 'a') as addToFile:
csvWriter = csv.writer(addToFile)
csvWriter.writerow(recordData)
addToFile.close()
conn = sqlite3.connect(DATABASE)
cur = conn.cursor()
cur.execute("INSERT INTO coworking_spaces ('Name', 'Address', 'Main_Photo', 'Additional_Photos', 'Description', 'Website', 'Email', 'Phone_Number', 'Opening_Hours', 'Checkin_Instructions')\
VALUES (?,?,?,?,?,?,?,?,?,?)", (recordName, recordAddress, recordMainPhotos, recordAdditionalPhotos, recordDescription, recordWebsite, recordEmail, recordPhoneNumber, recordOpeningHours, recordCheckinInstructions))
conn.commit()
conn.close()
infoMessage = (f'{recordData} Record added.')
......
......@@ -47,25 +47,42 @@ a {
/* [#1] Page header styling. Uses [#2].
header #pageHeader
main #headerMain
div #headerDiv
nav #headerNav .navBar
ul .Right, ul .Left
li a
*/
#headerMain {
#headerDiv {
text-align: center;
background-color: white;
padding: 20px 0px;
display: flex;
align-items: center;
justify-content: flex-start;
}
#headerMain a {
#headerDiv a {
font-size: 30px;
font-weight: bold;
color: black;
}
#headerText {
width: 100%;
margin-left: -220px;
}
#headerImg {
width: 180px;
height: 65px;
margin-top: -10px;
margin-right: 20px;
margin-bottom: -17.5px;
margin-left: 20px;
}
#headerNav {
width: 100%;
position: absolute;
......@@ -76,6 +93,11 @@ header #pageHeader
padding: 7.5px 10px;
}
#headerNav img {
width: 55px;
height: 20px;
}
/* [#2] Page navigation styling. Used in [#1] and [#4]. */
.navBar {
......@@ -101,15 +123,27 @@ header #pageHeader
/* [#3] Page main styling.
main #pageMain
form #recordForm
label
input .formTextInput
button #addButton
*/
#pageMain {}
#recordForm {
margin-left: 5px;
}
#recordForm .formTextInput {
margin-top: 5px;
width: 50%;
}
/* [#4] Page footer styling. Uses [#2].
footer #pageFooter
main #footerMain
nav #footerNav .navBar
ul .Center
li a
......
......@@ -9,12 +9,19 @@
<body onLoad="pageLoad()">
<header id="pageHeader" class="pageHeader">
<main id="headerMain">
<a href="Manage_Coworking_Spaces.html">Manage Coworking Spaces</a>
</main>
<div id="headerDiv">
<a href="Manage_Coworking_Spaces.html">
<img id="headerImg" class="headerImg"
src="Tramshed-Logo-Main-Black.png"></img></a>
<a id="headerText" class="headerText"
href="Manage_Coworking_Spaces.html">
Manage Coworking Spaces</a>
</div>
<nav id="headerNav" class="navBar">
<ul class="Left">
<li><a href="Manage_Coworking_Spaces.html">Home</a></li>
<li><a href="Manage_Coworking_Spaces.html">
<img id="navImg" class="navImg"
src="Tramshed-Logo-Main-White.png"></img></a></li>
<li><a href="Manage_Coworking_Spaces.html">Left</a></li>
<li><a href="Manage_Coworking_Spaces.html">Home</a></li>
<li><a href="Manage_Coworking_Spaces.html">Left</a></li>
......@@ -31,29 +38,28 @@
</nav>
</header>
<main id="recordSection">
<br>
<main id="pageMain">
<form id="recordForm" title="Record Form">
<label>Name: <input name="record_name" id="recordName"
type="text"></label><br>
<label>Address: <input name="record_address" id="recordAddress"
type="text"></label><br>
<label>Main Photograph: <input name="record_MP" id="recordMainPhotos"
type="text"></label><br>
<label>Additional Photographs: <input name="record_AP" id="recordAdditionalPhotos"
type="text"></label><br>
<label>Description: <input name="record_description" id="recordDescription"
type="text"></label><br>
<label>Website: <input name="record_website" id="recordWebsite"
type="text"></label><br>
<label>Email: <input name="record_email" id="recordEmail"
type="text"></label><br>
<label>Phone Number: <input name="record_PN" id="recordPhoneNumber"
type="text"></label><br>
<label>Opening Hours: <input name="record_OH" id="recordOpeningHours"
type="text"></label><br>
<label>Checkin Instructions: <input name="record_CI" id="recordCheckinInstructions"
type="text"></label>
<label>Name: <input id="recordName" class="formTextInput"
name="record_name" type="text"></label><br>
<label>Address: <input id="recordAddress" class="formTextInput"
name="record_address" type="text"></label><br>
<label>Main Photograph: <input id="recordMainPhotos" class="formTextInput"
name="record_MP" type="text"></label><br>
<label>Additional Photographs: <input id="recordAdditionalPhotos" class="formTextInput"
name="record_AP" type="text"></label><br>
<label>Description: <input id="recordDescription" class="formTextInput"
name="record_description" type="text"></label><br>
<label>Website: <input id="recordWebsite" class="formTextInput"
name="record_website" type="text"></label><br>
<label>Email: <input id="recordEmail" class="formTextInput"
name="record_email" type="text"></label><br>
<label>Phone Number: <input id="recordPhoneNumber" class="formTextInput"
name="record_PN" type="text"></label><br>
<label>Opening Hours: <input id="recordOpeningHours" class="formTextInput"
name="record_OH" type="text"></label><br>
<label>Checkin Instructions: <input id="recordCheckinInstructions" class="formTextInput"
name="record_CI" type="text"></label>
<br><br>
<button id="addButton" type="submit">Add</button>
......@@ -68,19 +74,17 @@
</main>
<footer id="pageFooter">
<main id="footerMain">
<nav id="footerNav" class="navBar">
<ul class="Center">
<li><a href="Manage_Coworking_Spaces.html">Left</a></li>
</ul>
<ul class="Center">
<li><a href="Manage_Coworking_Spaces.html">Center</a></li>
</ul>
<ul class="Center">
<li><a href="Manage_Coworking_Spaces.html">Right</a></li>
</ul>
</nav>
</main>
<nav id="footerNav" class="navBar">
<ul class="Center">
<li><a href="Manage_Coworking_Spaces.html">Left</a></li>
</ul>
<ul class="Center">
<li><a href="Manage_Coworking_Spaces.html">Center</a></li>
</ul>
<ul class="Center">
<li><a href="Manage_Coworking_Spaces.html">Right</a></li>
</ul>
</nav>
</footer>
<script src="Manage_Coworking_Spaces.js"></script>
......
......@@ -3,21 +3,20 @@ function onSubmitLoad() {
document.getElementById('addButton').addEventListener('click',addRecord);
}
function headerLoad() {
let headerMain = document.querySelector('#headerMain');
let headerMainHeight = headerMain.offsetHeight;
let headerDiv = document.querySelector('#headerDiv');
let headerDivHeight = headerDiv.offsetHeight;
let headerNav = document.querySelector('#headerNav');
let headerNavHeight = headerNav.offsetHeight;
let pageHeaderHeight = headerMainHeight + headerNavHeight;
let pageHeaderHeight = headerDivHeight + headerNavHeight;
document.getElementById("pageHeader").style.height = pageHeaderHeight + "px";
}
window.onscroll = function() {parallaxNavScroll()};
function parallaxNavScroll() {
let headerMain = document.querySelector('#headerMain');
let headerHeight = headerMain.offsetHeight;
let headerDiv = document.querySelector('#headerDiv');
let headerHeight = headerDiv.offsetHeight;
if (document.body.scrollTop > headerHeight || document.documentElement.scrollTop > headerHeight) {
document.getElementById("headerNav").style.top = "0";
document.getElementById("headerNav").style.position = "fixed";
......
static/Tramshed-Logo-Main-Black.png

84.3 KiB

static/Tramshed-Logo-Main-White.png

77.1 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment