From 56d63c73daffcd04772a6469df5f8ca7c64cba01 Mon Sep 17 00:00:00 2001 From: Zainab Almeshari <almeshariz@cardiff.ac.uk> Date: Wed, 23 Nov 2022 17:11:09 +0000 Subject: [PATCH 1/8] Locations --- CSS | 4 ++ our locations.html | 136 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 CSS create mode 100644 our locations.html diff --git a/CSS b/CSS new file mode 100644 index 0000000..f955f61 --- /dev/null +++ b/CSS @@ -0,0 +1,4 @@ +<!DOCTYPE html> +<html> + <head> + <title> Locations </title> diff --git a/our locations.html b/our locations.html new file mode 100644 index 0000000..25b69bc --- /dev/null +++ b/our locations.html @@ -0,0 +1,136 @@ +<!DOCTYPE html> +<html> + <head> + <title> Locations </title> + +<style> + body{ + background-color: white; + color: black; +} + +header{ + background-color: white; + color: black; + display: block; + margin-left: auto; + margin-right: auto; + float: center; +} + +.container { + position: relative; + padding: 5px; + width: 50%; + height: 70%; + background-color: white; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); + margin-bottom: 25px; +} + + +.image { + opacity: 1; + display: block; + width: 100%; + height: 75%; + transition: .5s ease; + backface-visibility: hidden; + +} + +.middle { + transition: .5s ease; + opacity: 0; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%) + +} + +.container:hover .image { + opacity: 0.3; +} + +.container:hover .middle { + opacity: 1; +} + +.text { + background-color: black; + color: white; + font-size: 16px; + padding: 16px 32px; +} + + + +div.contain { + text-align: center; +} + +ul.list { + display: inline-block; + text-align: left; + list-style-type: none; +} + +</style> +<body> + <h1> OUR LOCATIONS </h1> + <div class="contain"> + <ul class= "list"> + <li> +<div class="container"> + <img src="https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w" class="image" > + + <div class="middle"> + <div class="text"> Codebase </div> + </div> + </div> + </li> + + <li> + <div class="container"> + <img src="https://wearecatalyst.org/wp-content/uploads/2022/05/Catalyst03.jpg" class="image" > + + <div class="middle"> + <div class="text"> Catalyst </div> + </div> + </div> + </li> + <li> + <div class="container"> + <img src="https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1594914119071-OWI9G22S295OCMSWL0VL/_K5L1162.jpg?format=2500w" Class="image" > + + <div class="middle"> + <div class="text"> C4DI </div> + </div> + </div> + </li> + + <li> + <div class="container"> + <img src="https://dogpatchlabs.wpenginepowered.com/wp-content/uploads/2022/09/ian_browne.jpg" class="image" > + + <div class="middle"> + <div class="text"> Dogpatch </div> + </div> + </div> + </li> + + <li> + <div class="container"> + <img src="https://stationf.co/img/misc/create-zone.jpg" class="image" > + + <div class="middle"> + <div class="text"> Station F </div> + </div> + </div> + </li> + </ul> +</div> + +</body> -- GitLab From b08bcf5eb41b3d7959e6c7936fa75f9c70f523b9 Mon Sep 17 00:00:00 2001 From: Liam Driscoll <driscolll4@cardiff.ac.uk> Date: Thu, 24 Nov 2022 17:38:14 +0000 Subject: [PATCH 2/8] Adding files related to adding a coworking space. --- static/add_coworking_spaces.py | 25 +++++++++++++++++++++++++ static/coworking_spaces.csv | 6 ++++++ static/coworking_spaces.db | Bin 0 -> 8192 bytes static/test | 20 ++++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 static/add_coworking_spaces.py create mode 100644 static/coworking_spaces.csv create mode 100644 static/coworking_spaces.db create mode 100644 static/test diff --git a/static/add_coworking_spaces.py b/static/add_coworking_spaces.py new file mode 100644 index 0000000..9fcc1b7 --- /dev/null +++ b/static/add_coworking_spaces.py @@ -0,0 +1,25 @@ +import flask +import csv + +name_Value = "NEWNEWNEW" +address_Value = "123CodeBase Edinburgh , 37a Castle Terrace, Edinburgh, EH1 2EL" +MP_Value = "123https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w" +AP_Value = "123https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868533510-J1OT4PEG5VM9FCBF8BJE/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-19+%281%29.jpg?format=2500w,https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868421127-07KQ4N1OHTDDKQME686A/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-52+%281%29.jpg?format=2500w" +description_Value = "123Hi. We\u2019re CodeBase. We've been exploring the world of startups and innovation for over five years now. We're not really sure how to best describe what we do, but we think the words \"tech cluster\" probably do it best. Please get in touch! We\u2019re friendly people who are geeky about building tech startups, managing disruption and innovation." +website_Value = "123https://www.thisiscodebase.com" +email_Value = "123info@thisiscodebase.com" +PN_Value = "123Hi(+44) 0131 560 2003" +OH_Value = "12308:00 - 17:00" +CI_Value = "123Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" + +recordValues = [name_Value, address_Value, MP_Value, AP_Value, description_Value, website_Value, email_Value, PN_Value, OH_Value, CI_Value] + +def addWorkingSpaces(values): + + with open('coworking_spaces.csv', 'a') as addToFile: + csvWriter = csv.writer(addToFile) + csvWriter.writerow(values) + addToFile.close() + return (f"{values} added.") + +addWorkingSpaces(recordValues) diff --git a/static/coworking_spaces.csv b/static/coworking_spaces.csv new file mode 100644 index 0000000..d2b3226 --- /dev/null +++ b/static/coworking_spaces.csv @@ -0,0 +1,6 @@ +Name,Address,Main_Photo,Additional_Photos,Description,Website,Email,Phone_Number,Opening_Hours,Checkin_Instructions +Codebase,"CodeBase Edinburgh , 37a Castle Terrace, Edinburgh, EH1 2EL",https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w,"https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868533510-J1OT4PEG5VM9FCBF8BJE/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-19+%281%29.jpg?format=2500w,https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868421127-07KQ4N1OHTDDKQME686A/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-52+%281%29.jpg?format=2500w","Hi. We’re CodeBase. We've been exploring the world of startups and innovation for over five years now. We're not really sure how to best describe what we do, but we think the words ""tech cluster"" probably do it best. Please get in touch! We’re friendly people who are geeky about building tech startups, managing disruption and innovation.",https://www.thisiscodebase.com,info@thisiscodebase.com,(+44) 0131 560 2003,08:00 - 17:00,"Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" +Catalyst,"Titanic Quarter, Queens Road, Belfast, BT3 9DT",https://wearecatalyst.org/wp-content/uploads/2022/05/Catalyst03.jpg,"https://wearecatalyst.org/wp-content/uploads/2022/03/DSC07673-scaled-2048x1570.jpg,https://wearecatalyst.org/wp-content/uploads/2021/01/2F6A1513.jpg","We are an independent, not-for-profit organisation working together for the greater good, enabling a connected community of like-minded innovators in an entrepreneurial eco-system that is the key driver of the knowledge economy in Northern Ireland.",https://wearecatalyst.org,enquiries@wearecatalyst.org,+44(0)28 9073 7800,08:00 - 18:00,"Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" +C4DI,"C4DI Campus, 31-38 Queen Street, Hull, HU1 1UU",https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1594914119071-OWI9G22S295OCMSWL0VL/_K5L1162.jpg?format=2500w,"https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1588346951023-V0QWKQI35IDUACMOJ0WM/_MKL2718.jpg?format=750w,https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1588346977833-LGY6P9473H2C5JF6I2UG/_K5M5505.jpg?format=750w","C4DI is an incubator that helps tech companies grow, and traditional businesses innovate.",http://www.c4di.co.uk,lc@c4di.net,+44 1482 304244,9am - 5pm,"Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" +Dogpatch Labs,"Custom House Quay, Dublin, D01 Y6H7",https://dogpatchlabs.wpenginepowered.com/wp-content/uploads/2022/09/ian_browne.jpg,"https://dogpatchlabs.wpenginepowered.com/wp-content/uploads/2021/07/bordered.jpg,https://dogpatchlabs.com/wp-content/uploads/2020/03/UG_3-1.jpg","Dogpatch Labs is a startup hub, located in the heart of Dublin’s Digital Docklands.",https://dogpatchlabs.com,info@dogpatchlabs.com,,8:30 - 5:30,"Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" +Stafion F,"5 Parvis Alan Turing, Paris",https://stationf.co/img/misc/create-zone.jpg,",https://stationf.co/img/flatmates/coffee-restaurant.jpg","Based in central Paris, STATION F gathers a whole entrepreneurial ecosystem under one roof. We help entrepreneurs bring their ambitious ideas to life.",https://stationf.co,,,0:00 - 0:00,Book through the Tramshed Tech app diff --git a/static/coworking_spaces.db b/static/coworking_spaces.db new file mode 100644 index 0000000000000000000000000000000000000000..73b2146c58484292d12e86ed6c341bb8f9a265ac GIT binary patch literal 8192 zcmeIuJqp5548ZZc;wtt6g^aqmcmS=^t&7?VRD8-q`@!Qay_bjaI9jmKt-JgKAt4DF ze&=KEg4J8&t1{?DVlhT`sv;7N(){|_w+_+IrXrH{_C4>fVv)sb>YP0S2q1s}0tg_0 z00IagfB*srj0Ex|F)oysr>&b{t2T5)jSi<QEix_AeV*ws)up?ttAo8;udR1g={tSc dZZ-NzivR)$Ab<b@2q1s}0tg_000Mt1@BwpnA*BES literal 0 HcmV?d00001 diff --git a/static/test b/static/test new file mode 100644 index 0000000..7286449 --- /dev/null +++ b/static/test @@ -0,0 +1,20 @@ +def getFieldnames(csvFile): + + fieldnames = [] + with open(csvFile, 'r') as readFile: + csvReader = csv.reader(readFile) + fieldnames = next(csvReader) + readFile.close() + return fieldnames + +dictKeys = getFieldnames('coworking_spaces.csv') + +""" +""" + +newRecord = {} +for x in range(len(keys)): + newRecord[keys[x]] = values[x] + +""" +""" -- GitLab From 3cc68dc8045e2558c8ef7b33a60d0f1600fd0ba6 Mon Sep 17 00:00:00 2001 From: Liam Driscoll <driscolll4@cardiff.ac.uk> Date: Thu, 24 Nov 2022 18:03:21 +0000 Subject: [PATCH 3/8] Reshuffling work. --- static/add_coworking_spaces.py | 25 ------------------------- static/coworking_spaces.db | Bin 8192 -> 0 bytes static/coworking_spaces_functions.py | 9 +++++++++ static/test | 13 +++++++++++++ 4 files changed, 22 insertions(+), 25 deletions(-) delete mode 100644 static/add_coworking_spaces.py delete mode 100644 static/coworking_spaces.db create mode 100644 static/coworking_spaces_functions.py diff --git a/static/add_coworking_spaces.py b/static/add_coworking_spaces.py deleted file mode 100644 index 9fcc1b7..0000000 --- a/static/add_coworking_spaces.py +++ /dev/null @@ -1,25 +0,0 @@ -import flask -import csv - -name_Value = "NEWNEWNEW" -address_Value = "123CodeBase Edinburgh , 37a Castle Terrace, Edinburgh, EH1 2EL" -MP_Value = "123https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w" -AP_Value = "123https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868533510-J1OT4PEG5VM9FCBF8BJE/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-19+%281%29.jpg?format=2500w,https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868421127-07KQ4N1OHTDDKQME686A/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-52+%281%29.jpg?format=2500w" -description_Value = "123Hi. We\u2019re CodeBase. We've been exploring the world of startups and innovation for over five years now. We're not really sure how to best describe what we do, but we think the words \"tech cluster\" probably do it best. Please get in touch! We\u2019re friendly people who are geeky about building tech startups, managing disruption and innovation." -website_Value = "123https://www.thisiscodebase.com" -email_Value = "123info@thisiscodebase.com" -PN_Value = "123Hi(+44) 0131 560 2003" -OH_Value = "12308:00 - 17:00" -CI_Value = "123Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" - -recordValues = [name_Value, address_Value, MP_Value, AP_Value, description_Value, website_Value, email_Value, PN_Value, OH_Value, CI_Value] - -def addWorkingSpaces(values): - - with open('coworking_spaces.csv', 'a') as addToFile: - csvWriter = csv.writer(addToFile) - csvWriter.writerow(values) - addToFile.close() - return (f"{values} added.") - -addWorkingSpaces(recordValues) diff --git a/static/coworking_spaces.db b/static/coworking_spaces.db deleted file mode 100644 index 73b2146c58484292d12e86ed6c341bb8f9a265ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8192 zcmeIuJqp5548ZZc;wtt6g^aqmcmS=^t&7?VRD8-q`@!Qay_bjaI9jmKt-JgKAt4DF ze&=KEg4J8&t1{?DVlhT`sv;7N(){|_w+_+IrXrH{_C4>fVv)sb>YP0S2q1s}0tg_0 z00IagfB*srj0Ex|F)oysr>&b{t2T5)jSi<QEix_AeV*ws)up?ttAo8;udR1g={tSc dZZ-NzivR)$Ab<b@2q1s}0tg_000Mt1@BwpnA*BES diff --git a/static/coworking_spaces_functions.py b/static/coworking_spaces_functions.py new file mode 100644 index 0000000..362635f --- /dev/null +++ b/static/coworking_spaces_functions.py @@ -0,0 +1,9 @@ +from csv import writer + +def addWorkingSpaces(values): + + with open('coworking_spaces.csv', 'a') as addToFile: + csvWriter = writer(addToFile) + csvWriter.writerow(values) + addToFile.close() + return (f"{values} added.") diff --git a/static/test b/static/test index 7286449..d9135c2 100644 --- a/static/test +++ b/static/test @@ -18,3 +18,16 @@ for x in range(len(keys)): """ """ + +name_Value = "NEWNEWNEW" +address_Value = "123CodeBase Edinburgh , 37a Castle Terrace, Edinburgh, EH1 2EL" +MP_Value = "123https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w" +AP_Value = "123https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868533510-J1OT4PEG5VM9FCBF8BJE/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-19+%281%29.jpg?format=2500w,https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868421127-07KQ4N1OHTDDKQME686A/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-52+%281%29.jpg?format=2500w" +description_Value = "123Hi. We\u2019re CodeBase. We've been exploring the world of startups and innovation for over five years now. We're not really sure how to best describe what we do, but we think the words \"tech cluster\" probably do it best. Please get in touch! We\u2019re friendly people who are geeky about building tech startups, managing disruption and innovation." +website_Value = "123https://www.thisiscodebase.com" +email_Value = "123info@thisiscodebase.com" +PN_Value = "123Hi(+44) 0131 560 2003" +OH_Value = "12308:00 - 17:00" +CI_Value = "123Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" + +recordValues = [name_Value, address_Value, MP_Value, AP_Value, description_Value, website_Value, email_Value, PN_Value, OH_Value, CI_Value] -- GitLab From fa10521c5b156bdc558059b0293993b5d42a1afb Mon Sep 17 00:00:00 2001 From: Liam Driscoll <driscolll4@cardiff.ac.uk> Date: Thu, 24 Nov 2022 22:34:16 +0000 Subject: [PATCH 4/8] Adding temporary server to test add record functions. --- __init__.py | 0 ...working_spaces.csv => coworking_spaces.csv | 0 ...es_functions.py => Coworking_Functions.py} | 6 +- static/Manage_Coworking_Spaces.html | 55 ++++++++++++++++++ static/Manage_Coworking_Spaces.js | 38 ++++++++++++ static/__init__.py | 0 static/__pycache__/__init__.cpython-310.pyc | Bin 0 -> 200 bytes .../coworking_functions.cpython-310.pyc | Bin 0 -> 530 bytes ...coworking_spaces_functions.cpython-310.pyc | Bin 0 -> 535 bytes tempServer.py | 34 +++++++++++ 10 files changed, 130 insertions(+), 3 deletions(-) create mode 100644 __init__.py rename static/coworking_spaces.csv => coworking_spaces.csv (100%) rename static/{coworking_spaces_functions.py => Coworking_Functions.py} (59%) create mode 100644 static/Manage_Coworking_Spaces.html create mode 100644 static/Manage_Coworking_Spaces.js create mode 100644 static/__init__.py create mode 100644 static/__pycache__/__init__.cpython-310.pyc create mode 100644 static/__pycache__/coworking_functions.cpython-310.pyc create mode 100644 static/__pycache__/coworking_spaces_functions.cpython-310.pyc create mode 100644 tempServer.py diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/static/coworking_spaces.csv b/coworking_spaces.csv similarity index 100% rename from static/coworking_spaces.csv rename to coworking_spaces.csv diff --git a/static/coworking_spaces_functions.py b/static/Coworking_Functions.py similarity index 59% rename from static/coworking_spaces_functions.py rename to static/Coworking_Functions.py index 362635f..a5c9134 100644 --- a/static/coworking_spaces_functions.py +++ b/static/Coworking_Functions.py @@ -1,9 +1,9 @@ from csv import writer -def addWorkingSpaces(values): +def addCoworkingSpaces(data): with open('coworking_spaces.csv', 'a') as addToFile: csvWriter = writer(addToFile) - csvWriter.writerow(values) + csvWriter.writerow(data) addToFile.close() - return (f"{values} added.") + return (f"{data} added.") diff --git a/static/Manage_Coworking_Spaces.html b/static/Manage_Coworking_Spaces.html new file mode 100644 index 0000000..7f11000 --- /dev/null +++ b/static/Manage_Coworking_Spaces.html @@ -0,0 +1,55 @@ +<!DOCTYPE html> +<html lang="EN" dir="ltr"> + <head> + <meta charSet="UTF-8"> + <title> Page Template </title> + <link rel="stylesheet" href="StylingSheet.css"> + + </head> + <body onLoad="pageLoad()"> + + <header id="header"> + <a href=""><h1>Page Header</h1></a> + </header> + + <hr> + + <main id="recordSection"> + <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> + + <br><br> + <button id="addButton" type="submit">Add</button> + </form> + <br> + <span id="DEBUGserverMessage"> </span> + </main> + + <hr> + + <footer id="footer"> + <a href="#header">Top</a> + </footer> + + <script src="Manage_Coworking_Spaces.js"></script> + </body> +</html> diff --git a/static/Manage_Coworking_Spaces.js b/static/Manage_Coworking_Spaces.js new file mode 100644 index 0000000..2cd7b3f --- /dev/null +++ b/static/Manage_Coworking_Spaces.js @@ -0,0 +1,38 @@ +// Replaces the onSubmit attribute for the addRecord form. +function pageLoad() { + document.getElementById('addButton').addEventListener('click',addRecord); +} + +// Adds a record to the CSV file. +function addRecord(e) { + // Removes the standard form processing. + e.preventDefault(); + e.stopPropagation(); + + var recordName = document.getElementById("recordName").value; + var recordAddress = document.getElementById("recordAddress").value; + var recordMainPhotos = document.getElementById("recordMainPhotos").value; + var recordAdditionalPhotos = document.getElementById("recordAdditionalPhotos").value; + var recordDescription = document.getElementById("recordDescription").value; + var recordWebsite = document.getElementById("recordWebsite").value; + var recordEmail = document.getElementById("recordEmail").value; + var recordPhoneNumber = document.getElementById("recordPhoneNumber").value; + var recordOpeningHours = document.getElementById("recordOpeningHours").value; + var recordCheckinInstructions = document.getElementById("recordCheckinInstructions").value; + + var params = 'recordName='+recordName+'&recordAddress='+recordAddress+'&recordMainPhotos='+recordMainPhotos+'&recordAdditionalPhotos='+recordAdditionalPhotos+'&recordDescription='+recordDescription+'&recordWebsite='+recordWebsite+'&recordEmail='+recordEmail+'&recordPhoneNumber='+recordPhoneNumber+'&recordOpeningHours='+recordOpeningHours+'&recordCheckinInstructions='+recordCheckinInstructions; + + var xhttp = new XMLHttpRequest(); + xhttp.open("POST", '/AddRecord', true); + xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); + xhttp.onreadystatechange = function() { + if (xhttp.readyState === 4 && xhttp.status === 200) { + console.log(xhttp.responseText); + document.getElementById("DEBUGserverMessage").innerHTML = xhttp.responseText; + } else { + console.error(`Status Text: ${xhttp.statusText}.`); + console.error(`Ready State: ${xhttp.readyState}.`); + } + }; + xhttp.send(params); +} diff --git a/static/__init__.py b/static/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/static/__pycache__/__init__.cpython-310.pyc b/static/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2e099c12ae40d9f36336371daeaa85bcd52de30f GIT binary patch literal 200 zcmd1j<>g`k0t>ImWDxxrL?8o3AjbiSi&=m~3PUi1CZpd<h9ZzKg7}r~WEB&foROcO z6XTp%l#-d2rVyH!S(aK<oLN#C6PcP=q+l46oRgWFSE5@`l%JKFTv8lUQk0lmoRONM zTaucbp^GXD6idw2H8hPWE=erOOpb|<&&<m#iI3MSsJz8tlbfGXnv-e=azrr`kYHf| E03Y@={{R30 literal 0 HcmV?d00001 diff --git a/static/__pycache__/coworking_functions.cpython-310.pyc b/static/__pycache__/coworking_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..686c5e64725d8003e480164cad09f9b2c489d099 GIT binary patch literal 530 zcmY*WKTiTN6mNTn90V5QV4R3?xd9Re7h{Z(#F0TXgv%wSX^T{kD`^V^0&&3I4`57S z^s_j--0I|4FbuvsHR5}D@8$jJukY8Ya=C~=Uf=H78sdAJYzl$o6wK^`<A~!3^>KhP z;)FX7C?MQzAwTy4UF73rYpkUen&CA65eK3N)&MgX;4Hv!vLKIpb8PVpFYuhq$db&^ z3V>&L>8ub$^n|$cOxlRR#V+W=!Kj7m$n1|{F4Ybghnnv;r#noImA;el&9xa&CQOZ) zQG)3-U!j}}Ui00=RRa<0lvCh+Z>q*gjz!7{-$`6fEe#4VeW}i6B!U7Uv@=34Nax|y z=jiMxY_XnFQP`lG%Wk)F70Z#(M%qc(5mZ;|A&aDlZFQj4tzg!KR@1)e30}2=^{W57 zP^0~7{V+6^TFJsc65V0UtW>e74JOGpEY<ks*UIRn&uU8GO2orO?13JvbpZ-Z-w7O8 dJtLY`vgJ2i`W=aP+*f=UiIeoRjGH0>))&E$g%|(; literal 0 HcmV?d00001 diff --git a/static/__pycache__/coworking_spaces_functions.cpython-310.pyc b/static/__pycache__/coworking_spaces_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..97f919c253eb91632b309dafbbf07caa64c515c3 GIT binary patch literal 535 zcmZ8ePfG$p6rY)0a}|XS9io#&mpv$W=n@f8(9uH{;<6ya%$QT_j?9dTqI9r(A0Prf z_GS72d+pR$kb>T>9jy0w@A3Z3Z{BZ4mCHp0^8NnE)(}6^WLpR%=U`?Z97h~SsE-4T z5hvVvLIL4!6ZyGM=pr8{J7X=a&<v;fuQ(7ruuCv=4bB1#Ckyg?Fvk|p@B+`tj4a6v ztpIq2m(B`7L@$UtucU<tT<n4_9E_T%j?Cd0=2C5gaj5xjW4g!GSm_5D-*wD@GGS`W zj1o+z`3mJ+@S5)?t{R9~r<?+Bv#A;<ITk4+d?#@^wKOQe^o_cbkq8Qa(8>tCA)SX) z>-oh=*knDWqVSSxF1y{zZ7fGZ8)+wDTTor8hb)pJw$*`F_kvjyT21?=CwSEg)~o*Q zLXGyT_2bZ3Y9$N*ljwAZF|$&|rZ$))yRchpL$aB1OyAa&z?F!Hi`WA_`qBj`G<+v; eVE>G5R>>G_x%5vG@3gP@FcN3!j~O>b0<0f1HHT6F literal 0 HcmV?d00001 diff --git a/tempServer.py b/tempServer.py new file mode 100644 index 0000000..bd1f86d --- /dev/null +++ b/tempServer.py @@ -0,0 +1,34 @@ +import os +from flask import Flask, redirect, request, render_template, jsonify +from static import Coworking_Functions + +app = Flask(__name__) + +ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) + +@app.route("/AddRecord", methods=['POST']) +def addRecord(): + print('Processing record.') + infoMessage = 'Add record failed.' + if (request.method == 'POST'): + + recordName = request.form['recordName'] + recordAddress = request.form['recordAddress'] + recordMainPhotos = request.form['recordMainPhotos'] + recordAdditionalPhotos = request.form['recordAdditionalPhotos'] + recordDescription = request.form['recordDescription'] + recordWebsite = request.form['recordWebsite'] + recordEmail = request.form['recordEmail'] + recordPhoneNumber = request.form['recordPhoneNumber'] + recordOpeningHours = request.form['recordOpeningHours'] + recordCheckinInstructions = request.form['recordCheckinInstructions'] + + recordData = [recordName, recordAddress, recordMainPhotos, recordAdditionalPhotos, recordDescription, recordWebsite, recordEmail, recordPhoneNumber, recordOpeningHours, recordCheckinInstructions] + + Coworking_Functions.addCoworkingSpaces(recordData) + + print(infoMessage) + return infoMessage + +if __name__ == "__main__": + app.run(debug=True) -- GitLab From ef8329db08d0b1c3fc673bf2d49b2b705f7cbfa6 Mon Sep 17 00:00:00 2001 From: Zainab Almeshari <almeshariz@cardiff.ac.uk> Date: Fri, 25 Nov 2022 11:53:43 +0000 Subject: [PATCH 5/8] Update html --- CSS | 4 ---- html | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 4 deletions(-) delete mode 100644 CSS create mode 100644 html diff --git a/CSS b/CSS deleted file mode 100644 index f955f61..0000000 --- a/CSS +++ /dev/null @@ -1,4 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <title> Locations </title> diff --git a/html b/html new file mode 100644 index 0000000..2b5216d --- /dev/null +++ b/html @@ -0,0 +1,64 @@ +<!DOCTYPE html> +<html> + <head> + <link rel="stylesheet" href= "css/locations.css"> + <title> Locations </title> +</head> +<body> + <h1> + <img src="https://www.4piproductions.com/wp-content/uploads/2017/04/tramshed_.png" class="logo"> + OUR LOCATIONS </h1> + <div class="contain"> + <ul class= "list"> + <li> +<div class="container"> + <img src="https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w" class="image" > + + <div class="middle"> + <div class="text"> Codebase </div> + </div> + </div> + </li> + + <li> + <div class="container"> + <img src="https://wearecatalyst.org/wp-content/uploads/2022/05/Catalyst03.jpg" class="image" > + + <div class="middle"> + <div class="text"> Catalyst </div> + </div> + </div> + </li> + <li> + <div class="container"> + <img src="https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1594914119071-OWI9G22S295OCMSWL0VL/_K5L1162.jpg?format=2500w" Class="image" > + + <div class="middle"> + <div class="text"> C4DI </div> + </div> + </div> + </li> + + <li> + <div class="container"> + <img src="https://dogpatchlabs.wpenginepowered.com/wp-content/uploads/2022/09/ian_browne.jpg" class="image" > + + <div class="middle"> + <div class="text"> Dogpatch </div> + </div> + </div> + </li> + + <li> + <div class="container"> + <img src="https://stationf.co/img/misc/create-zone.jpg" class="image" > + + <div class="middle"> + <div class="text"> Station F </div> + </div> + </div> + </li> + </ul> +</div> + +</body> -- GitLab From 71df99e9200223027d59f985a7db05c96fdcd471 Mon Sep 17 00:00:00 2001 From: Liam Driscoll <driscolll4@cardiff.ac.uk> Date: Fri, 25 Nov 2022 21:31:54 +0000 Subject: [PATCH 6/8] getWorkingSpaces function. --- static/Coworking_Functions.py | 16 ++++++++++++ .../coworking_functions.cpython-310.pyc | Bin 530 -> 1075 bytes tempServer.py | 23 ++++++------------ 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/static/Coworking_Functions.py b/static/Coworking_Functions.py index a5c9134..0d170f2 100644 --- a/static/Coworking_Functions.py +++ b/static/Coworking_Functions.py @@ -1,5 +1,21 @@ +from flask import request from csv import writer +def getCoworkingSpaces(): + + recordName = request.form['recordName'] + recordAddress = request.form['recordAddress'] + recordMainPhotos = request.form['recordMainPhotos'] + recordAdditionalPhotos = request.form['recordAdditionalPhotos'] + recordDescription = request.form['recordDescription'] + recordWebsite = request.form['recordWebsite'] + recordEmail = request.form['recordEmail'] + recordPhoneNumber = request.form['recordPhoneNumber'] + recordOpeningHours = request.form['recordOpeningHours'] + recordCheckinInstructions = request.form['recordCheckinInstructions'] + recordData = [recordName, recordAddress, recordMainPhotos, recordAdditionalPhotos, recordDescription, recordWebsite, recordEmail, recordPhoneNumber, recordOpeningHours, recordCheckinInstructions] + return recordData + def addCoworkingSpaces(data): with open('coworking_spaces.csv', 'a') as addToFile: diff --git a/static/__pycache__/coworking_functions.cpython-310.pyc b/static/__pycache__/coworking_functions.cpython-310.pyc index 686c5e64725d8003e480164cad09f9b2c489d099..75827615d0172035b54e3fc75e88671308f27448 100644 GIT binary patch literal 1075 zcmZ9L&u`N(6vu5RZPT=atxT|Snh=*rbZ7@I2qB<jf&&Fn(4Z<pneDFGlDOFJs!gc` z8h8ExgtQ&`mwe^KzkoRK>}=JBEr0#-dyap-7qPGqA}Am3exdJtgnrq<#X?~42%5SB z!VtqL%5WcJ%OoY4*Y|)u=6^+fpH)~D`U<P{P!#-zFHnR{bt)6hB~VTBPZO>*#nyFJ zJm>>x9cbz`h=yGlIVRt3&alP>KE^XrkP}j%Q`on_C*CQ79({*>e~@iN;4D7WV>n3< zZ6I}P3iE7z4~>B>^1DaNR7{23Px9T5Y8+Fp)~Px$I6kVa#f)*b9{I)>W1dTU<$h2e zT1-uarb6+^Gd_!T+^@szH)1PEdA|-TY`eStMABa2&%u-XgB~3Tkq$bsWXW*2_BKxr zxKxQg9K7eTT-zAXG~u~!kEPh-RI7oOai&I`wKb=s_GK^F;;g-KZ=iIn6FTV3FR?Yr zsZK<$*2jmY1&5ludhU7<Or)A1O%mV`2T*VSl{VNE+PpM?tkJ#xX8?`%FvF{8RuTci z&gKCTM?R3}r~>3WssdFU)qtvw0-&0sI#A#!1gaMh#ex)G;TM&nTGWc5sPBfeum~Ym zjjjnLr$VxBoN=>I@?*v%SIR7w!xwRqzZwZGl({~ikl6Q#(=+>0Y2W0E%4BR^=WA{A z9f$`vjdI4*EKX8$HXT0Bd3TcSaA{hl|0N^^q|Gxik;<%=w$6xC$ff7G(sEM9AtKVI zvhjyPW>G`hmz6dEa>2?KD_5;7T3NEvvU1JJGRXP0HzCbjI+aqluGTKs{{`4CtyVxn z5<-A4*A?Ouc>|o?sM_}+PhD1<$}o-9zB{K&1vllwUN(uP+c0>L2{uXjL;I^LYj2_^ I4oEZj2eAwe_W%F@ delta 181 zcmdnYF^PpQpO=@50SHcCtxx{LFp*D2R|3dOVMt-jVaR2SVq|1UVM<|cVTfW%VF_l? zWPJ%ztjTzbt-L6+B(-Q_*%e0i$=-~q+{yXn`9;~8dFk<KlXo-9hcg4!74rZI9wrV( zE=CR@RQXfH2^8?tWR7A^E-ou#0&>72MeHCJg5UshZ*kb<=BJeAq}nk8dBrS1f(K|8 E0FX{3;Q#;t diff --git a/tempServer.py b/tempServer.py index bd1f86d..f5fab1f 100644 --- a/tempServer.py +++ b/tempServer.py @@ -8,27 +8,18 @@ ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) @app.route("/AddRecord", methods=['POST']) def addRecord(): - print('Processing record.') - infoMessage = 'Add record failed.' - if (request.method == 'POST'): - - recordName = request.form['recordName'] - recordAddress = request.form['recordAddress'] - recordMainPhotos = request.form['recordMainPhotos'] - recordAdditionalPhotos = request.form['recordAdditionalPhotos'] - recordDescription = request.form['recordDescription'] - recordWebsite = request.form['recordWebsite'] - recordEmail = request.form['recordEmail'] - recordPhoneNumber = request.form['recordPhoneNumber'] - recordOpeningHours = request.form['recordOpeningHours'] - recordCheckinInstructions = request.form['recordCheckinInstructions'] - recordData = [recordName, recordAddress, recordMainPhotos, recordAdditionalPhotos, recordDescription, recordWebsite, recordEmail, recordPhoneNumber, recordOpeningHours, recordCheckinInstructions] + print('Processing record.') + infoMessage = ('Add record failed.') + if (request.method == 'POST'): + + recordData = Coworking_Functions.getCoworkingSpaces() Coworking_Functions.addCoworkingSpaces(recordData) + infoMessage = (f'{recordData} Record added.') print(infoMessage) - return infoMessage + return (infoMessage) if __name__ == "__main__": app.run(debug=True) -- GitLab From 868a79248cacc59887e82c991b9eaf01763d856a Mon Sep 17 00:00:00 2001 From: Liam Driscoll <driscolll4@cardiff.ac.uk> Date: Tue, 29 Nov 2022 10:13:53 +0000 Subject: [PATCH 7/8] Resorted repository as a team. --- .flaskenv | 2 - .gitignore | 3 + ...ing_Functions.py => Coworking_Functions.py | 0 OurSpaces.html | 16 --- html | 64 --------- landingpage.html | 9 -- locations | 31 ---- main.py | 40 ------ our locations.html | 136 ------------------ __init__.py => project_db.sql | 0 project_server.py | 12 ++ static/.gitkeep | 0 static/__init__.py | 0 static/__pycache__/__init__.cpython-310.pyc | Bin 200 -> 0 bytes .../coworking_functions.cpython-310.pyc | Bin 1075 -> 0 bytes ...coworking_spaces_functions.cpython-310.pyc | Bin 535 -> 0 bytes static/test | 33 ----- style.css | 32 ----- tempServer.py | 25 ---- templates/.gitkeep | 0 20 files changed, 15 insertions(+), 388 deletions(-) delete mode 100644 .flaskenv create mode 100644 .gitignore rename static/Coworking_Functions.py => Coworking_Functions.py (100%) delete mode 100644 OurSpaces.html delete mode 100644 html delete mode 100644 landingpage.html delete mode 100644 locations delete mode 100644 main.py delete mode 100644 our locations.html rename __init__.py => project_db.sql (100%) create mode 100644 project_server.py delete mode 100644 static/.gitkeep delete mode 100644 static/__init__.py delete mode 100644 static/__pycache__/__init__.cpython-310.pyc delete mode 100644 static/__pycache__/coworking_functions.cpython-310.pyc delete mode 100644 static/__pycache__/coworking_spaces_functions.cpython-310.pyc delete mode 100644 static/test delete mode 100644 style.css delete mode 100644 tempServer.py delete mode 100644 templates/.gitkeep diff --git a/.flaskenv b/.flaskenv deleted file mode 100644 index f84f451..0000000 --- a/.flaskenv +++ /dev/null @@ -1,2 +0,0 @@ -FLASK_APP=main.py -FLASK_ENV=development diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5056a5f --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +Database Files +*.db +Coworking_Spaces.db diff --git a/static/Coworking_Functions.py b/Coworking_Functions.py similarity index 100% rename from static/Coworking_Functions.py rename to Coworking_Functions.py diff --git a/OurSpaces.html b/OurSpaces.html deleted file mode 100644 index e70fe50..0000000 --- a/OurSpaces.html +++ /dev/null @@ -1,16 +0,0 @@ -<head> - <link rel="stylesheet" href="framework.css"> -</head> - -<body class="body"> - -<header> <img src="header.png"/> </header> - - - - - -<div class="box"> - -</div> -</body> diff --git a/html b/html deleted file mode 100644 index 2b5216d..0000000 --- a/html +++ /dev/null @@ -1,64 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <link rel="stylesheet" href= "css/locations.css"> - <title> Locations </title> -</head> -<body> - <h1> - <img src="https://www.4piproductions.com/wp-content/uploads/2017/04/tramshed_.png" class="logo"> - OUR LOCATIONS </h1> - <div class="contain"> - <ul class= "list"> - <li> -<div class="container"> - <img src="https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w" class="image" > - - <div class="middle"> - <div class="text"> Codebase </div> - </div> - </div> - </li> - - <li> - <div class="container"> - <img src="https://wearecatalyst.org/wp-content/uploads/2022/05/Catalyst03.jpg" class="image" > - - <div class="middle"> - <div class="text"> Catalyst </div> - </div> - </div> - </li> - <li> - <div class="container"> - <img src="https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1594914119071-OWI9G22S295OCMSWL0VL/_K5L1162.jpg?format=2500w" Class="image" > - - <div class="middle"> - <div class="text"> C4DI </div> - </div> - </div> - </li> - - <li> - <div class="container"> - <img src="https://dogpatchlabs.wpenginepowered.com/wp-content/uploads/2022/09/ian_browne.jpg" class="image" > - - <div class="middle"> - <div class="text"> Dogpatch </div> - </div> - </div> - </li> - - <li> - <div class="container"> - <img src="https://stationf.co/img/misc/create-zone.jpg" class="image" > - - <div class="middle"> - <div class="text"> Station F </div> - </div> - </div> - </li> - </ul> -</div> - -</body> diff --git a/landingpage.html b/landingpage.html deleted file mode 100644 index 5ee32a8..0000000 --- a/landingpage.html +++ /dev/null @@ -1,9 +0,0 @@ -<html> -<head><link rel="stylesheet" href="style.css"></head> -<header> - <img src="logo.jpg"/><br><br><br><br> -</header> -<body class="body"> - <img src="title.png"/> - <button id= "ViewLocations" type="ViewLocations" href="locations.html">View Locations</button> -</html> diff --git a/locations b/locations deleted file mode 100644 index a0b601e..0000000 --- a/locations +++ /dev/null @@ -1,31 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <title> Locations </title> - -<style> - body{ - background-color: white; - color: black; -} - -header{ - background-color: white; - color: black; - display: block; - margin-left: auto; - margin-right: auto; - float: center; -} -</style> -<body> - <h1> OUR LOCATIONS </h> - <ul> - <li><img src="https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w" wedth="200" height="200" ><p> Codebase </p></li> - <li><img src="https://wearecatalyst.org/wp-content/uploads/2022/05/Catalyst03.jpg" wedth="200" height="200" ><p> Catalyst </p></li> - <li><img src="https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1594914119071-OWI9G22S295OCMSWL0VL/_K5L1162.jpg?format=2500w" wedth="200" height="200" ><p> C4DI </p></li> - <li><img src="https://dogpatchlabs.wpenginepowered.com/wp-content/uploads/2022/09/ian_browne.jpg "wedth="200" height="200" ><p> Dogpatch </p></li> - <li><img src="https://stationf.co/img/misc/create-zone.jpg" wedth="200" height="200" ><p> Stafion F </p></li> - </ul> - -</body> diff --git a/main.py b/main.py deleted file mode 100644 index 3a9489b..0000000 --- a/main.py +++ /dev/null @@ -1,40 +0,0 @@ -from flask import Flask, request, render_template, redirect -import database -import csv -import re - - -def import_workspace(data): - workspace = database.Workspace( - data["name"], - data["address"], - data["main_photo"], - data["additional_photos"], - data["description"], - data["website"], - data["email"], - data["phone_number"], - data["opening_hours"], - data["checkin_instructions"] - ) - -app = Flask(__name__) - - - - -file = open("coworking_spaces.csv") -csvreader = csv.reader(file) -header = next(csvreader) - -Rows= [] -for Row in csvreader: - Rows.append(Row) -print(Row) - -with open('coworking_spaces.csv') as file: - content = file.readlines() -header = content[2:] -rows = content[1:] -print(header) -print(Rows) diff --git a/our locations.html b/our locations.html deleted file mode 100644 index 25b69bc..0000000 --- a/our locations.html +++ /dev/null @@ -1,136 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <title> Locations </title> - -<style> - body{ - background-color: white; - color: black; -} - -header{ - background-color: white; - color: black; - display: block; - margin-left: auto; - margin-right: auto; - float: center; -} - -.container { - position: relative; - padding: 5px; - width: 50%; - height: 70%; - background-color: white; - box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); - margin-bottom: 25px; -} - - -.image { - opacity: 1; - display: block; - width: 100%; - height: 75%; - transition: .5s ease; - backface-visibility: hidden; - -} - -.middle { - transition: .5s ease; - opacity: 0; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - -ms-transform: translate(-50%, -50%) - -} - -.container:hover .image { - opacity: 0.3; -} - -.container:hover .middle { - opacity: 1; -} - -.text { - background-color: black; - color: white; - font-size: 16px; - padding: 16px 32px; -} - - - -div.contain { - text-align: center; -} - -ul.list { - display: inline-block; - text-align: left; - list-style-type: none; -} - -</style> -<body> - <h1> OUR LOCATIONS </h1> - <div class="contain"> - <ul class= "list"> - <li> -<div class="container"> - <img src="https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w" class="image" > - - <div class="middle"> - <div class="text"> Codebase </div> - </div> - </div> - </li> - - <li> - <div class="container"> - <img src="https://wearecatalyst.org/wp-content/uploads/2022/05/Catalyst03.jpg" class="image" > - - <div class="middle"> - <div class="text"> Catalyst </div> - </div> - </div> - </li> - <li> - <div class="container"> - <img src="https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1594914119071-OWI9G22S295OCMSWL0VL/_K5L1162.jpg?format=2500w" Class="image" > - - <div class="middle"> - <div class="text"> C4DI </div> - </div> - </div> - </li> - - <li> - <div class="container"> - <img src="https://dogpatchlabs.wpenginepowered.com/wp-content/uploads/2022/09/ian_browne.jpg" class="image" > - - <div class="middle"> - <div class="text"> Dogpatch </div> - </div> - </div> - </li> - - <li> - <div class="container"> - <img src="https://stationf.co/img/misc/create-zone.jpg" class="image" > - - <div class="middle"> - <div class="text"> Station F </div> - </div> - </div> - </li> - </ul> -</div> - -</body> diff --git a/__init__.py b/project_db.sql similarity index 100% rename from __init__.py rename to project_db.sql diff --git a/project_server.py b/project_server.py new file mode 100644 index 0000000..8c59c25 --- /dev/null +++ b/project_server.py @@ -0,0 +1,12 @@ +import os +from flask import Flask, redirect, request, render_template, jsonify +from . import Coworking_Functions + +app = Flask(__name__) + +ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) + +#PUT ROUTES HERE + +if __name__ == "__main__": + app.run(debug=True) diff --git a/static/.gitkeep b/static/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/static/__init__.py b/static/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/static/__pycache__/__init__.cpython-310.pyc b/static/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 2e099c12ae40d9f36336371daeaa85bcd52de30f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 200 zcmd1j<>g`k0t>ImWDxxrL?8o3AjbiSi&=m~3PUi1CZpd<h9ZzKg7}r~WEB&foROcO z6XTp%l#-d2rVyH!S(aK<oLN#C6PcP=q+l46oRgWFSE5@`l%JKFTv8lUQk0lmoRONM zTaucbp^GXD6idw2H8hPWE=erOOpb|<&&<m#iI3MSsJz8tlbfGXnv-e=azrr`kYHf| E03Y@={{R30 diff --git a/static/__pycache__/coworking_functions.cpython-310.pyc b/static/__pycache__/coworking_functions.cpython-310.pyc deleted file mode 100644 index 75827615d0172035b54e3fc75e88671308f27448..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1075 zcmZ9L&u`N(6vu5RZPT=atxT|Snh=*rbZ7@I2qB<jf&&Fn(4Z<pneDFGlDOFJs!gc` z8h8ExgtQ&`mwe^KzkoRK>}=JBEr0#-dyap-7qPGqA}Am3exdJtgnrq<#X?~42%5SB z!VtqL%5WcJ%OoY4*Y|)u=6^+fpH)~D`U<P{P!#-zFHnR{bt)6hB~VTBPZO>*#nyFJ zJm>>x9cbz`h=yGlIVRt3&alP>KE^XrkP}j%Q`on_C*CQ79({*>e~@iN;4D7WV>n3< zZ6I}P3iE7z4~>B>^1DaNR7{23Px9T5Y8+Fp)~Px$I6kVa#f)*b9{I)>W1dTU<$h2e zT1-uarb6+^Gd_!T+^@szH)1PEdA|-TY`eStMABa2&%u-XgB~3Tkq$bsWXW*2_BKxr zxKxQg9K7eTT-zAXG~u~!kEPh-RI7oOai&I`wKb=s_GK^F;;g-KZ=iIn6FTV3FR?Yr zsZK<$*2jmY1&5ludhU7<Or)A1O%mV`2T*VSl{VNE+PpM?tkJ#xX8?`%FvF{8RuTci z&gKCTM?R3}r~>3WssdFU)qtvw0-&0sI#A#!1gaMh#ex)G;TM&nTGWc5sPBfeum~Ym zjjjnLr$VxBoN=>I@?*v%SIR7w!xwRqzZwZGl({~ikl6Q#(=+>0Y2W0E%4BR^=WA{A z9f$`vjdI4*EKX8$HXT0Bd3TcSaA{hl|0N^^q|Gxik;<%=w$6xC$ff7G(sEM9AtKVI zvhjyPW>G`hmz6dEa>2?KD_5;7T3NEvvU1JJGRXP0HzCbjI+aqluGTKs{{`4CtyVxn z5<-A4*A?Ouc>|o?sM_}+PhD1<$}o-9zB{K&1vllwUN(uP+c0>L2{uXjL;I^LYj2_^ I4oEZj2eAwe_W%F@ diff --git a/static/__pycache__/coworking_spaces_functions.cpython-310.pyc b/static/__pycache__/coworking_spaces_functions.cpython-310.pyc deleted file mode 100644 index 97f919c253eb91632b309dafbbf07caa64c515c3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 535 zcmZ8ePfG$p6rY)0a}|XS9io#&mpv$W=n@f8(9uH{;<6ya%$QT_j?9dTqI9r(A0Prf z_GS72d+pR$kb>T>9jy0w@A3Z3Z{BZ4mCHp0^8NnE)(}6^WLpR%=U`?Z97h~SsE-4T z5hvVvLIL4!6ZyGM=pr8{J7X=a&<v;fuQ(7ruuCv=4bB1#Ckyg?Fvk|p@B+`tj4a6v ztpIq2m(B`7L@$UtucU<tT<n4_9E_T%j?Cd0=2C5gaj5xjW4g!GSm_5D-*wD@GGS`W zj1o+z`3mJ+@S5)?t{R9~r<?+Bv#A;<ITk4+d?#@^wKOQe^o_cbkq8Qa(8>tCA)SX) z>-oh=*knDWqVSSxF1y{zZ7fGZ8)+wDTTor8hb)pJw$*`F_kvjyT21?=CwSEg)~o*Q zLXGyT_2bZ3Y9$N*ljwAZF|$&|rZ$))yRchpL$aB1OyAa&z?F!Hi`WA_`qBj`G<+v; eVE>G5R>>G_x%5vG@3gP@FcN3!j~O>b0<0f1HHT6F diff --git a/static/test b/static/test deleted file mode 100644 index d9135c2..0000000 --- a/static/test +++ /dev/null @@ -1,33 +0,0 @@ -def getFieldnames(csvFile): - - fieldnames = [] - with open(csvFile, 'r') as readFile: - csvReader = csv.reader(readFile) - fieldnames = next(csvReader) - readFile.close() - return fieldnames - -dictKeys = getFieldnames('coworking_spaces.csv') - -""" -""" - -newRecord = {} -for x in range(len(keys)): - newRecord[keys[x]] = values[x] - -""" -""" - -name_Value = "NEWNEWNEW" -address_Value = "123CodeBase Edinburgh , 37a Castle Terrace, Edinburgh, EH1 2EL" -MP_Value = "123https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w" -AP_Value = "123https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868533510-J1OT4PEG5VM9FCBF8BJE/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-19+%281%29.jpg?format=2500w,https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868421127-07KQ4N1OHTDDKQME686A/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-52+%281%29.jpg?format=2500w" -description_Value = "123Hi. We\u2019re CodeBase. We've been exploring the world of startups and innovation for over five years now. We're not really sure how to best describe what we do, but we think the words \"tech cluster\" probably do it best. Please get in touch! We\u2019re friendly people who are geeky about building tech startups, managing disruption and innovation." -website_Value = "123https://www.thisiscodebase.com" -email_Value = "123info@thisiscodebase.com" -PN_Value = "123Hi(+44) 0131 560 2003" -OH_Value = "12308:00 - 17:00" -CI_Value = "123Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" - -recordValues = [name_Value, address_Value, MP_Value, AP_Value, description_Value, website_Value, email_Value, PN_Value, OH_Value, CI_Value] diff --git a/style.css b/style.css deleted file mode 100644 index 85bdc71..0000000 --- a/style.css +++ /dev/null @@ -1,32 +0,0 @@ -header{ - background-color: black; - display: block; - color: black; - margin-left: auto; - margin-right: inherit; - width: 100%; - height: 75%; -} - -button{ - background-color: white; - color: black; - text-align: center; - position: fixed; - margin: inherit; - display: inline-block; - line-height: 20px; - float: center; - width: 10%; - height: 15%; - font-size: 16px; - border-radius: 12px; - padding: 1px 10px; - transform: translate(350%, 50%); - font-family: monospace; - font-style: oblique; - font-weight: bolder; -} - -body{ - display: block; diff --git a/tempServer.py b/tempServer.py deleted file mode 100644 index f5fab1f..0000000 --- a/tempServer.py +++ /dev/null @@ -1,25 +0,0 @@ -import os -from flask import Flask, redirect, request, render_template, jsonify -from static import Coworking_Functions - -app = Flask(__name__) - -ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) - -@app.route("/AddRecord", methods=['POST']) -def addRecord(): - - print('Processing record.') - infoMessage = ('Add record failed.') - - if (request.method == 'POST'): - - recordData = Coworking_Functions.getCoworkingSpaces() - Coworking_Functions.addCoworkingSpaces(recordData) - infoMessage = (f'{recordData} Record added.') - - print(infoMessage) - return (infoMessage) - -if __name__ == "__main__": - app.run(debug=True) diff --git a/templates/.gitkeep b/templates/.gitkeep deleted file mode 100644 index e69de29..0000000 -- GitLab From 5d66308a96e8b9daef796335e975a6f98dfbe3ef Mon Sep 17 00:00:00 2001 From: Liam Driscoll <driscolll4@cardiff.ac.uk> Date: Tue, 29 Nov 2022 10:18:37 +0000 Subject: [PATCH 8/8] removed 1 line from server. --- project_server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project_server.py b/project_server.py index 8c59c25..edb3daf 100644 --- a/project_server.py +++ b/project_server.py @@ -1,6 +1,6 @@ import os from flask import Flask, redirect, request, render_template, jsonify -from . import Coworking_Functions + app = Flask(__name__) -- GitLab