Skip to content
Snippets Groups Projects
Commit 58ae56da authored by Liam Driscoll's avatar Liam Driscoll
Browse files

Trying stuff.

parents f5862f16 062fdd24
No related branches found
No related tags found
1 merge request!23ARIANNE'S WORK "As a user I want to find out what Tramshed is so that I can access their working spaces"
Database Files
*.db
Coworking_Spaces.db
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.")
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
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)
<!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>
// 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);
}
<html>
<head><link rel="stylesheet" href="landingstyle.css"></head>
<header>
<title>Tramshed Tech</title>
<img src="logo.jpg"/><br><br><br><br>
</header>
<body>
<img src="title.png"/>
<button id= "ViewLocations" type="ViewLocations" href="locations.html">View Locations</button>
</body>
</html>
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: absolute;
margin: inherit;
display: inline-block;
line-height: 20px;
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;
cursor: pointer;
}
body{
display: block;
}
body{
background-color: white;
color: black;
}
.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: center;
list-style-type: none;
margin-left: 350px;
}
h1 {
color: white;
background-color: black;
font-weight: 600;
font-family: 'Monospace', Lucida-Console;
position: relative;
font-size: 36px;
display: flex;
margin-right: 650px;
margin: 1em 0 1em 0;
line-height: 110px;
padding: 15px 15px 15px 3%;
border-radius: 10px 10px 10px 10px;
}
.logo{
width: 8%;
height: 8%
border: 0;
float: left;
display: flex;
margin: 10px 10px;
}
button{
width: 40px;
height: 30px;
background-color: black;
border: none;
outline: none;
border-radius: 4px;
padding: 4px;
position: fixed;
top: 65px;
right: 20px;
cursor: pointer;
transition: 0.4s ease-in-out;
}
button.active{
transform: translateX(-210px);
}
button span {
display: block;
width: 100%;
height: 4px;
background-color: white;
}
button span:nth-child(2) {
margin: 5px 0;
}
nav{
background-color: black;
padding: 15px;
height: 100vh;
position: fixed;
top: 0;
right: 0;
width: 200px;
transform: translateX(100%);
margin-top: 0.5em;
border-radius: 10px;
transition: 0.4s ease-in-out;
}
nav.active {
transform: translateX(0);
}
nav ul{
list-style: none;
margin: 0;
padding:0;
width: 60px;
}
nav ul li{
padding: 10px 0;
}
nav ul li a{
color: white;
text-decoration: none;
display: block;
}
nav ul li a:hover {
color: white;
JScript/locations.js 0 100644
+
10
-
0
Viewed
let btn = document.querySelector("button");
let nav = document.querySelector("nav");
btn.addEventListener("click", function() {
nav.classList.toggle("active");
btn.classList.toggle("active");
} );
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href= "css/locations.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>
<button>
<span></span>
<span></span>
<span></span>
</button>
<nav>
<ul>
<li><a href="#"> Home </a></il>
<li><a href="#"> ### </a></il>
<li><a href="#"> ### </a></il>
</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" >
<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" >
</li>
</ul>
</div>
</section>
<script src="C:\Users\c22086220\OneDrive - Cardiff University\Desktop\our locations\JScript\locations.js"> </script>
</body>
let btn = document.querySelector("button");
let nav = document.querySelector("nav");
btn.addEventListener("click", function() {
nav.classList.toggle("active");
btn.classList.toggle("active");
} );
static/logo.jpg

21.6 KiB

static/title.png

6.03 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment