diff --git a/coworking_spaces.csv b/coworking_spaces.csv index 0ed6e3e492957232c7fc5f1518811ba8ea86d043..1b5c6b07281e762ad220f8243c561b7e25785838 100644 --- a/coworking_spaces.csv +++ b/coworking_spaces.csv @@ -3,4 +3,4 @@ Codebase,"CodeBase Edinburgh , 37a Castle Terrace, Edinburgh, EH1 2EL",https://i 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 \ No newline at end of file +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/project_server.py b/project_server.py index accf4547fa5d9799237d55dce9a25589c3a09f48..b1c6bb5c1e4668d8d99623e01297dc07394c4df5 100644 --- a/project_server.py +++ b/project_server.py @@ -1,9 +1,10 @@ import os import sqlite3 -from flask import Flask, redirect, request, render_template, jsonify +from flask import Flask, redirect, request, render_template, jsonify, url_for, flash, session app = Flask(__name__) DATABASE = "project_db.db" +app.secret_key = "hello" ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) @@ -27,6 +28,48 @@ def returnManageCoworkingSpaces(): if (request.method == 'GET'): return render_template("Manage_Coworking_Spaces.html") +@app.route("/ListLocations", methods=['GET']) +def returnListLocations(): + if (request.method =='GET'): + conn = connect_db() + cur = conn.cursor() + cur.execute("SELECT Name, Main_Photo FROM coworking_spaces") + locationData = cur.fetchall() + conn.close() + return render_template("ListLocations.html", data = locationData) + +@app.route("/Load/CodeBase") +def Load(): + Name = "Codebase"; + conn = sqlite3.connect(DATABASE) + cur = conn.cursor() + print(Name) + # getAddress(Name) + cur.execute("SELECT * FROM 'coworking_spaces' WHERE Name =?;", [Name]) + data = cur.fetchall() + print(data) + # cur.execute("SELECT Address FROM coworking_spaces WHERE Name =? ;", [Name]) + # Address = cur.fetchall() + # print(Address) + # cur.execute("SELECT Main_Photo FROM coworking_spaces WHERE Name =? ;", [Name]) + # Main_Photo = cur.fetchall() + # print(Main_Photo) + # cur.execute("SELECT Additional_photos FROM coworking_spaces WHERE Name =? ;", [Name]) + # Additional_photos = cur.fetchall() + # print(Additional_photos) + # cur.execute("SELECT Description FROM coworking_spaces WHERE Name =? ;", [Name]) + # Description = cur.fetchall() + # print(Description) + # cur.execute("SELECT Website FROM coworking_spaces WHERE Name =? ;", [Name]) + # Website = cur.fetchall() + # print(Website) + # cur.execute("SELECT Opening_Hours FROM coworking_spaces WHERE Name =? ;", [Name]) + # Opening_Hours = cur.fetchall() + # print(Opening_Hours) + conn.close() + return render_template('Space.html', data = data) + # pageAddress = Address, pageMain_Photo = Main_Photo, pageAdditional_photos = Additional_photos, pageDescription = Description, pageWebsite = Website, pageOpening_Hours = Opening_Hours ) + @app.route("/SearchRecord", methods=['POST', 'GET']) def searchRecord(): @@ -144,5 +187,30 @@ def updateRecord(): print(infoMessage) return (infoMessage) +@app.route("/locations", methods=["POST" , "GET"]) +def Locations(): + + print('Processing location') + + if request.method == "POST": + session.permanent = True + locationsName = request.form['name'] + locationPic = request.form['image'] + + + conn = sqlite3.connect(DATABASE) + cur = conn.cursor() + cur.execute("SELECT Name, Main_photo FROM coworking_spaces WHERE Name= ?;", [locationsName]) + conn.commit() + conn.close() + + msg= " Location added successfuly!" + + return render_template('locations.html') + + + + + if __name__ == "__main__": app.run(debug=True) diff --git a/static/CSS/locations.css b/static/CSS/locations.css index 93d42136e3814df9aec333e95adacfbf243a23f5..76f5b34ec48aad1f02a488a3161aaec747ea764d 100644 --- a/static/CSS/locations.css +++ b/static/CSS/locations.css @@ -5,34 +5,63 @@ color: black; .container { +display: flex; position: relative; -padding: 5px; -width: 50%; -height: 70%; +padding: 5px 640px 5px 5px; +width: 40%; +height: 50%; 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; +border-radius: 10px; + } .image { opacity: 1; display: block; -width: 100%; -height: 75%; transition: .5s ease; backface-visibility: hidden; +border-radius: 10px 10px 10px 10px; + float: left; + width: 300px; + height: 250px; + object-fit: cover; +} + +h2 { +position: absolute; +margin-left: 320px; +margin-top: 30px; + } + +p{ + margin-top: 80px; + margin-left: 50px; +} + +.checked{ + color: orange; +} +.star{ + position: absolute; + top: 50%; + left: 40%; + transform: translate(-50%, -50%); + margin-top: 80px; + } .middle { transition: .5s ease; opacity: 0; position: absolute; -top: 50%; -left: 50%; -transform: translate(-50%, -50%); --ms-transform: translate(-50%, -50%) +top: 45%; +left: 10.5%; +transform: translate(-25%, -25%); +-ms-transform: translate(-25%, -25%) } @@ -51,17 +80,14 @@ font-size: 16px; padding: 16px 32px; } - - div.contain { text-align: center; } ul.list { display: inline-block; -text-align: center; list-style-type: none; -margin-left: 350px; +margin: 0; } h1 { @@ -98,7 +124,7 @@ margin: 10px 10px; outline: none; border-radius: 4px; padding: 4px; - position: fixed; + position: absolute; top: 65px; right: 20px; cursor: pointer; @@ -124,13 +150,13 @@ margin: 10px 10px; nav{ background-color: black; padding: 15px; - height: 100vh; - position: fixed; + height: 18.1vh; + position: absolute; top: 0; right: 0; width: 200px; transform: translateX(100%); - margin-top: 0.5em; + margin-top: 2.25em; border-radius: 10px; transition: 0.4s ease-in-out; } @@ -153,7 +179,8 @@ margin: 10px 10px; display: block; } nav ul li a:hover { - color: white; + color: #A9A9A9; + JScript/locations.js 0 → 100644 + 10 diff --git a/static/CSS/loginstyle.css b/static/CSS/loginstyle.css index 2c44a02a44c292502c7c4862d8e8b78d86024f40..515ebbf13d5f36a015e9d15910bbf002b0722cbb 100644 --- a/static/CSS/loginstyle.css +++ b/static/CSS/loginstyle.css @@ -10,7 +10,7 @@ header{ .card{ margin: 0 auto; - float: none; + float: none; margin-bottom: 10px; } @@ -22,8 +22,3 @@ body{ font-family: 'Sora', sans-serif; background-color: #212529; color: white; -<<<<<<< HEAD -} -======= -} ->>>>>>> 9c7255d510762a8f16afeba2657cad4a0f8b8239 diff --git a/static/locations.html b/static/locations.html index b2d35675eb5ad782b154eddb1550a1ef5de6cb9f..8718127609a84e2cfe8749daee50e0b1e9cd6b81 100644 --- a/static/locations.html +++ b/static/locations.html @@ -2,11 +2,12 @@ <html> <head> <link rel="stylesheet" href= "CSS/locations.css"> + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <title> Locations </title> </head> <body> - <section> - <h1><img src="https://www.4piproductions.com/wp-content/uploads/2017/04/tramshed_.png" class="logo"> Our Locations </h1> + <section> + <h1><img src="Media/logo.png" class="logo"/> Our Locations </h1> <button> <span></span> <span></span> @@ -14,29 +15,44 @@ </button> <nav> <ul> - <li><a href="#"> Home </a></li> - <li><a href="#"> ### </a></li> - <li><a href="#"> ### </a></li> - </ul> + <li><a href="landingpage.html"> Home </a></li> + <li><a href="#"> ### </a></li> + <li><a href="#"> ### </a></li> + </ul> </nav> - <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" > - + <h2> Codebase </h2> + <p>hhhhhhhhhhhhhhhhhhhhhhhhhhh</p> + <div class= star> + <span class="fa fa-star fa-3x checked" ></span> + <span class="fa fa-star fa-3x checked"></span> + <span class="fa fa-star fa-3x checked"></span> + <span class="fa fa-star fa-3x" ></span> + <span class="fa fa-star fa-3x" ></span> + </div> <div class="middle"> <div class="text"> Codebase </div> - </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"> + <img src="https://wearecatalyst.org/wp-content/uploads/2022/05/Catalyst03.jpg" class="image" > + <h2> Catalyst </h2> + <p>hhhhhhhhhhhhhhhhhhhhhhhhhhh</p> + <div class= star> + <span class="fa fa-star fa-3x checked" ></span> + <span class="fa fa-star fa-3x checked"></span> + <span class="fa fa-star fa-3x checked"></span> + <span class="fa fa-star fa-3x" ></span> + <span class="fa fa-star fa-3x" ></span> + </div> + <div class="middle"> <div class="text"> Catalyst </div> </div> </div> @@ -44,7 +60,15 @@ <li> <div class="container"> <img src="https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1594914119071-OWI9G22S295OCMSWL0VL/_K5L1162.jpg?format=2500w" Class="image" > - + <h2> C4DI </h2> + <p>hhhhhhhhhhhhhhhhhhhhhhhhhhh</p> + <div class= star> + <span class="fa fa-star fa-3x checked" ></span> + <span class="fa fa-star fa-3x checked"></span> + <span class="fa fa-star fa-3x checked"></span> + <span class="fa fa-star fa-3x" ></span> + <span class="fa fa-star fa-3x" ></span> + </div> <div class="middle"> <div class="text"> C4DI </div> </div> @@ -54,7 +78,15 @@ <li> <div class="container"> <img src="https://dogpatchlabs.wpenginepowered.com/wp-content/uploads/2022/09/ian_browne.jpg" class="image" > - + <h2> Dogpatch </h2> + <p>hhhhhhhhhhhhhhhhhhhhhhhhhhh</p> + <div class= star> + <span class="fa fa-star fa-3x checked" ></span> + <span class="fa fa-star fa-3x checked"></span> + <span class="fa fa-star fa-3x checked"></span> + <span class="fa fa-star fa-3x" ></span> + <span class="fa fa-star fa-3x" ></span> + </div> <div class="middle"> <div class="text"> Dogpatch </div> </div> @@ -64,7 +96,15 @@ <li> <div class="container"> <img src="https://stationf.co/img/misc/create-zone.jpg" class="image" > - + <h2>Station F </h2> + <p>hhhhhhhhhhhhhhhhhhhhhhhhhhh</p> + <div class= star> + <span class="fa fa-star fa-3x checked" ></span> + <span class="fa fa-star fa-3x checked"></span> + <span class="fa fa-star fa-3x checked"></span> + <span class="fa fa-star fa-3x" ></span> + <span class="fa fa-star fa-3x" ></span> + </div> <div class="middle"> <div class="text"> Station F </div> </div> @@ -72,8 +112,9 @@ </li> </ul> </div> - </section> + <footer> + </footer> <script src="JS/locations.js"> </script> </body> diff --git a/static/locations.js b/static/locations.js new file mode 100644 index 0000000000000000000000000000000000000000..9c8f709c829af97b94a5173614f0c524d7515fc6 --- /dev/null +++ b/static/locations.js @@ -0,0 +1,10 @@ +let btn = document.querySelector("button"); +let nav = document.querySelector("nav"); + + +btn.addEventListener("click", function() { + + nav.classList.toggle("active"); + btn.classList.toggle("active"); + + } ); diff --git a/static/login.html b/static/login.html index 5bbe1b72a5529fc7b8b0ff4c1c3fa16cd0b44f59..13bc712b4c83accd4c0254e264936b76a622d64c 100644 --- a/static/login.html +++ b/static/login.html @@ -20,29 +20,29 @@ <title>Login</title> <div id="card" class="card text-dark w-25 text-center"> <div class="card-body text-center"> - + <form> <!-- Email input --> <div class="form-outline mb-4"> -<<<<<<< HEAD + <input type="email" id="recordEmail" class="form-control" /> -======= + <input type="email" id="form2Example1" class="form-control" /> ->>>>>>> 9c7255d510762a8f16afeba2657cad4a0f8b8239 + <label class="form-label" for="form2Example1">Email address</label> </div> - + <!-- Password input --> <div class="form-outline mb-4"> -<<<<<<< HEAD + <input type="password" id="recordPassword" class="form-control" /> -======= + <input type="password" id="form2Example2" class="form-control" /> ->>>>>>> 9c7255d510762a8f16afeba2657cad4a0f8b8239 + <label class="form-label" for="form2Example2">Password</label> </div> - + <!-- 2 column grid layout for inline styling --> <div class="row mb-4"> <div class="col d-flex justify-content-center"> @@ -52,12 +52,12 @@ <label class="form-check-label" for="form2Example31"> Remember me </label> </div> </div> - + <div class="col"> <!-- Simple link --> <a href="#!">Forgot password?</a> </div> - + <!-- Submit button --> <button onclick="window.location.href='landingpage.html';" type="button" class="btn btn-light"> <span class="spinner-grow spinner-grow-sm"></span> @@ -68,8 +68,7 @@ <p>Not a member? <a href="#!">Register</a></p> </form> </body> -<<<<<<< HEAD + </html> -======= + </html> ->>>>>>> 9c7255d510762a8f16afeba2657cad4a0f8b8239 diff --git a/templates/ListLocations.html b/templates/ListLocations.html new file mode 100644 index 0000000000000000000000000000000000000000..e7d8052ea108762a80595592c2c729a4ea8ad93d --- /dev/null +++ b/templates/ListLocations.html @@ -0,0 +1,26 @@ +{%extends "base_template.html"%} + +{%block headblock%} + <title> Locations </title> +{%endblock%} + +{%block headerblock%} + <a id="headerText" + href="ListLocations"> + Locations</a> +{%endblock%} + +{%block mainblock%} +<br><br> +{%if data%} + {%for x in range(data|length)%} + {{data[x][0]}} + {{data[x][1]}} + <br><br> + {%endfor%} +{%endif%} + +{%endblock%} + +{%block jsblock%} +{%endblock%} diff --git a/templates/OneLocation.html b/templates/OneLocation.html new file mode 100644 index 0000000000000000000000000000000000000000..0f02369fcb435ae0c335dba8e1d9c8f90ba46647 --- /dev/null +++ b/templates/OneLocation.html @@ -0,0 +1,11 @@ +{%extends "base_template.html"%} +{%block mainblock%} +{% with messages = get_flashed_messages() %} + {% if messages %} + {% for msg in messages %} + <p>{{msg}}</p> + {% endfor %} + {% endif %} + {% endwith %} + <p> {{OneLocation}} </p> +{%endblock%} diff --git a/templates/locations.html b/templates/locations.html new file mode 100644 index 0000000000000000000000000000000000000000..8ba0d77825cdafb04870b30bd799207d0a8711f8 --- /dev/null +++ b/templates/locations.html @@ -0,0 +1,13 @@ +{%extends "base_template.html"%} +{%block mainblock%} + <form action="#" method='POST'> + <p>Location's name </p> + <p><input type='text' name='name' id='locationsName'/></p> + {%if data%} + {{data[2][1]}} <b> + {%endif%} + <p>Add the URL of the picture of your location</p> + <p><input type='text' name='image' id='locationsImage' /></p> + <p><input type='submit' value='submit' /></p> + </form> +{%endblock%} diff --git a/templates/test.html b/templates/test.html index 1a4bf463bb740559d292fedbe9529176cd2c941e..f3b8a8a5e298a05d44dabb69099e65e307bc6e3f 100644 --- a/templates/test.html +++ b/templates/test.html @@ -1,4 +1,4 @@ -{%extends "base_template.html"%} +{% extends "base_template.html"%} {%block mainblock%} test {%endblock%}