diff --git a/.gitignore b/.gitignore index 85a1e04..0f37e42 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ express-app/node_modules express-app/secrets .vscode/launch.json .vscode/settings.json +express-app/.vscode/launch.json diff --git a/express-app/package-lock.json b/express-app/package-lock.json index d211e62..87e4c17 100644 --- a/express-app/package-lock.json +++ b/express-app/package-lock.json @@ -491,9 +491,9 @@ } }, "acorn": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=" + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", + "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==" }, "acorn-globals": { "version": "3.1.0", @@ -4559,6 +4559,13 @@ "requires": { "acorn": "^3.1.0", "acorn-globals": "^3.0.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=" + } } }, "word-wrap": { diff --git a/express-app/package.json b/express-app/package.json index 1fb09a3..b88ccee 100644 --- a/express-app/package.json +++ b/express-app/package.json @@ -7,6 +7,7 @@ "devstart": "nodemon -e js,mjs,json ./bin/www" }, "dependencies": { + "acorn": "^7.1.0", "cookie-parser": "~1.4.4", "debug": "~2.6.9", "express": "~4.16.1", diff --git a/express-app/public/stylesheets/donation-board.css b/express-app/public/stylesheets/donation-board.css index 0a3da9c..98003a9 100644 --- a/express-app/public/stylesheets/donation-board.css +++ b/express-app/public/stylesheets/donation-board.css @@ -1,8 +1,36 @@ div.card-deck { - display: grid; - grid-template-columns: auto; + display: grid; + grid-template-columns: auto; } div.card-deck div.card { - margin: 25px 0 25px; + margin: 25px 0 25px; } + +.text-center { + border-color: deepskyblue; + border-width: 4px; + color: #fd3ca4; + background-color: midnightblue; + text-align: center; + margin-bottom: 2%; + font-size: large; +} + +.card-header { + border-color: deepskyblue; + border-width: 4px; + font-size: xx-large; +} + +body > div.container > div > * > ul { + font-size: x-large; +} + +body > div.container > div > * > div > form > button { + font-size: x-large; +} + +body > div.container > div > * > div > button { + font-size: x-large; +} \ No newline at end of file diff --git a/express-app/public/stylesheets/donation-form.css b/express-app/public/stylesheets/donation-form.css index 7a66959..f6cf24e 100644 --- a/express-app/public/stylesheets/donation-form.css +++ b/express-app/public/stylesheets/donation-form.css @@ -1,21 +1,63 @@ #labels { - color: deeppink; + color: #fd3ca4; + font-size: x-large; } -#label-border { - border-color: deepskyblue; - border-width: 4px; -} - -#expiration-date { +.form-control { border-color: deepskyblue; border-width: 4px; } #publish-button { - font-size: auto; - color: deeppink; + font-size: x-large; + color: #fd3ca4; background-color: midnightblue; border-width: 4px; border-color: deepskyblue; } + +#food_item { + font-size: x-large; +} + +#amount { + font-size: x-large; +} + +#meeting_point { + font-size: x-large; +} + +#pickup_date { + font-size: x-large; +} + +#expiration_date { + font-size: x-large; +} + +/* https://stackoverflow.com/questions/48293920/change-bootstrap-4-checkbox-size? */ + +.custom-control-label::before, +.custom-control-label::after { + top: 0.8rem; + width: 1.25rem; + height: 1.25rem; +} + +.custom-control-lg .custom-control-label { + margin-left: 0.5rem !important; + font-size: xx-large; +} + +body + > div.container + > form + > div + > * + > div.custom-control.form-control-lg.custom-checkbox + > label { + padding-top: 2px; + padding-left: 10px; + font-size: x-large; +} diff --git a/express-app/public/stylesheets/login.css b/express-app/public/stylesheets/login.css index 07bb379..c44664e 100644 --- a/express-app/public/stylesheets/login.css +++ b/express-app/public/stylesheets/login.css @@ -10,16 +10,18 @@ margin-bottom: 2%; } -#login-email{ +#login-email { border-color: deepskyblue; border-width: 4px; width: 100%; + font-size: x-large; } -#login-password{ +#login-password { border-color: deepskyblue; border-width: 4px; width: 100%; + font-size: x-large; } #card { @@ -34,8 +36,12 @@ #card_header { border-color: deepskyblue; border-width: 4px; - color: deeppink; + color: #fd3ca4; background-color: midnightblue; text-align: center; margin-bottom: 2%; } + +body { + font-size: x-large; +} diff --git a/express-app/public/stylesheets/my-donations.css b/express-app/public/stylesheets/my-donations.css index 5313042..08740f6 100644 --- a/express-app/public/stylesheets/my-donations.css +++ b/express-app/public/stylesheets/my-donations.css @@ -1,3 +1,13 @@ +.text-center { + border-color: deepskyblue; + border-width: 4px; + color: #fd3ca4; + background-color: midnightblue; + text-align: center; + margin-bottom: 2%; + font-size: large; +} + div.card-deck { display: grid; grid-template-columns: auto; @@ -7,7 +17,25 @@ div.card-deck div.card { margin: 25px 0 25px; } +.card-header { + border-color: deepskyblue; + border-width: 4px; + font-size: xx-large; +} + div.card-deck div.card div.card-footer { display: grid; grid-template-columns: auto auto; } + +body > div.container > div > * > ul { + font-size: x-large; +} + +body > div.container > div > div > div > * > button { + font-size: x-large; +} + +body>div.container > div > div > div > * > button { + font-size: x-large; +} diff --git a/express-app/public/stylesheets/my-requests.css b/express-app/public/stylesheets/my-requests.css index 5313042..08740f6 100644 --- a/express-app/public/stylesheets/my-requests.css +++ b/express-app/public/stylesheets/my-requests.css @@ -1,3 +1,13 @@ +.text-center { + border-color: deepskyblue; + border-width: 4px; + color: #fd3ca4; + background-color: midnightblue; + text-align: center; + margin-bottom: 2%; + font-size: large; +} + div.card-deck { display: grid; grid-template-columns: auto; @@ -7,7 +17,25 @@ div.card-deck div.card { margin: 25px 0 25px; } +.card-header { + border-color: deepskyblue; + border-width: 4px; + font-size: xx-large; +} + div.card-deck div.card div.card-footer { display: grid; grid-template-columns: auto auto; } + +body > div.container > div > * > ul { + font-size: x-large; +} + +body > div.container > div > div > div > * > button { + font-size: x-large; +} + +body>div.container > div > div > div > * > button { + font-size: x-large; +} diff --git a/express-app/public/stylesheets/navbar.css b/express-app/public/stylesheets/navbar.css index 303b305..0e0bb7b 100644 --- a/express-app/public/stylesheets/navbar.css +++ b/express-app/public/stylesheets/navbar.css @@ -1,9 +1,17 @@ /* Foodshare */ #brand { - color: deeppink; + color: #fd3ca4; + font-size: xx-large; } /* Navbar links */ #navbarSupportedContent > ul > li > a { - color: deeppink; + color: #fd3ca4; + font-size: x-large; + margin-right: 25px; +} + +#login_register_button { + color: #fd3ca4; + font-size: x-large; } diff --git a/express-app/public/stylesheets/register.css b/express-app/public/stylesheets/register.css index 84b721c..f28031c 100644 --- a/express-app/public/stylesheets/register.css +++ b/express-app/public/stylesheets/register.css @@ -14,18 +14,22 @@ border-color: deepskyblue; border-width: 4px; width: 100%; + font-size: x-large; } #register-email{ border-color: deepskyblue; border-width: 4px; width: 100%; + font-size: x-large; } #register-password{ border-color: deepskyblue; border-width: 4px; width: 100%; + font-size: x-large; + } #card { @@ -40,8 +44,12 @@ #card_header { border-color: deepskyblue; border-width: 4px; - color: deeppink; + color: #fd3ca4; background-color: midnightblue; text-align: center; margin-bottom: 2%; +} + +body { + font-size: x-large; } \ No newline at end of file diff --git a/express-app/public/stylesheets/style.css b/express-app/public/stylesheets/style.css index 5f66a9c..5f01a5d 100644 --- a/express-app/public/stylesheets/style.css +++ b/express-app/public/stylesheets/style.css @@ -1,11 +1,13 @@ -html { - font-size: 18px; - font-family: "Oswald", sans-serif; +html, body { + background-color: '#F7EBE8' +} + +body { + font-family: 'Oswald', sans-serif !important; } h1 { - color: deeppink; - font-size: 25px; + color: #fd3ca4; padding-top: 1%; } @@ -14,3 +16,8 @@ h1 { padding: 0px; margin-bottom: 25px; } + +.jumbotron { + text-align: center; + background-color: #191970; +} diff --git a/express-app/routes/donation-board.js b/express-app/routes/donation-board.js index 9bd06d6..deab573 100644 --- a/express-app/routes/donation-board.js +++ b/express-app/routes/donation-board.js @@ -19,8 +19,9 @@ router.use(async (req, res, next) => { let currentDate = new Date(Date.now()); let expiration_date = donation.expiration_date.toDate(); + let pickup_date = donation.pickup_date.toDate(); - if (expiration_date < currentDate) { + if (expiration_date < currentDate || pickup_date < currentDate) { database .collection('donations') .doc(donation_id) diff --git a/express-app/routes/login.js b/express-app/routes/login.js index 2fd342e..41e7c0d 100644 --- a/express-app/routes/login.js +++ b/express-app/routes/login.js @@ -18,7 +18,7 @@ router.post('/', async (req, res) => { res.render('login', { errorMessage: error }); }); - res.redirect('/'); + res.redirect('/donation-map'); }); module.exports = router; diff --git a/express-app/routes/my-donations.js b/express-app/routes/my-donations.js index 432eaa0..655c98f 100644 --- a/express-app/routes/my-donations.js +++ b/express-app/routes/my-donations.js @@ -19,8 +19,9 @@ router.use(async (req, res, next) => { let currentDate = new Date(Date.now()); let expiration_date = donation.expiration_date.toDate(); + let pickup_date = donation.pickup_date.toDate(); - if (expiration_date < currentDate) { + if (expiration_date < currentDate || pickup_date < currentDate) { database .collection('donations') .doc(donation_id) diff --git a/express-app/routes/my-requests.js b/express-app/routes/my-requests.js index f8a6325..b4a2b1a 100644 --- a/express-app/routes/my-requests.js +++ b/express-app/routes/my-requests.js @@ -19,8 +19,9 @@ router.use(async (req, res, next) => { let currentDate = new Date(Date.now()); let expiration_date = donation.expiration_date.toDate(); + let pickup_date = donation.pickup_date.toDate(); - if (expiration_date < currentDate) { + if (expiration_date < currentDate || pickup_date < currentDate) { database .collection('donations') .doc(donation_id) @@ -141,7 +142,7 @@ router.post('/hide', (req, res) => { unsubscribe(); }); -/* POST my-requests page, cancelling a request, redirecting to my-requests */ +/* POST my-requests page, cancelling a request, redirecting to donation-board */ router.post('/cancel', (req, res) => { let unsubscribe = firebase.auth().onAuthStateChanged(async user => { if (!user) { @@ -162,7 +163,7 @@ router.post('/cancel', (req, res) => { res.render('index', { user: user, errorMessage: error }); } - res.redirect('/my-requests'); + res.redirect('/donation-board'); } }); diff --git a/express-app/views/donation-board.pug b/express-app/views/donation-board.pug index 4c530b8..42f5235 100644 --- a/express-app/views/donation-board.pug +++ b/express-app/views/donation-board.pug @@ -7,7 +7,6 @@ block content else include partials/navbar-unauthenticated div(class="container") - h1 Listings: div(class="card-deck") each donation in donations div(class="card text-center") diff --git a/express-app/views/donation-form.pug b/express-app/views/donation-form.pug index cada53d..73d3c13 100644 --- a/express-app/views/donation-form.pug +++ b/express-app/views/donation-form.pug @@ -4,7 +4,7 @@ block content link(rel="stylesheet" href="/stylesheets/donation-form.css") include partials/navbar-authenticated div(class="container") - h1 Create a Listing: + h1 Create a Listing br include partials/error-message form(action="/donation-form" method="POST") @@ -29,21 +29,21 @@ block content label(for="expiration_date" id="labels") Expiration Date input(class="form-control" type="datetime-local" name="expiration_date" value="" id="expiration_date" required) label(id="labels") Food Lifestyle - div(class="form-check") - input(type="checkbox" class="form-check-input" name="halal" value="true" id="halal") - label(class="form-check-label" for="halal" ) Halal - div(class="form-check") - input(type="checkbox" class="form-check-input" name="kosher" value="true" id="kosher") - label(class="form-check-label" for="kosher" ) Kosher - div(class="form-check") - input(type="checkbox" class="form-check-input" name="pescatarian" value="true" id="pescatarian") - label(class="form-check-label" for="pescatarian" ) Pescatarian - div(class="form-check") - input(type="checkbox" class="form-check-input" name="vegan" value="true" id="vegan") - label(class="form-check-label" for="vegan" ) Vegan - div(class="form-check") - input(type="checkbox" class="form-check-input" name="vegetarian" value="true" id="vegetarian") - label(class="form-check-label" for="vegetarian") Vegetarian + div(class="custom-control form-control-lg custom-checkbox") + input(type="checkbox" class="custom-control-input" name="halal" value="true" id="halal") + label(class="custom-control-label" for="halal" ) Halal + div(class="custom-control form-control-lg custom-checkbox") + input(type="checkbox" class="custom-control-input" name="kosher" value="true" id="kosher") + label(class="custom-control-label" for="kosher" ) Kosher + div(class="custom-control form-control-lg custom-checkbox") + input(type="checkbox" class="custom-control-input" name="pescatarian" value="true" id="pescatarian") + label(class="custom-control-label" for="pescatarian" ) Pescatarian + div(class="custom-control form-control-lg custom-checkbox") + input(type="checkbox" class="custom-control-input" name="vegan" value="true" id="vegan") + label(class="custom-control-label" for="vegan" ) Vegan + div(class="custom-control form-control-lg custom-checkbox") + input(type="checkbox" class="custom-control-input" name="vegetarian" value="true" id="vegetarian") + label(class="custom-control-label" for="vegetarian") Vegetarian button(type="submit" class="btn btn-primary float-right" id="publish-button") Publish script. diff --git a/express-app/views/donation-map.pug b/express-app/views/donation-map.pug index 67d31fc..2ff9612 100644 --- a/express-app/views/donation-map.pug +++ b/express-app/views/donation-map.pug @@ -4,31 +4,33 @@ block content link(rel="stylesheet" href="/stylesheets/donation-map.css") if user include partials/navbar-authenticated - style. - html, body, #map { - height: calc(100% - 30px); - width: 100%; - } - body - #map - else include partials/navbar-unauthenticated - div(class="container") - style. - html, body, #map { - height: calc(100% - 30px); - width: 100%; - } - body - #map + + style. + html, body, #map { + height: 100%; + width: 100%; + overflow: hidden; + } + + #map { + left: 0; + position: absolute; + padding: 0px; + margin: 0px; + top: 64px; + left: 0px; + } + body + #map script(src="https://www.gstatic.com/firebasejs/7.5.0/firebase-app.js") script(src="https://www.gstatic.com/firebasejs/7.5.0/firebase-firestore.js") script. - var map; - var firebaseConfig = { + let map; + let firebaseConfig = { apiKey: "AIzaSyCEV6HqDHYuIM1eAGrUw3tGAfIV-l4d88Y", authDomain: "foodshare-d3eee.firebaseapp.com", databaseURL: "https://foodshare-d3eee.firebaseio.com", @@ -45,64 +47,320 @@ block content map = new google.maps.Map(document.getElementById('map'), { center: {lat: 37.3351874, lng: -121.88107150000002}, zoom: 17, - styles: [{ - featureType: 'poi', - stylers: [{ visibility: 'off' }] // Turn off POI. - }, - { - featureType: 'transit.station', - stylers: [{ visibility: 'off' }] // Turn off bus, train stations etc. - }], - disableDoubleClickZoom: true, + disableDefaultUI: true, + styles: + [ + { + "elementType": "geometry", + "stylers": [ + { + "color": "#1d2c4d" + } + ] + }, + { + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#8ec3b9" + } + ] + }, + { + "elementType": "labels.text.stroke", + "stylers": [ + { + "color": "#1a3646" + } + ] + }, + { + "featureType": "administrative.country", + "elementType": "geometry.stroke", + "stylers": [ + { + "color": "#4b6878" + } + ] + }, + { + "featureType": "administrative.land_parcel", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#64779e" + } + ] + }, + { + "featureType": "administrative.province", + "elementType": "geometry.stroke", + "stylers": [ + { + "color": "#4b6878" + } + ] + }, + { + "featureType": "landscape.man_made", + "elementType": "geometry.stroke", + "stylers": [ + { + "color": "#334e87" + } + ] + }, + { + "featureType": "landscape.natural", + "elementType": "geometry", + "stylers": [ + { + "color": "#023e58" + } + ] + }, + { + "featureType": "poi", + "elementType": "geometry", + "stylers": [ + { + "color": "#283d6a" + } + ] + }, + { + "featureType": "poi", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#6f9ba5" + } + ] + }, + { + "featureType": "poi", + "elementType": "labels.text.stroke", + "stylers": [ + { + "color": "#1d2c4d" + } + ] + }, + { + "featureType": "poi.business", + "stylers": [ + { + "visibility": "off" + } + ] + }, + { + "featureType": "poi.park", + "elementType": "geometry.fill", + "stylers": [ + { + "color": "#023e58" + } + ] + }, + { + "featureType": "poi.park", + "elementType": "labels.text", + "stylers": [ + { + "visibility": "off" + } + ] + }, + { + "featureType": "poi.park", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#3C7680" + } + ] + }, + { + "featureType": "road", + "elementType": "geometry", + "stylers": [ + { + "color": "#304a7d" + } + ] + }, + { + "featureType": "road", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#98a5be" + } + ] + }, + { + "featureType": "road", + "elementType": "labels.text.stroke", + "stylers": [ + { + "color": "#1d2c4d" + } + ] + }, + { + "featureType": "road.highway", + "elementType": "geometry", + "stylers": [ + { + "color": "#2c660" + } + ] + }, + { + "featureType": "road.highway", + "elementType": "geometry.stroke", + "stylers": [ + { + "color": "#255763" + } + ] + }, + { + "featureType": "road.highway", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#b0d5ce" + } + ] + }, + { + "featureType": "road.highway", + "elementType": "labels.text.stroke", + "stylers": [ + { + "color": "#023e58" + } + ] + }, + { + "featureType": "transit", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#98a5be" + } + ] + }, + { + "featureType": "transit", + "elementType": "labels.text.stroke", + "stylers": [ + { + "color": "#1d2c4d" + } + ] + }, + { + "featureType": "transit.line", + "elementType": "geometry.fill", + "stylers": [ + { + "color": "#283d6a" + } + ] + }, + { + "featureType": "transit.station", + "elementType": "geometry", + "stylers": [ + { + "color": "#3a4762" + } + ] + }, + { + "featureType": "water", + "elementType": "geometry", + "stylers": [ + { + "color": "#0e1626" + } + ] + }, + { + "featureType": "water", + "elementType": "labels.text.fill", + "stylers": [ + { + "color": "#4e6d70" + } + ] + } + ], streetViewControl: false, }); - firebase.firestore().collection('donations').get() + firebase + .firestore() + .collection('donations') + .get() .then(snapshot => { donations = snapshot.docs.map(document => { - let donation = document.data(); - donation.id = document.id; - - if(!donation.expired){ - var allergyInfo = ""; - if(donation.halal) allergyInfo += "Halal " - if(donation.kosher) allergyInfo += "Kosher " - if(donation.pescatarian) allergyInfo += "Pescatarian " - if(donation.vegan) allergyInfo += "Vegan " - if(donation.vegetarian) allergyInfo += "Vegetarian " - - var contentString = '
'+ - '
'+ - '
'+ - '

' + donation.food_item + '

'+ - '
'+ - '

Amount: ' + donation.amount + '
'+ - 'Additional Info: ' + allergyInfo + '
'+ - 'Location: ' + donation.meeting_point + '
'+ - 'Donated by: ' + donation.donator + '
'+ - 'Pickup Date: ' + donation.pickup_date.toDate().toLocaleString() + '
'+ - 'Expiration Date: ' + donation.expiration_date.toDate().toLocaleString() + '

'+ - '
'+ - '
'; - - var infowindow = new google.maps.InfoWindow({ - content: contentString - }); + let donation = document.data(); + donation.id = document.id; - var pos = {lat: donation.meeting_point_geopoint.latitude, lng: donation.meeting_point_geopoint.longitude}; - //console.log(pos.lat + " " + pos.lon); - var marker = new google.maps.Marker({ - position: pos, - map: map, - title: donation.food_item - }); - marker.addListener('click', function() { - infowindow.open(map, marker); + if (!donation.expired) { + let allergyInfo = ""; + if(donation.halal) allergyInfo += "Halal " + if(donation.kosher) allergyInfo += "Kosher " + if(donation.pescatarian) allergyInfo += "Pescatarian " + if(donation.vegan) allergyInfo += "Vegan " + if(donation.vegetarian) allergyInfo += "Vegetarian " + + let contentString = + "" + + '
'+ + '
'+ + '
'+ + '

' + donation.food_item + '

'+ + '
'+ + '

Amount: ' + donation.amount + '
'+ + 'Additional Info: ' + allergyInfo + '
'+ + 'Location: ' + donation.meeting_point + '
'+ + 'Donated by: ' + donation.donator + '
'+ + 'Pickup Date: ' + donation.pickup_date.toDate().toLocaleString() + '
'+ + 'Expiration Date: ' + donation.expiration_date.toDate().toLocaleString() + '

'+ + '
'+ + '
'; + + let infoWindow = new google.maps.InfoWindow({ + content: contentString + }); + + let pos = {lat: donation.meeting_point_geopoint.latitude, lng: donation.meeting_point_geopoint.longitude}; + + let marker = new google.maps.Marker({ + position: pos, + map: map, + title: donation.food_item + }); + + marker.addListener("mousedown", () => { + infoWindow.open(map, marker); + }); + + marker.addListener("mouseover", () => { + infoWindow.open(map, marker); + }); + + marker.addListener("mouseout", () => { + infoWindow.close(); + }); + } }); - } }); - }); - } + } - script(async, defer, src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCEV6HqDHYuIM1eAGrUw3tGAfIV-l4d88Y&callback=initMap" - type="text/javascript") \ No newline at end of file + script(async, defer, src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCEV6HqDHYuIM1eAGrUw3tGAfIV-l4d88Y&callback=initMap" type="text/javascript") \ No newline at end of file diff --git a/express-app/views/my-donations.pug b/express-app/views/my-donations.pug index a18c805..3244549 100644 --- a/express-app/views/my-donations.pug +++ b/express-app/views/my-donations.pug @@ -4,7 +4,10 @@ block content link(rel="stylesheet" href="/stylesheets/my-donations.css") include partials/navbar-authenticated div(class="container") - h1 Your Donations: + if donations.length !== 0 + h1 Your Donations: + else + h1 No Donations! div(class="card-deck") each donation in donations @@ -30,7 +33,7 @@ block content button(type="submit" class="btn btn-warning") Accept Request form(action="/my-donations/delete" method="POST") input(type="hidden" name="donation_id" value=donation.id) - button(type="submit" class="btn btn-danger") Delete Donation + button(type="submit" class="btn btn-danger" disabled) Delete Donation else if donation.request_accepted diff --git a/express-app/views/my-requests.pug b/express-app/views/my-requests.pug index 453c20b..491a18e 100644 --- a/express-app/views/my-requests.pug +++ b/express-app/views/my-requests.pug @@ -4,7 +4,10 @@ block content link(rel="stylesheet" href="/stylesheets/my-donations.css") include partials/navbar-authenticated div(class="container") - h1 Your Requests: + if donations.length !== 0 + h1 Your Requests: + else + h1 No Requests! div(class="card-deck") each donation in donations @@ -31,7 +34,7 @@ block content button(type="submit" class="btn btn-success") Request Accepted - Fulfill form(action="/my-requests/cancel" method="POST") input(type="hidden" name="donation_id" value=donation.id) - button(type="submit" class="btn btn-danger") Cancel Request + button(type="submit" class="btn btn-danger" disabled) Cancel Request else if donation.fulfilled_donatee diff --git a/express-app/views/partials/navbar-authenticated.pug b/express-app/views/partials/navbar-authenticated.pug index b3192c7..b827d43 100644 --- a/express-app/views/partials/navbar-authenticated.pug +++ b/express-app/views/partials/navbar-authenticated.pug @@ -1,19 +1,17 @@ link(rel="stylesheet" href="/stylesheets/navbar.css") div(class="container-fluid") div(class="navbar navbar-dark navbar-expand-xl" style="background-color: midnightblue") - a(class="nav_brand_a" href="/" id="brand") Foodshare + a(class="nav_brand_a" href="/" id="brand") foodshare button(class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation") span(class="navbar-toggler-icon") - div(class="collapse navbar-collapse" id="navbarSupportedContent") - ul(class="navbar-nav mr-auto") + div(class="collapse navbar-collapse justify-content-end" id="navbarSupportedContent") + ul(class="navbar-nav") li(class="nav-item") a(class="nav-link" href="./donation-map") Donation Map li(class="nav-item") a(class="nav-link" href="./donation-board") Donation Board li(class="nav-item") a(class="nav-link" href="./donation-form") Donate - li(class="nav-item") - a(class="nav-link" href="./profile" id="navbar_label") Profile li(class='nav-item') a(class='nav-link' href='./message-inbox') Inbox li(class="nav-item") diff --git a/express-app/views/partials/navbar-unauthenticated.pug b/express-app/views/partials/navbar-unauthenticated.pug index cfe6284..22488e9 100644 --- a/express-app/views/partials/navbar-unauthenticated.pug +++ b/express-app/views/partials/navbar-unauthenticated.pug @@ -1,10 +1,10 @@ link(rel="stylesheet" href="/stylesheets/navbar.css") div(class="container-fluid") div(class="navbar navbar-dark navbar-expand-xl" style="background-color: midnightblue") - a(class="nav_brand" href="/" id="brand") Foodshare + a(class="nav_brand" href="/" id="brand") foodshare button(class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation") span(class="navbar-toggler-icon") - div(class="collapse navbar-collapse" id="navbarSupportedContent") + div(class="collapse navbar-collapse justify-content-end" id="navbarSupportedContent") ul(class='navbar-nav') li(class='nav-item') a(class='nav-link' href='./donation-map') Donation Map