-
-
-
-
`
})
-export class EventFormComponent { }
\ No newline at end of file
+export class EventFormComponent {
+ form = new FormGroup({
+ title: new FormControl(),
+ location: new FormControl(),
+ link: new FormControl(),
+ eventDate: new FormControl(),
+ description: new FormControl(),
+ imgUrl: new FormControl(),
+ });
+ constructor(private _httpService: EvindService) {
+
+ }
+ postEvent() {
+ let eventToSend = {
+ title: this.form.value.title,
+ location: this.form.value.location,
+ link: this.form.value.link,
+ eventDate: this.form.value.eventDate,
+ description: this.form.value.description,
+ imgUrl: this.form.value.imgUrl
+ }
+ console.log(eventToSend);
+ this._httpService.postEvent(eventToSend).subscribe((res) => {
+ console.log('event posted');
+ })
+ }
+ }
\ No newline at end of file
diff --git a/client/event.service.ts b/client/event.service.ts
index 2873a8f..f0aaa30 100644
--- a/client/event.service.ts
+++ b/client/event.service.ts
@@ -7,9 +7,18 @@ import 'rxjs/add/operator/map';
export class EventService {
public eventsUrl = 'api/events'; // URL to web api
public events: any;
+ public profileUrl = 'profileInfo'; //URL to facebook api
+ public profile: any;
constructor(public http: Http) {
this.events = http.get(this.eventsUrl)
+ .map(response => response.json());
+
+ this.profile = http.get(this.profileUrl)
.map(response => response.json());
+
}
-}
\ No newline at end of file
+
+
+}
+
diff --git a/client/eview.component.js b/client/eview.component.js
new file mode 100644
index 0000000..f07dc62
--- /dev/null
+++ b/client/eview.component.js
@@ -0,0 +1,138 @@
+"use strict";
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+var __metadata = (this && this.__metadata) || function (k, v) {
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
+};
+const core_1 = require('@angular/core');
+const router_1 = require('@angular/router');
+const evind_service_1 = require('./evind.service');
+const event_service_1 = require('./event.service');
+// import { AttEvService } from './attendevent.service';
+// import { Http } from '@angular/http';
+// import { EventService } from './event.service';
+// import { ROUTER_DIRECTIVES } from '@angular/router';
+let EviewComponent = class EviewComponent {
+ constructor(route, _httpService, eventService) {
+ this.route = route;
+ this._httpService = _httpService;
+ this.eventService = eventService;
+ this.id = route.snapshot.params['id'];
+ this.showChatText = 'Go to event chat room';
+ this.showChat = false;
+ // this.eventName = this.getData.title;
+ // this.eventDate = 'Friday, September 29th, 2017 5:00PM';
+ // this.eventLocation = 'Operation Spark - 748 Camp St New Orleans, LA 70130';
+ // this.eventPict = 'https://i.imgur.com/2TBGE8r.jpg';
+ // this.eventLink = '';
+ // this.eventDesc = 'Team FuzzyLobster has been working all week to improve the nolaBored app, come see what they changed!';
+ // this.attending = ['Aaron', 'Jake', 'Violet'];
+ }
+ onTestGet(id) {
+ this._httpService.getEvent(id).subscribe(data => {
+ console.log(data);
+ this.getData = data;
+ this.eventName = data.title;
+ this.eventDate = data.eventDate;
+ this.eventPict = data.imgUrl;
+ this.eventLink = data.link;
+ this.eventDesc = data.description;
+ this.eventPostBy = data.author;
+ this.eventLocation = data.location;
+ this.attending = data.attending;
+ }, error => {
+ console.error(error);
+ }, () => {
+ console.log('GET request complete');
+ });
+ }
+ attEvent(user) {
+ this._httpService.attendEvent(user).subscribe(() => {
+ console.log('Successful POST request');
+ }, error => {
+ console.error(error);
+ }, () => {
+ console.log('Request complete');
+ });
+ }
+ translateIds() {
+ }
+ ngOnInit() {
+ this.onTestGet(this.id);
+ this.eventService.profile.subscribe(profile => {
+ this.userID = profile.facebook.id;
+ this.profile = profile;
+ this.name = profile.facebook.displayName;
+ this.image = profile.facebook.image;
+ }, error => {
+ console.error(error);
+ }, () => {
+ console.log('complete');
+ });
+ this.translateIds();
+ }
+ handleAttend() {
+ if (this.name) {
+ this.attEvent({ name: this.name, event: this.getData });
+ this.onTestGet(this.id);
+ }
+ }
+ toggleChat() {
+ if (this.showChat === true) {
+ this.showChat = false;
+ this.showChatText = 'Go to event chat room';
+ }
+ else {
+ this.showChat = true;
+ this.showChatText = 'Hide event chat room';
+ }
+ }
+};
+EviewComponent = __decorate([
+ core_1.Component({
+ selector: 'eview',
+ // directives: [ROUTER_DIRECTIVES],
+ providers: [evind_service_1.EvindService, event_service_1.EventService],
+ template: `
+
+
+
+
+
+ Date: {{eventDate}}
+ Location: {{eventLocation}}
+
+
{{eventDesc}}
+
Event Posted By: {{eventPostBy}}
+
+
People Attending this Event:
+
+
+
+
+
+
+
+
`
+ }),
+ __metadata('design:paramtypes', [router_1.ActivatedRoute, evind_service_1.EvindService, event_service_1.EventService])
+], EviewComponent);
+exports.EviewComponent = EviewComponent;
+//# sourceMappingURL=eview.component.js.map
\ No newline at end of file
diff --git a/client/eview.component.js.map b/client/eview.component.js.map
new file mode 100644
index 0000000..930cbf9
--- /dev/null
+++ b/client/eview.component.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"eview.component.js","sourceRoot":"","sources":["eview.component.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,uBAA0B,eAAe,CAAC,CAAA;AAC1C,yBAA+B,iBAAiB,CAAC,CAAA;AAEjD,gCAA6B,iBAAiB,CAAC,CAAA;AAC/C,gCAA6B,iBAAiB,CAAC,CAAA;AAC/C,wDAAwD;AAExD,wCAAwC;AACxC,kDAAkD;AAClD,uDAAuD;AA0CvD;IAmBE,YAAoB,KAAqB,EAAU,YAA0B,EAAS,YAA0B;QAA5F,UAAK,GAAL,KAAK,CAAgB;QAAU,iBAAY,GAAZ,YAAY,CAAc;QAAS,iBAAY,GAAZ,YAAY,CAAc;QAC9G,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,YAAY,GAAG,uBAAuB,CAAC;QAC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C7C,CAAC;IACH,CAAC;AACH,CAAC;AApID;IAAC,gBAAS,CAAC;QACT,QAAQ,EAAE,OAAO;QACjB,mCAAmC;QACnC,SAAS,EAAE,CAAC,4BAAY,EAAE,4BAAY,CAAC;QACvC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAiCJ;KACP,CAAC;;kBAAA;AAEW,sBAAc,iBA4F1B,CAAA"}
\ No newline at end of file
diff --git a/client/eview.component.ts b/client/eview.component.ts
new file mode 100644
index 0000000..8b4e631
--- /dev/null
+++ b/client/eview.component.ts
@@ -0,0 +1,214 @@
+import { Component } from '@angular/core';
+import { ActivatedRoute } from '@angular/router';
+import { Headers, Http } from '@angular/http';
+import { FormsModule, ReactiveFormsModule } from '@angular/forms';
+import { EvindService } from './evind.service';
+import { EventService } from './event.service';
+import { FormGroup } from '@angular/forms';
+import { FormControl } from '@angular/forms';
+
+@Component({
+ selector: 'eview',
+ // directives: [ROUTER_DIRECTIVES],
+ providers: [EvindService, EventService],
+ template: `
+
+
+
+
+
+ Date: {{eventDate}}
+ Location: {{eventLocation}}
+
+
{{eventDesc}}
+
Event Posted By: {{eventPostBy}}
+
+
People Attending this Event:
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+ {{message.handle}}: {{message.message}}
+
+
+
+
+
+
+
+
+
+
`
+})
+
+export class EviewComponent {
+
+ id: string;
+ eventDate: string;
+ eventName: string;
+ eventLocation: string;
+ eventLink: string;
+ eventPict: string;
+ eventDesc: string;
+ eventPostBy: string;
+ attending: string[];
+ showChatText: string;
+ showChat: boolean;
+ shownotiForm: boolean;
+ getData: any;
+ profile: any;
+ name: string;
+ image: string;
+ userID: string;
+ messages: any[];
+ form = new FormGroup({
+ handle: new FormControl(),
+ message: new FormControl(),
+ })
+
+
+
+ appointment = new FormGroup({
+ phoneNumber: new FormControl('phoneNumber')
+ });
+
+ constructor(private route: ActivatedRoute, private _httpService: EvindService, public eventService: EventService) {
+ this.id = route.snapshot.params['id'];
+ this.showChatText = 'Go to event chat room';
+ this.showChat = false;
+ this.shownotiForm = false;
+ }
+ onTestGet(id) {
+ this._httpService.getEvent(id).subscribe(data => {
+ console.log(data);
+ this.getData = data;
+ this.eventName = data.title;
+ this.eventDate = data.eventDate;
+ this.eventPict = data.imgUrl;
+ this.eventLink = data.link;
+ this.eventDesc = data.description;
+ this.eventPostBy = data.author;
+ this.eventLocation = data.location;
+ this.attending = data.attending;
+ }, error => {
+ console.error(error);
+ }, () => {
+ console.log('GET request complete');
+ });
+ }
+ attEvent(user) {
+ this._httpService.attendEvent(user).subscribe(() => {
+ console.log('Successful POST request');
+ }, error => {
+ console.error(error);
+ }, () => {
+ console.log('Request complete');
+ });
+ }
+ ngOnInit() {
+ this.onTestGet(this.id);
+ this.eventService.profile.subscribe(profile => {
+ this.userID = profile.facebook.id;
+ this.profile = profile;
+ this.name = profile.facebook.displayName;
+ this.image = profile.facebook.image;
+ }, error => {
+ console.error(error);
+ }, () => {
+ console.log('complete');
+ })
+ }
+ sendMessage(msg) {
+ this._httpService.sendMessage(msg).subscribe(() => {
+ console.log('Successful request');
+ console.log('msg');
+ }, error => {
+ console.error(error);
+ }, () => {
+ console.log('Request complete');
+ });
+ }
+ handleAttend() {
+ if (this.name) {
+ this.attEvent({ name: this.name, event: this.getData });
+ this.onTestGet(this.id);
+ const msg = `Remember the event: ${this.eventName}, on ${this.eventDate} at ${this.eventLocation}`;
+ const message = {message: msg};
+ this.sendMessage(message);
+ }
+ }
+ getDate(event) {
+ if (!event.eventDate) {
+ return;
+ }
+ const timeArray = event.eventDate.split('-');
+ const year = parseInt(timeArray[0]);
+ const month = parseInt(timeArray[1]);
+ const day = parseInt(timeArray[2]);
+ const eventDate = new Date(year, month - 1, day);
+ console.log(eventDate);
+ }
+
+ toggleChat() {
+ if (this.showChat === true) {
+ this.showChat = false;
+ this.showChatText = 'Go to event chat room';
+ } else {
+ this.showChat = true;
+ this.showChatText = 'Hide event chat room';
+ this.getMessages();
+ }
+ }
+ notiForm() {
+ if (this.shownotiForm === true) {
+ this.shownotiForm = false;
+ } else {
+ this.shownotiForm = true;
+ }
+ }
+
+ getMessages() {
+ this._httpService.getMessages().subscribe((messages) => {
+ let mapped = messages.filter((message) => {
+ return message.event === this.eventName;
+ })
+ this.messages = mapped;
+ }, (err) => {
+ console.log(err);
+ }, () => {
+ console.log('messages received,', this.messages);
+ })
+ }
+
+ postMessage() {
+ let messageToSend = {
+ handle: this.form.value.handle,
+ message: this.form.value.message,
+ event: this.eventName,
+ }
+ this.messages.push(messageToSend);
+ this._httpService.postMessage(messageToSend).subscribe(() => {
+ }, error => {
+ console.error(error);
+ }, () => {
+ console.log('Message post complete');
+ });
+ }
+
+}
diff --git a/client/evind.service.js b/client/evind.service.js
new file mode 100644
index 0000000..c77311d
--- /dev/null
+++ b/client/evind.service.js
@@ -0,0 +1,37 @@
+"use strict";
+var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+};
+var __metadata = (this && this.__metadata) || function (k, v) {
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
+};
+const core_1 = require('@angular/core');
+const http_1 = require('@angular/http');
+require('rxjs/add/operator/map');
+// import { Event } from './datatypes/event';
+let EvindService = class EvindService {
+ constructor(_http) {
+ this._http = _http;
+ }
+ getEvent(id) {
+ return this._http.get(`events/${id}`)
+ .map(res => {
+ return res.json();
+ });
+ }
+ attendEvent(user) {
+ return this._http.post('adduser/', user)
+ .map(res => {
+ return res.json();
+ });
+ }
+};
+EvindService = __decorate([
+ core_1.Injectable(),
+ __metadata('design:paramtypes', [http_1.Http])
+], EvindService);
+exports.EvindService = EvindService;
+//# sourceMappingURL=evind.service.js.map
\ No newline at end of file
diff --git a/client/evind.service.js.map b/client/evind.service.js.map
new file mode 100644
index 0000000..b0b362c
--- /dev/null
+++ b/client/evind.service.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"evind.service.js","sourceRoot":"","sources":["evind.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,uBAA2B,eAAe,CAAC,CAAA;AAC3C,uBAA+B,eAAe,CAAC,CAAA;AAC/C,QAAO,uBAAuB,CAAC,CAAA;AAC/B,6CAA6C;AAG7C;IACE,YAAqB,KAAW;QAAX,UAAK,GAAL,KAAK,CAAM;IAEhC,CAAC;IACD,QAAQ,CAAC,EAAE;QACT,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC;aACpC,GAAG,CAAC,GAAG;YACN,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;IACD,WAAW,CAAC,IAAI;QACd,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC;aACrC,GAAG,CAAC,GAAG;YACN,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QACpB,CAAC,CAAC,CAAC;IACP,CAAC;AACH,CAAC;AAjBD;IAAC,iBAAU,EAAE;;gBAAA;AACA,oBAAY,eAgBxB,CAAA"}
\ No newline at end of file
diff --git a/client/evind.service.ts b/client/evind.service.ts
new file mode 100644
index 0000000..60bcc06
--- /dev/null
+++ b/client/evind.service.ts
@@ -0,0 +1,49 @@
+import { Injectable } from '@angular/core';
+import { Http, Response } from '@angular/http';
+import 'rxjs/add/operator/map';
+// import { Event } from './datatypes/event';
+
+@Injectable()
+export class EvindService {
+ constructor (private _http: Http) {
+
+ }
+ getEvent(id) {
+ return this._http.get(`events/${id}`)
+ .map(res => {
+ return res.json();
+ });
+ }
+ attendEvent(user) {
+ return this._http.post('adduser/', user)
+ .map(res => {
+ return res.json();
+ });
+ }
+
+ getMessages() {
+ return this._http.get('messages')
+ .map(res => {
+ return res.json();
+ })
+ }
+
+ postMessage(message) {
+ return this._http.post('messages', message)
+ .map(res => {
+ return res.json();
+ })
+ }
+ postEvent(event) {
+ return this._http.post('api/events/', event)
+ .map(res => {
+ return res;
+ })
+ }
+ sendMessage(notif) {
+ return this._http.post('texttwilio/', notif)
+ .map(res => {
+ return res;
+ })
+ }
+}
\ No newline at end of file
diff --git a/client/index.html b/client/index.html
index b2cff5c..8882e9b 100644
--- a/client/index.html
+++ b/client/index.html
@@ -7,10 +7,20 @@
-
-
- Loading...
-
+
@@ -34,5 +44,7 @@
console.error(err);
});
+
+