Search Events by Date
- -- -
-
-
Search Events by Date
+ ++ +
+ + +
+
diff --git a/controllers/apiController.js b/controllers/apiController.js index c4019b2..0291468 100644 --- a/controllers/apiController.js +++ b/controllers/apiController.js @@ -1,4 +1,5 @@ function index(req, res) { + //excellent documentation and style res.json({ message: 'Welcome to TechSpace! Your main hub for local tech events', documentation_url: 'https://github.com/mwiley322/Project1-EventApp', diff --git a/controllers/eventController.js b/controllers/eventController.js index 1399914..f0e2e7e 100644 --- a/controllers/eventController.js +++ b/controllers/eventController.js @@ -24,6 +24,7 @@ function show(req, res) { // GET /api/searchKeyword function searchKeyword(req, res) { var searchQuery = req.query.keyword; + //remove console logs after pushing console.log("WE ARE IN SEARCHKEYWORD FUNCTION", searchQuery); db.Event.find({keywords: searchQuery}, function(err, matchedEvents){ if (err) @@ -35,6 +36,7 @@ function searchKeyword(req, res) { }); } +//AWESOME function searchDate(req, res) { var searchQuery = req._parsedOriginalUrl.query; console.log("WE ARE IN SEARCHDATE FUNCTION", searchQuery); @@ -58,6 +60,7 @@ function create(req, res) { }); }//closes create function +//these aren't currently used, will maybe be used for users // PUT /api/events/:id function update(req, res) { console.log('event update: ', req.params); diff --git a/models/event.js b/models/event.js index bf68377..2aef74d 100644 --- a/models/event.js +++ b/models/event.js @@ -1,6 +1,8 @@ var mongoose = require('mongoose'); var Schema = mongoose.Schema; +//challenge: in real-world applications, you can prevent people from upvoting +//multiple times on a single event using sessions/cookies var EventSchema = new Schema ({ eventName: String, //req description: String, //req @@ -11,7 +13,7 @@ var EventSchema = new Schema ({ externalResource: { type: String, default: '' }, posterEmail: String, keywords: [ String ], //searchable . required. - imageUrl: { type: String, default: 'images/NoImageFound.jpg' } + imageUrl: { type: String, default: 'images/NoImageFound.jpg' }//nice }); //our model to create events diff --git a/public/scripts/app.js b/public/scripts/app.js index aaa36bb..fc4a202 100644 --- a/public/scripts/app.js +++ b/public/scripts/app.js @@ -1,17 +1,4 @@ console.log('app.js is loaded!'); -var myTags = []; -var availableTags = [ - "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran","functions","HTML","CSS","WebGL","Bubble sort", - "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Picnic", "Beer", "Party", "Lecture", "Education", - "Meetup", "Formal", "MEAN","React","JS", "Full stack", "Interview","Algorithms","Front-end","Back-end", "Database", - "Web design","Graphic design","Design","LinkedIn","Resume","Computer science","Ruby", "Open bar", "La Croix","Rails", - "MongoDB","Networking","Mongoose","Job fair","Coding","General Assembly","Whiteboard","Hangout","Social","Brand","WDI 36", - "Web development","C+","Handlebars","SASS","Beginners","Intermediate","Advanced","Python","Ruby","Scala","Scheme", - "Hack Reactor", "ES6","Node.js", "Express", "Knitting", "Skydiving", "dogs", "cats", "Other", "Veterans", "Github", - "Hackathon", "Dating", "iOS Development", "UX", "UI", "Photoshop", "Adobe", "SQL", "Mentor", "Robotics", "Rocket science", - "Science", "Startup", "Agile Development", "International", "Soylent", "Exercise", "Beards", "Ponies JS", "Datepicker" -]; -var $searchForm; $(document).ready(function() { console.log('dom is loaded!'); @@ -84,6 +71,24 @@ $(document).ready(function() { }); //closes DOM ready function +//maybe consider making a separate file for constants to cut down on file size +var myTags = []; +var availableTags = [ + "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran","functions","HTML","CSS","WebGL","Bubble sort", + "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Picnic", "Beer", "Party", "Lecture", "Education", + "Meetup", "Formal", "MEAN","React","JS", "Full stack", "Interview","Algorithms","Front-end","Back-end", "Database", + "Web design","Graphic design","Design","LinkedIn","Resume","Computer science","Ruby", "Open bar", "La Croix","Rails", + "MongoDB","Networking","Mongoose","Job fair","Coding","General Assembly","Whiteboard","Hangout","Social","Brand","WDI 36", + "Web development","C+","Handlebars","SASS","Beginners","Intermediate","Advanced","Python","Ruby","Scala","Scheme", + "Hack Reactor", "ES6","Node.js", "Express", "Knitting", "Skydiving<3", "dogs", "cats", "Other", "Veterans", "Github", + "Hackathon", "Dating", "iOS Development", "UX", "UI", "Photoshop", "Adobe", "SQL", "Mentor", "Robotics", "Rocket science", + "Science", "Startup", "Agile Development", "International", "Soylent", "Exercise", "Beards", "Ponies JS", "Datepicker" +]; + +var $searchForm; +//this is great +//mini map for each event with lat and long visible +//https://www.google.com/maps/place/General+Assembly+San+Francisco/@37.7908769,-122.4034853,17z/data=!3m1!4b1!4m5!3m4!1s0x80858089e0535dc1:0x712e622328a7c068!8m2!3d37.7908727!4d-122.4012966 function initMap() { var myLatLng = {lat: 37.7749295, lng: -122.4194155}; var map = new google.maps.Map(document.getElementById('map'), { diff --git a/public/styles/styles.css b/public/styles/styles.css index ce5ecad..e9fd800 100644 --- a/public/styles/styles.css +++ b/public/styles/styles.css @@ -13,10 +13,7 @@ header { } /*#eek { - z-index: 9999; - position: fixed; - width: 100%; - background-color: white; +get rid of unused stuff }*/ nav { diff --git a/views/index.html b/views/index.html index b745960..361b640 100644 --- a/views/index.html +++ b/views/index.html @@ -1,153 +1,155 @@ -
- - -