diff --git a/.flaskenv b/.flaskenv deleted file mode 100644 index f84f4514fd3817c5e174aef38510848226be4e50..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..5056a5f7dc6cec2702fe24271b02e674b76c7f82 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +Database Files +*.db +Coworking_Spaces.db diff --git a/Coworking_Functions.py b/Coworking_Functions.py new file mode 100644 index 0000000000000000000000000000000000000000..0d170f2afee63de6e65e5244c28ea7bca7b3b309 --- /dev/null +++ b/Coworking_Functions.py @@ -0,0 +1,25 @@ +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: + csvWriter = writer(addToFile) + csvWriter.writerow(data) + addToFile.close() + return (f"{data} added.") diff --git a/OurSpaces.html b/OurSpaces.html deleted file mode 100644 index e70fe502fccb76d592b5164159cd77676cc15ac2..0000000000000000000000000000000000000000 --- 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 2b5216d4de5dead43968a20376806b8e9dc68615..0000000000000000000000000000000000000000 --- 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 5ee32a82b1663e141bd75cd0fb0770451a7b5693..0000000000000000000000000000000000000000 --- 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 a0b601ea56544f591026e7a33fa2be3df80b54c0..0000000000000000000000000000000000000000 --- 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 3a9489be6cea14e58c3fa335a5280c7075eec7c5..0000000000000000000000000000000000000000 --- 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 25b69bc2803a0b83228085f3d5bb89cb594143b0..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..edb3daf8c64334d9af1fadcd79d52b67a1a31444 --- /dev/null +++ b/project_server.py @@ -0,0 +1,12 @@ +import os +from flask import Flask, redirect, request, render_template, jsonify + + +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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/static/Coworking_Functions.py b/static/Coworking_Functions.py deleted file mode 100644 index a5c9134ee4de8fe5f33ab01944fb0a7af6f8997f..0000000000000000000000000000000000000000 --- a/static/Coworking_Functions.py +++ /dev/null @@ -1,9 +0,0 @@ -from csv import writer - -def addCoworkingSpaces(data): - - with open('coworking_spaces.csv', 'a') as addToFile: - csvWriter = writer(addToFile) - csvWriter.writerow(data) - addToFile.close() - return (f"{data} added.") diff --git a/static/__init__.py b/static/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/static/__pycache__/__init__.cpython-310.pyc b/static/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 2e099c12ae40d9f36336371daeaa85bcd52de30f..0000000000000000000000000000000000000000 Binary files a/static/__pycache__/__init__.cpython-310.pyc and /dev/null differ diff --git a/static/__pycache__/coworking_functions.cpython-310.pyc b/static/__pycache__/coworking_functions.cpython-310.pyc deleted file mode 100644 index 686c5e64725d8003e480164cad09f9b2c489d099..0000000000000000000000000000000000000000 Binary files a/static/__pycache__/coworking_functions.cpython-310.pyc and /dev/null differ 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 Binary files a/static/__pycache__/coworking_spaces_functions.cpython-310.pyc and /dev/null differ diff --git a/static/test b/static/test deleted file mode 100644 index d9135c2e99d6838e76808090509dfaab04aba7c7..0000000000000000000000000000000000000000 --- 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 85bdc71896bc8e60207bb82cd4c9610b8e17eedb..0000000000000000000000000000000000000000 --- 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 bd1f86d82fd0ef57e13e34946710b79b07e669f2..0000000000000000000000000000000000000000 --- a/tempServer.py +++ /dev/null @@ -1,34 +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'): - - 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) diff --git a/templates/.gitkeep b/templates/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000