Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions controllers/apiController.js
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
3 changes: 3 additions & 0 deletions controllers/eventController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
Expand All @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion models/event.js
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
31 changes: 18 additions & 13 deletions public/scripts/app.js
Original file line number Diff line number Diff line change
@@ -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!');
Expand Down Expand Up @@ -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'), {
Expand Down
5 changes: 1 addition & 4 deletions public/styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ header {
}

/*#eek {
z-index: 9999;
position: fixed;
width: 100%;
background-color: white;
get rid of unused stuff
}*/

nav {
Expand Down
Loading