diff --git a/README.md b/README.md index 95ecbd7..80232a2 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ -## Dev omgeving opzetten +# Dev omgeving opzetten ### v-host opzetten 1. Open kladblok als administrator -2. Ga naar open bestand -3. Open bestand C:/Windows/System32/drivers/etc/hosts -4. Voeg deze regel toe: 127.0.0.1 intro-tour.local +2. Open bestand ``C:/Windows/System32/drivers/etc/hosts`` +3. Voeg deze regel toe: ``127.0.0.1 intro-tour.local`` ### Apache v-hosts opzetten @@ -18,18 +17,45 @@ ServerName "intro-tour.local" ``` +(``{project root}`` moet je wel zelf invullen) + 3. Start apache opnieuw op ### Laravel Configureren 1. Maak ``.env`` bestand aan in de root folder van het project 2. Kopieer inhoud van ``.env.example`` in het nieuw aangemaakte ``.env`` bestand -3. Verander regel 5 naar ``APP_URL=http://intro-tour.local`` -4. Run command ``php artisan key:generate`` +3. Pas de informatie in het ``.env`` bestand aan aan jou instellingen +4. maak in dien nodig een database aan in [phpMyAdmin](http://localhost/phpmyadmin/index.php) +4. Verander regel 5 naar ``APP_URL=http://intro-tour.local`` 5. Run command ``composer update`` +6. Run command ``php artisan key:generate`` +7. Run command ``php migrate:refresh --seed`` om de database te vullen met de test data -# Angular werkend krijgen +## Angular werkend krijgen 1. install node.js 2. run command ``npm install`` in intro-tour-client map (if this does not work load node installer and run repair) -3. run command ``npm start`` +3. run command ``npm start`` of ``ng serve -o`` + +# Bugs aangeven +Wil je een bug melden? Volg dan de volgende stappen: +1. Ga naar [de issue pagina van onze repo](https://github.com/SimonDamminga/Intro-Tour/issues) om bugs te reporten +2. Klik op de groene **New Issue** knop +3. Klik op **Get Started** +4. Volg de instructies in het template +Dit moet wel in markdown: [cheatsheet MD](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) +5. Klik op de **Submit new issue** knop + +# Extra informatie + +Wij adviseren bij het testen van de locaties om de *Chrome browser* te gebruiken +omdat Chrome de optie biedt om je geolocatie te manipuleren. Dit kan je doen door: +1. Open het ``f12`` menu +2. Klik op de drie puntjes rechts boven de pagina van het ``f12`` menu +3. Klik op **meer tools** +4. Zoek de optie **sensors** +5. Dit opent het sensors menu +6. Voer bij **geolocation** de gewenste locatie in door middel van: + * latitude + * longitude diff --git a/intro-tour-client/angular.json b/intro-tour-client/angular.json index fc60040..57575d1 100644 --- a/intro-tour-client/angular.json +++ b/intro-tour-client/angular.json @@ -1,131 +1,154 @@ { - "$schema": "./node_modules/@angular/cli/lib/config/schema.json", - "version": 1, - "newProjectRoot": "projects", - "projects": { - "intro-tour-client": { - "root": "", - "sourceRoot": "src", - "projectType": "application", - "prefix": "app", - "schematics": {}, - "architect": { - "build": { - "builder": "@angular-devkit/build-angular:browser", - "options": { - "outputPath": "dist/intro-tour-client", - "index": "src/index.html", - "main": "src/main.ts", - "polyfills": "src/polyfills.ts", - "tsConfig": "src/tsconfig.app.json", - "assets": [ - "src/favicon.ico", - "src/assets" - ], - "styles": [ - "./node_modules/semantic-ui-css/semantic.min.css", - "src/styles.css" - ], - "scripts": [ - "./node_modules/jquery/dist/jquery.min.js", - "./node_modules/semantic-ui-css/semantic.min.js" - ] - }, - "configurations": { - "production": { - "fileReplacements": [ - { - "replace": "src/environments/environment.ts", - "with": "src/environments/environment.prod.ts" - } - ], - "optimization": true, - "outputHashing": "all", - "sourceMap": false, - "extractCss": true, - "namedChunks": false, - "aot": true, - "extractLicenses": true, - "vendorChunk": false, - "buildOptimizer": true - } - } - }, - "serve": { - "builder": "@angular-devkit/build-angular:dev-server", - "options": { - "browserTarget": "intro-tour-client:build" - }, - "configurations": { - "production": { - "browserTarget": "intro-tour-client:build:production" - } - } - }, - "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", - "options": { - "browserTarget": "intro-tour-client:build" - } - }, - "test": { - "builder": "@angular-devkit/build-angular:karma", - "options": { - "main": "src/test.ts", - "polyfills": "src/polyfills.ts", - "tsConfig": "src/tsconfig.spec.json", - "karmaConfig": "src/karma.conf.js", - "styles": [ - "src/styles.css" - ], - "scripts": [], - "assets": [ - "src/favicon.ico", - "src/assets" - ] - } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": [ - "src/tsconfig.app.json", - "src/tsconfig.spec.json" - ], - "exclude": [ - "**/node_modules/**" - ] - } - } - } - }, - "intro-tour-client-e2e": { - "root": "e2e/", - "projectType": "application", - "architect": { - "e2e": { - "builder": "@angular-devkit/build-angular:protractor", - "options": { - "protractorConfig": "e2e/protractor.conf.js", - "devServerTarget": "intro-tour-client:serve" - }, - "configurations": { - "production": { - "devServerTarget": "intro-tour-client:serve:production" - } - } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": "e2e/tsconfig.e2e.json", - "exclude": [ - "**/node_modules/**" - ] - } - } - } - } - }, - "defaultProject": "intro-tour-client" + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "intro-tour-client": { + "root": "", + "sourceRoot": "src", + "projectType": "application", + "prefix": "app", + "schematics": {}, + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/intro-tour-client", + "index": "src/index.html", + "main": "src/main.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "src/tsconfig.app.json", + "assets": [ + "src/favicon.ico", + "src/assets" + ], + "styles": [ + "./node_modules/semantic-ui-css/semantic.min.css", + "src/styles.css" + ], + "scripts": [ + "./node_modules/jquery/dist/jquery.min.js", + "./node_modules/semantic-ui-css/semantic.min.js" + ] + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "aot": true, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true + }, + "test": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.test.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "aot": true, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true + } + } + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "intro-tour-client:build" + }, + "configurations": { + "production": { + "browserTarget": "intro-tour-client:build:production" + }, + "test": { + "browserTarget": "intro-tour-client:build:test" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "intro-tour-client:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/test.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "src/tsconfig.spec.json", + "karmaConfig": "src/karma.conf.js", + "styles": [ + "src/styles.css" + ], + "scripts": [], + "assets": [ + "src/favicon.ico", + "src/assets" + ] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "src/tsconfig.app.json", + "src/tsconfig.spec.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } + } + }, + "intro-tour-client-e2e": { + "root": "e2e/", + "projectType": "application", + "architect": { + "e2e": { + "builder": "@angular-devkit/build-angular:protractor", + "options": { + "protractorConfig": "e2e/protractor.conf.js", + "devServerTarget": "intro-tour-client:serve" + }, + "configurations": { + "production": { + "devServerTarget": "intro-tour-client:serve:production" + }, + "test": { + "devServerTarget": "intro-tour-client:serve:test" + } + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": "e2e/tsconfig.e2e.json", + "exclude": [ + "**/node_modules/**" + ] + } + } + } + } + }, + "defaultProject": "intro-tour-client" } \ No newline at end of file diff --git a/intro-tour-client/src/app/app.component.ts b/intro-tour-client/src/app/app.component.ts index ab0f0ca..f06f6db 100644 --- a/intro-tour-client/src/app/app.component.ts +++ b/intro-tour-client/src/app/app.component.ts @@ -14,16 +14,19 @@ export class AppComponent { teamName; teamPin; - constructor (private teamService: TeamService, private localstorageService: LocalstorageService) {} + constructor (private teamService: TeamService, private localstorageService: LocalstorageService) { + + } ngOnInit(){ //teamname in header - if(this.localstorageService.getItem('team') == null){ - this.teamService.currentTeamName.subscribe(name => this.teamName = name); - }else{ - this.teamName = this.localstorageService.getItem('team').team_name; - } - + setTimeout(() => { + if(this.localstorageService.getItem('team') == null){ + this.teamService.teamName('INTRO TOUR'); + this.teamService.currentTeamName.subscribe(name => this.teamName = name); + }else{ + this.teamName = this.localstorageService.getItem('team').team_name; + } + }, 100); } - } diff --git a/intro-tour-client/src/app/app.module.ts b/intro-tour-client/src/app/app.module.ts index 4328396..bcf9209 100644 --- a/intro-tour-client/src/app/app.module.ts +++ b/intro-tour-client/src/app/app.module.ts @@ -16,11 +16,13 @@ import { TeamCreateComponent } from './components/team-create/team-create.compon import { MinutesSecondsPipe } from './pipes/minutes-seconds.pipe'; import { LeaderboardComponent } from './components/leaderboard/leaderboard.component'; import { PointReplacerPipe } from './pipes/point-replacer.pipe'; +import { TeamJoinComponent } from './components/team-join/team-join.component'; const appRoutes: Routes = [ { path: 'location', component: LocationPageComponent }, { path: 'home', component: HomeComponent }, { path: 'team-create', component: TeamCreateComponent }, + { path: 'team-join', component: TeamJoinComponent }, { path: 'login', component: LoginComponent }, { path: '', component: LoginComponent }, { path: 'leaderboard', component: LeaderboardComponent } @@ -36,7 +38,8 @@ const appRoutes: Routes = [ TeamCreateComponent, MinutesSecondsPipe, LeaderboardComponent, - PointReplacerPipe + PointReplacerPipe, + TeamJoinComponent ], imports: [ BrowserModule, diff --git a/intro-tour-client/src/app/components/home/home.component.css b/intro-tour-client/src/app/components/home/home.component.css index 1a8e4d0..94953fc 100644 --- a/intro-tour-client/src/app/components/home/home.component.css +++ b/intro-tour-client/src/app/components/home/home.component.css @@ -16,4 +16,7 @@ left: 50%; bottom: 0px; transform: translate(-50%); +} +#team-pin-text{ + font-size: 13px; } \ No newline at end of file diff --git a/intro-tour-client/src/app/components/home/home.component.html b/intro-tour-client/src/app/components/home/home.component.html index 45553d2..c69368f 100644 --- a/intro-tour-client/src/app/components/home/home.component.html +++ b/intro-tour-client/src/app/components/home/home.component.html @@ -2,13 +2,15 @@
Welkom {{usr.name}}
+
+

Team Pin: {{team.team_pin}}

+
-

{{team.team_name}}

-

De team pincode is: {{team.team_pin}}

+

Het team bestaat uit {{totalMembers}} persoonpersonen

+
+

{{member.name}}

+
-
- -
\ No newline at end of file diff --git a/intro-tour-client/src/app/components/home/home.component.ts b/intro-tour-client/src/app/components/home/home.component.ts index 5a9c0e7..2e0b99e 100644 --- a/intro-tour-client/src/app/components/home/home.component.ts +++ b/intro-tour-client/src/app/components/home/home.component.ts @@ -6,72 +6,99 @@ import { LocalstorageService } from '../../services/localstorage.service'; import { Router } from '@angular/router'; @Component({ - selector: 'app-home', - templateUrl: './home.component.html', - styleUrls: ['./home.component.css'] + selector: 'app-home', + templateUrl: './home.component.html', + styleUrls: ['./home.component.css'] }) export class HomeComponent implements OnInit { - constructor( - private teamService: TeamService, - private userName: UserNameService, - private participantsService: ParticipantsService, - private localstorageService: LocalstorageService, - private route: Router - ) {} + constructor( + private teamService: TeamService, + private userName: UserNameService, + private participantsService: ParticipantsService, + private localstorageService: LocalstorageService, + private route: Router + ) { } - public teamPin: string; - public name: string; - public id: number; - public team = { - name: '' - }; - public usr = { - name: '' - }; + public teamPin: string; + public totalMembers: number = 0; + public name: string; + public id: number; + public team = { + team_name: '', + team_pin: '', + questions_answerd: [] + }; + public usr = { + name: '' + }; + public members: Array; - ngOnInit() { - // Subscribe to team name from the team service - - if (this.id == 0) { - this.route.navigateByUrl('/'); - } + ngOnInit() { + // Subscribe to team name from the team service - if (localStorage.getItem('user') == null) { - this.userName.currentId.subscribe(id => this.id = id); - this.teamService.currentTeamPin.subscribe(teamPin => this.teamPin = teamPin); + if (this.id == 0) { + this.route.navigateByUrl('/'); + } - //check if user is set - if (this.id == 0) { - //redirect naar login pagina - this.route.navigateByUrl('/'); - } else { - //get user uit database - this.participantsService.getUserById(this.id) - .subscribe((res) => { - //user opslaan in de loclastorage - this.localstorageService.setItem('user', res); - this.usr = this.localstorageService.getItem('user'); - }); - this.teamService.getTeamByTeamPin(this.teamPin) - .subscribe((res) => { - //team opslaan in localstorage - this.localstorageService.setItem('team', res[0]); - this.team = this.localstorageService.getItem('team'); - this.teamService.teamName(res[0].team_name); - }); - } - } else { - //als de user al is opgeslagen in de localstorage - this.usr = this.localstorageService.getItem('user'); - this.team = this.localstorageService.getItem('team'); - } + if (localStorage.getItem('user') == null) { + this.userName.currentId.subscribe(id => this.id = id); + this.teamService.currentTeamPin + .subscribe((teamPin) => { + this.localstorageService.setItem('teamPin', teamPin); + this.teamPin = this.localstorageService.getItem('teamPin'); + }); - } + //check if user is set + if (this.id == 0) { + //redirect naar login pagina + this.route.navigateByUrl('/'); + } else { + //get user uit database + this.participantsService.getUserById(this.id) + .subscribe((res) => { + //user opslaan in de loclastorage + this.localstorageService.setItem('user', res[0]); + this.usr = this.localstorageService.getItem('user') + }); + this.teamService.getTeamByTeamPin(this.teamPin) + .subscribe((res) => { + //team opslaan in localstorage + res[0].questions_answerd = []; + this.localstorageService.setItem('team', res[0]); + this.team = this.localstorageService.getItem('team'); + this.teamService.teamName(res[0].team_name); + }); + this.participantsService.getUsersByPin(this.teamPin) + .subscribe((res) => { + this.localstorageService.setItem('members', res); + this.members = this.localstorageService.getItem('members'); + this.totalMembers = this.members.length; + }); + } + } else { + //als de user al is opgeslagen in de localstorage + this.teamPin = this.localstorageService.getItem('teamPin'); + this.usr = this.localstorageService.getItem('user'); + this.team = this.localstorageService.getItem('team'); - getUsr() { - console.log(this.usr); - console.log(this.team); - } -} + // temporary fix + this.participantsService.getUsersByPin(this.teamPin) + .subscribe((res) => { + this.localstorageService.setItem('members', res); + this.members = this.localstorageService.getItem('members'); + this.totalMembers = this.members.length; + }); + //end temporary fix + + this.team.questions_answerd = []; + } + + } + + getUsr(){ + console.log(this.team); + console.log(this.usr); + } +} \ No newline at end of file diff --git a/intro-tour-client/src/app/components/location-page/location-page.component.css b/intro-tour-client/src/app/components/location-page/location-page.component.css index 82c44cf..89de839 100644 --- a/intro-tour-client/src/app/components/location-page/location-page.component.css +++ b/intro-tour-client/src/app/components/location-page/location-page.component.css @@ -39,6 +39,12 @@ agm-map{ margin: 10px 0px 0px 20px; font-weight: bold; } +.q-points{ + font-family: 'Bree Serif', serif; + font-size: 20px; + margin: 5px 0px 0px 20px; + color: #c4c4c4; +} .q-options{ margin: 10px 0px 0px 20px; font-family: 'Bree Serif', serif; diff --git a/intro-tour-client/src/app/components/location-page/location-page.component.html b/intro-tour-client/src/app/components/location-page/location-page.component.html index 4d34d2e..6e19f10 100644 --- a/intro-tour-client/src/app/components/location-page/location-page.component.html +++ b/intro-tour-client/src/app/components/location-page/location-page.component.html @@ -1,20 +1,31 @@ - + - + -

Je bent in de buurt van de vraag
klik op de knop om het event te - openen
voor {{location.points}} punten

+

{{location.name}} +
{{location.description}}
+
Je bent in de buurt van de vraag +
klik op de knop om het event te openen +
voor {{location.points}} punten +

-

Je bent niet in de buurt
kom hier heen om het event te doen
voor - {{location.points}} punten

+

{{location.name}} +
{{location.description}}
+
Je bent niet in de buurt +
kom hier heen om het event te doen +
voor {{location.points}} punten +

-

Je hebt dit event al gedaan
Je hebt voor dit event {{location.points}} - punten gekregen

+

{{location.name}} +
{{location.description}}
+
Je hebt dit event al gedaan +
Je hebt voor dit event {{location.points}} punten gekregen +

@@ -24,18 +35,13 @@ diff --git a/intro-tour-client/src/app/components/location-page/location-page.component.ts b/intro-tour-client/src/app/components/location-page/location-page.component.ts index c216c8f..1c4d5c6 100644 --- a/intro-tour-client/src/app/components/location-page/location-page.component.ts +++ b/intro-tour-client/src/app/components/location-page/location-page.component.ts @@ -2,6 +2,9 @@ import { Component, OnInit } from '@angular/core'; import { EventService } from '../../services/event.service'; import { QuestionService } from '../../services/question.service'; import { LocationService } from '../../services/location.service'; +import { TeamService } from '../../services/team.service'; +import { LocalstorageService } from '../../services/localstorage.service' + @Component({ selector: 'app-location-page', templateUrl: './location-page.component.html', @@ -13,6 +16,7 @@ export class LocationPageComponent implements OnInit { private given_answer; public question; public locations = []; + public answerd = []; public totalPoints: number = 0; public timeLimit: number; public timeRemaining: number = 0; @@ -36,7 +40,7 @@ export class LocationPageComponent implements OnInit { isTracking = false; - constructor(private _eventService: EventService, private _questionService: QuestionService, private _locationService: LocationService) { + constructor(private _eventService: EventService, private _questionService: QuestionService, private _locationService: LocationService, private teamService: TeamService, private localstorageService: LocalstorageService) { this.getEvents(); } @@ -134,12 +138,34 @@ export class LocationPageComponent implements OnInit { events.forEach(event => { this._locationService.getLocation(event.event.trigger.data.location_id) .subscribe((res: any) => { + + if(this.localstorageService.getItem('team') != null){ + let questions_answerd_team = this.localstorageService.getItem('team').questions_answerd; + this.answerd = questions_answerd_team; + + if(questions_answerd_team != undefined){ + if(questions_answerd_team.includes(event.event.action.data.question_id)){ + res[0].map_icon = 2; + }else{ + res[0].map_icon = 1; + }; + }else{ + res[0].map_icon = 1; + } + }else{ + res[0].map_icon = 1; + } + + this.timeLimit = event.event.action.data.timeLimit; + res[0].question_id = event.event.action.data.question_id; res[0].points = event.event.action.data.points; res[0].devider = event.event.action.data.devider; - res[0].map_icon = 1; + this.locations.push(res[0]); - this.timeLimit = event.event.action.data.timeLimit; + + console.log(this.locations); + }); }); } @@ -153,18 +179,44 @@ export class LocationPageComponent implements OnInit { this.hideWindow(id); document.getElementById(`right-${id}`).style.display = 'block'; } else { - console.log(id) this.hideWindow(id); document.getElementById(`wrong-${id}`).style.display = 'block'; } } + + public updateTeam(id) { + let team = this.localstorageService.getItem('team'); + + //update team score and the questions that are answerd + this.locations.forEach((location, index) => { + if (location.id == id) { + team.team_score = team.team_score += this.locations[index].points; + this.answerd.push(location.question_id); + + team.questions_answerd = this.answerd; + + this.localstorageService.updateItem('team', team); + + this.teamService.updateTeam(team.id, { team_score: team.team_score }) + .subscribe((res: Response) => { }, + (err) => console.error(err)); + + + + this.teamService.updateTeam(team.id, { questions_answerd: this.answerd }) + .subscribe((res: Response) => { }, + (err) => console.error(err)); + } + }); + } + public setValue(answer) { this.given_answer = answer; } public tryAgain(location) { this.locations.forEach((array_location, index) => { if (array_location.id == location.id) { - this.locations[index].points = this.locations[index].points / this.locations[index].devider; + this.locations[index].points = Math.round((this.locations[index].points / this.locations[index].devider)); } }); document.getElementById(`wrong-${location.id}`).style.display = 'none'; @@ -181,6 +233,7 @@ export class LocationPageComponent implements OnInit { }); } this.changeMarker(id); + this.updateTeam(id); } private changeMarker(id) { this.locations.forEach((location, index) => { @@ -189,6 +242,7 @@ export class LocationPageComponent implements OnInit { } }); } + private startTimer(locationId) { let timeNow: number = Math.round((new Date()).getTime() / 1000); let timeEnd: number = timeNow + this.timeLimit; @@ -206,4 +260,8 @@ export class LocationPageComponent implements OnInit { private stopTimer() { clearInterval(this.timer); } + + public giveHint(id){ + console.log(`this is a hint for q ${id}`); + } } diff --git a/intro-tour-client/src/app/components/login/login.component.html b/intro-tour-client/src/app/components/login/login.component.html index 17088f0..398a5a0 100644 --- a/intro-tour-client/src/app/components/login/login.component.html +++ b/intro-tour-client/src/app/components/login/login.component.html @@ -8,13 +8,13 @@

INTRO TOUR


- +

- +

- +
\ No newline at end of file diff --git a/intro-tour-client/src/app/components/team-create/team-create.component.css b/intro-tour-client/src/app/components/team-create/team-create.component.css index 9dbcfeb..b51bfad 100644 --- a/intro-tour-client/src/app/components/team-create/team-create.component.css +++ b/intro-tour-client/src/app/components/team-create/team-create.component.css @@ -4,7 +4,7 @@ background-color: white; position: absolute; top: 0; - z-index: 10; + z-index: 10000; } #team-create-element{ position: absolute; diff --git a/intro-tour-client/src/app/components/team-create/team-create.component.html b/intro-tour-client/src/app/components/team-create/team-create.component.html index d27243a..0eab03c 100644 --- a/intro-tour-client/src/app/components/team-create/team-create.component.html +++ b/intro-tour-client/src/app/components/team-create/team-create.component.html @@ -1,25 +1,25 @@
- -
-
+ +

Het lijkt erop dat je niet alle velden hebt ingevult

+
+
+
+
+
+
+

Maak een Team


+
+ +

+
+ +

+
+ +
+
+
+
\ No newline at end of file diff --git a/intro-tour-client/src/app/components/team-create/team-create.component.ts b/intro-tour-client/src/app/components/team-create/team-create.component.ts index 45b0655..131ca17 100644 --- a/intro-tour-client/src/app/components/team-create/team-create.component.ts +++ b/intro-tour-client/src/app/components/team-create/team-create.component.ts @@ -50,7 +50,7 @@ export class TeamCreateComponent implements OnInit { private apiUrl: string = 'http://intro-tour.local/api/'; private addLoader() {$('.ui.loader').parent().addClass(['active', 'dimmer'])}; - private removeLodaer() {$('.ui.loader').parent().removeClass(['active', 'dimmer']); this.router.navigateByUrl('/home'); }; + private removeLodaer() {$('.ui.loader').parent().removeClass(['active', 'dimmer']); this.router.navigateByUrl('/home');}; private errorHandler() { if(this.team.team_name == "" || this.team.tour_id == null){ @@ -68,6 +68,7 @@ export class TeamCreateComponent implements OnInit { document.getElementById('tour_id_input').classList.remove('error'); } }else{ + this.messagesServices.closeMessage(); this.addLoader(); } } @@ -112,7 +113,7 @@ export class TeamCreateComponent implements OnInit { // Post call to create new user private createUser(teamRes) { this.teamId = teamRes.id; - this.user.team_id = this.teamId; + this.user.team_id = teamRes.team_pin; this.user.name = this.player.name; //this.http.post(this.apiUrl + 'participants', this.user) old this.participantService.createUser(this.user) @@ -132,7 +133,6 @@ export class TeamCreateComponent implements OnInit { // Updates team to add the id of the team leader private updateTeam(userRes) { this.team.team_leader = userRes.id; - console.log(this.team); //this.http.put(this.apiUrl + 'teams/' + this.teamId, {team_leader: this.team.team_leader}) old this.teamService.updateTeam(this.teamId, {team_leader: this.team.team_leader}) .subscribe( @@ -160,11 +160,10 @@ export class TeamCreateComponent implements OnInit { } ngOnInit() { + $("input:text:visible:first").focus(); this.userName.currentName.subscribe(name => this.player.name = name); if(this.player.name == 'John Doe' || this.player.name == undefined){ this.router.navigateByUrl('/login'); - }else{ - console.log(this.player); } } } diff --git a/intro-tour-client/src/app/components/team-join/team-join.component.css b/intro-tour-client/src/app/components/team-join/team-join.component.css new file mode 100644 index 0000000..b51bfad --- /dev/null +++ b/intro-tour-client/src/app/components/team-join/team-join.component.css @@ -0,0 +1,40 @@ +.screen{ + height: 100%; + width: 100%; + background-color: white; + position: absolute; + top: 0; + z-index: 10000; +} +#team-create-element{ + position: absolute; + height: 50%; + width: 100%; + top: 25%; +} +#team-create-element div{ + display: table; + margin: 0 auto; +} +h2{ + display: table; + margin: 0 auto; + font-weight: bold; + font-size: 40px; + font-family: 'Shrikhand', cursive; + color: rgb(90, 90, 90) +} +#login-button{ + box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.4); +} +#error_message{ + margin: 10px; +} +@keyframes colorchange +{ + 0% {background: red;} + 25% {background: purple;} + 50% {background: blue;} + 75% {background: orange;} + 100% {background: red;} +} \ No newline at end of file diff --git a/intro-tour-client/src/app/components/team-join/team-join.component.html b/intro-tour-client/src/app/components/team-join/team-join.component.html new file mode 100644 index 0000000..bf0eec0 --- /dev/null +++ b/intro-tour-client/src/app/components/team-join/team-join.component.html @@ -0,0 +1,22 @@ +
+ +
+
+
+
+
+

Join een Team


+
+ +

+
+ +
+
+
+
\ No newline at end of file diff --git a/intro-tour-client/src/app/components/team-join/team-join.component.spec.ts b/intro-tour-client/src/app/components/team-join/team-join.component.spec.ts new file mode 100644 index 0000000..11b3276 --- /dev/null +++ b/intro-tour-client/src/app/components/team-join/team-join.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TeamJoinComponent } from './team-join.component'; + +describe('TeamJoinComponent', () => { + let component: TeamJoinComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TeamJoinComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TeamJoinComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/intro-tour-client/src/app/components/team-join/team-join.component.ts b/intro-tour-client/src/app/components/team-join/team-join.component.ts new file mode 100644 index 0000000..e4bfa38 --- /dev/null +++ b/intro-tour-client/src/app/components/team-join/team-join.component.ts @@ -0,0 +1,96 @@ +import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; +import { UserNameService } from '../../services/user-name.service'; +import { TeamService } from '../../services/team.service'; +import { MessageTypes } from '../../message-types'; +import { MessagesService } from '../../services/messages.service'; +import { TourService } from '../../services/tour.service'; +import { ParticipantsService } from '../../services/participants.service'; +import { Player } from '../../player'; +import { Team } from '../../team'; +import { User } from '../../user'; + +import * as $ from 'jquery'; + +@Component({ + selector: 'app-team-join', + templateUrl: './team-join.component.html', + styleUrls: ['./team-join.component.css'] +}) +export class TeamJoinComponent implements OnInit { + + constructor( + private router: Router, + private userName: UserNameService, + private teamService: TeamService, + private messagesServices: MessagesService, + private tourService: TourService, + private participantService: ParticipantsService + ) { } + + private addLoader() {$('.ui.loader').parent().addClass(['active', 'dimmer'])}; + private removeLodaer() {$('.ui.loader').parent().removeClass(['active', 'dimmer']); this.router.navigateByUrl('/home');}; + + private errorHandler(message: string) { + if(this.team.tour_id == null){ + document.getElementById('tour_id_input').classList.add('error'); + this.messagesServices.setMessage(MessageTypes.Error, 'Oeps', message); + }else{ + document.getElementById('tour_id_input').classList.remove('error'); + } + } + + player: Player = { + name: '', + tour_id: null, + player_id: null + } + + team: Team = { + team_name: '', + tour_id: null, + team_leader: null, + team_pin: '' + } + user: User = { + name: '', + role: '', + team_id: null + } + + ngOnInit() { + $("input:text:visible:first").focus(); + this.userName.currentName.subscribe(name => this.player.name = name); + if (this.player.name == 'John Doe' || this.player.name == undefined) { + this.router.navigateByUrl('/login'); + } + } + + public joinTeamCreateUser(team) { + this.user.team_id = team[0].team_pin; + this.user.name = this.player.name; + + this.participantService.createUser(this.user).subscribe((res) => { + this.userName.userId(res); + this.sendTeamInfoToNextPage(); + this.removeLodaer(); + }); + } + + public checkIfTeamExists() { + this.teamService.getTeamByTeamPin(this.team.team_pin).subscribe((res: Response) => { + if (res[0] != undefined) { + this.messagesServices.closeMessage(); + this.addLoader(); + this.joinTeamCreateUser(res); + } else { + this.errorHandler('Het Team ID bestaat niet.'); + } + }); + } + + private sendTeamInfoToNextPage() { + this.teamService.teamName(this.team.team_name); + this.teamService.teamPin(this.team.team_pin); + } +} diff --git a/intro-tour-client/src/app/services/event.service.ts b/intro-tour-client/src/app/services/event.service.ts index 5eb17ce..a7a8d22 100644 --- a/intro-tour-client/src/app/services/event.service.ts +++ b/intro-tour-client/src/app/services/event.service.ts @@ -1,20 +1,21 @@ import { Injectable } from '@angular/core'; -import { HttpClient} from '@angular/common/http'; +import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; +import { environment } from 'src/environments/environment'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class EventService { - private apiUrl:string = 'http://intro-tour.local/api/'; + private apiUrl: string = environment.API_URL; - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) { } - /** - * getEvents - */ - public getEvents(): Observable { - return this.http.get(this.apiUrl + 'events'); - } + /** + * getEvents + */ + public getEvents(): Observable { + return this.http.get(this.apiUrl + 'events'); + } } diff --git a/intro-tour-client/src/app/services/localstorage.service.ts b/intro-tour-client/src/app/services/localstorage.service.ts index 185fc87..5ff4841 100644 --- a/intro-tour-client/src/app/services/localstorage.service.ts +++ b/intro-tour-client/src/app/services/localstorage.service.ts @@ -14,6 +14,11 @@ export class LocalstorageService { return JSON.parse(localStorage.getItem(key)); } + updateItem(key: string, value: object | Array){ + localStorage.removeItem(key); + localStorage.setItem(key, JSON.stringify(value)); + } + clear(){ if(localStorage.length >= 1){ localStorage.clear(); diff --git a/intro-tour-client/src/app/services/location.service.ts b/intro-tour-client/src/app/services/location.service.ts index ba7ddc9..b55a533 100644 --- a/intro-tour-client/src/app/services/location.service.ts +++ b/intro-tour-client/src/app/services/location.service.ts @@ -1,17 +1,21 @@ import { Injectable } from '@angular/core'; -import { HttpClient} from '@angular/common/http'; +import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; +import { environment } from 'src/environments/environment'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class LocationService { - private apiUrl:string = 'http://intro-tour.local/api/'; + private apiUrl: string = environment.API_URL; - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) { } - public getLocation(id): Observable{ - return this.http.get(this.apiUrl + 'locations/' + id); - } + public getLocation(id): Observable { + return this.http.get(this.apiUrl + 'locations/' + id); + } + public updateLocation(id: number, updateData): Observable{ + return this.http.put(this.apiUrl + 'locations/' + id, updateData); + } } diff --git a/intro-tour-client/src/app/services/messages.service.ts b/intro-tour-client/src/app/services/messages.service.ts index 00efe6c..dd8e818 100644 --- a/intro-tour-client/src/app/services/messages.service.ts +++ b/intro-tour-client/src/app/services/messages.service.ts @@ -30,13 +30,13 @@ export class MessagesService { // Prevent messages from overlapping let topCss: string = ''; if ($('.ui.message.generated').length > 0) { - let topPx: number = 60 + ($('.ui.message.generated').outerHeight() * $('.ui.message.generated').length); + let topPx: number = 60 + ($('.ui.message.generated').outerHeight() * $('.ui.message.generated').length) + 5; topCss = 'top:' + topPx + 'px;'; } // Mesage html template let htmlTemplate:string = - `
+ `
${title} @@ -51,4 +51,13 @@ export class MessagesService { $(this).parent().remove(); }); } + + closeMessage(){ + var messages = Array.from(document.getElementsByClassName('message')); + messages.splice(-1, 1); + + messages.forEach((message) => { + $('.' + message.classList[2]).remove(); + }); + } } diff --git a/intro-tour-client/src/app/services/participants.service.ts b/intro-tour-client/src/app/services/participants.service.ts index 41ed4c2..dfcab73 100644 --- a/intro-tour-client/src/app/services/participants.service.ts +++ b/intro-tour-client/src/app/services/participants.service.ts @@ -1,20 +1,25 @@ import { Injectable } from '@angular/core'; -import { HttpClient} from '@angular/common/http'; +import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; +import { environment } from 'src/environments/environment'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class ParticipantsService { - private apiUrl:string = 'http://intro-tour.local/api/'; - constructor(private http: HttpClient) { } + private apiUrl: string = environment.API_URL; + constructor(private http: HttpClient) { } - getUserById(id): Observable{ - return this.http.get(this.apiUrl + 'participants/' + id); - } + getUserById(id): Observable { + return this.http.get(this.apiUrl + 'participants/' + id); + } - createUser(user): Observable{ - return this.http.post(this.apiUrl + 'participants', user); - } + getUsersByPin(pin): Observable { + return this.http.get(this.apiUrl + 'teamparticipants/' + pin); + } + + createUser(user): Observable { + return this.http.post(this.apiUrl + 'participants', user); + } } diff --git a/intro-tour-client/src/app/services/question.service.ts b/intro-tour-client/src/app/services/question.service.ts index b495a1b..b27ece3 100644 --- a/intro-tour-client/src/app/services/question.service.ts +++ b/intro-tour-client/src/app/services/question.service.ts @@ -1,22 +1,23 @@ import { Injectable } from '@angular/core'; -import { HttpClient} from '@angular/common/http'; +import { HttpClient } from '@angular/common/http'; import { Observable, of } from 'rxjs'; import { retryWhen } from 'rxjs/operators'; +import { environment } from 'src/environments/environment'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class QuestionService { - private apiUrl:string = 'http://intro-tour.local/api/'; + private apiUrl: string = environment.API_URL; - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) { } - public getQuestion(id:number): Observable { - return this.http.get(this.apiUrl + 'questions/' + id) - .pipe( - retryWhen((errors) => { - return errors - }) - ); - } + public getQuestion(id: number): Observable { + return this.http.get(this.apiUrl + 'questions/' + id) + .pipe( + retryWhen((errors) => { + return errors + }) + ); + } } diff --git a/intro-tour-client/src/app/services/team.service.ts b/intro-tour-client/src/app/services/team.service.ts index 0650a39..36eff03 100644 --- a/intro-tour-client/src/app/services/team.service.ts +++ b/intro-tour-client/src/app/services/team.service.ts @@ -1,40 +1,41 @@ import { Injectable } from '@angular/core'; import { BehaviorSubject } from 'rxjs/internal/BehaviorSubject'; -import { HttpClient} from '@angular/common/http'; +import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; +import { environment } from 'src/environments/environment'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class TeamService { - private apiUrl:string = 'http://intro-tour.local/api/'; + private apiUrl: string = environment.API_URL; - private teamPinSource = new BehaviorSubject('0000'); - public currentTeamPin = this.teamPinSource.asObservable(); + private teamPinSource = new BehaviorSubject('0000'); + public currentTeamPin = this.teamPinSource.asObservable(); - private teamNameSource = new BehaviorSubject('INTRO TOUR'); - public currentTeamName = this.teamNameSource.asObservable(); + private teamNameSource = new BehaviorSubject('INTRO TOUR'); + public currentTeamName = this.teamNameSource.asObservable(); - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) { } - public teamPin(teamPin: string) { - this.teamPinSource.next(teamPin); - } + public teamPin(teamPin: string) { + this.teamPinSource.next(teamPin); + } - public teamName(teamName: string) { - this.teamNameSource.next(teamName); - } + public teamName(teamName: string) { + this.teamNameSource.next(teamName); + } - getTeamByTeamPin(pin): Observable{ - return this.http.get(this.apiUrl + 'teams/' + pin); - } + getTeamByTeamPin(pin): Observable { + return this.http.get(this.apiUrl + 'teams/' + pin); + } - createTeam(team): Observable{ - return this.http.post(this.apiUrl + 'teams', team); - } + createTeam(team): Observable { + return this.http.post(this.apiUrl + 'teams', team); + } - updateTeam(id, updateData): Observable{ - return this.http.put(this.apiUrl + 'teams/' + id, updateData); - } + updateTeam(id, updateData): Observable { + return this.http.put(this.apiUrl + 'teams/' + id, updateData); + } } diff --git a/intro-tour-client/src/app/services/tour.service.ts b/intro-tour-client/src/app/services/tour.service.ts index 5b6f8e9..e884d43 100644 --- a/intro-tour-client/src/app/services/tour.service.ts +++ b/intro-tour-client/src/app/services/tour.service.ts @@ -1,18 +1,19 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; +import { environment } from 'src/environments/environment'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class TourService { - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) { } - private apiUrl = 'http://intro-tour.local/api/'; + private apiUrl = environment.API_URL; - getTour(tourId): Observable { - return this.http.get(this.apiUrl + 'tours/' + tourId); - } + getTour(tourId): Observable { + return this.http.get(this.apiUrl + 'tours/' + tourId); + } } diff --git a/intro-tour-client/src/environments/enviroment.test.ts b/intro-tour-client/src/environments/enviroment.test.ts new file mode 100644 index 0000000..5aa1d3a --- /dev/null +++ b/intro-tour-client/src/environments/enviroment.test.ts @@ -0,0 +1,5 @@ +export const environment = { + production: true, + name: 'test', + API_URL: 'https://api.intro-tour-test.nl/' +}; \ No newline at end of file diff --git a/intro-tour-client/src/environments/environment.prod.ts b/intro-tour-client/src/environments/environment.prod.ts index 3612073..487d307 100644 --- a/intro-tour-client/src/environments/environment.prod.ts +++ b/intro-tour-client/src/environments/environment.prod.ts @@ -1,3 +1,4 @@ export const environment = { - production: true + production: true, + API_URL: 'https://api.intro-tour.nl/' }; diff --git a/intro-tour-client/src/environments/environment.ts b/intro-tour-client/src/environments/environment.ts index 012182e..811ce11 100644 --- a/intro-tour-client/src/environments/environment.ts +++ b/intro-tour-client/src/environments/environment.ts @@ -3,7 +3,8 @@ // The list of file replacements can be found in `angular.json`. export const environment = { - production: false + production: false, + API_URL: 'http://intro-tour.local/api/' }; /* diff --git a/intro_tour/app/Http/Controllers/LocationController.php b/intro_tour/app/Http/Controllers/LocationController.php index cca0dce..6c72092 100644 --- a/intro_tour/app/Http/Controllers/LocationController.php +++ b/intro_tour/app/Http/Controllers/LocationController.php @@ -69,12 +69,14 @@ public function edit($id) * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request - * @param int $id + * @param \App\Location $location * @return \Illuminate\Http\Response */ - public function update(Request $request, $id) + public function update(Request $request, Location $location) { - // + $location->update($request->all()); + + return response()->json($location, 204); } /** diff --git a/intro_tour/app/Http/Controllers/ParticipantController.php b/intro_tour/app/Http/Controllers/ParticipantController.php index 3bd2359..5bee1fa 100644 --- a/intro_tour/app/Http/Controllers/ParticipantController.php +++ b/intro_tour/app/Http/Controllers/ParticipantController.php @@ -33,12 +33,23 @@ public function store(Request $request) /** * Display the specified resource. * - * @param \App\Participant $participant + * @param \App\Participant $id * @return \Illuminate\Http\Response */ - public function show(Participant $participant) + public function show($id) + { + return Participant::where('id', $id)->get(); + } + + /** + * Display the specified resource. + * + * @param \App\Participant $pin + * @return \Illuminate\Http\Response + */ + public function showTwo($pin) { - return $participant; + return Participant::where('team_id', $pin)->get(); } /** diff --git a/intro_tour/app/Http/Controllers/TourController.php b/intro_tour/app/Http/Controllers/TourController.php index 3570165..9bf90bc 100644 --- a/intro_tour/app/Http/Controllers/TourController.php +++ b/intro_tour/app/Http/Controllers/TourController.php @@ -36,9 +36,9 @@ public function store(Request $request) * @param \App\Tour $tour * @return \Illuminate\Http\Response */ - public function show(Tour $tour) + public function show($id) { - return $tour; + return Tour::where('tour_code', $id)->get(); } /** diff --git a/intro_tour/app/Http/Controllers/UserteamController.php b/intro_tour/app/Http/Controllers/UserteamController.php new file mode 100644 index 0000000..820f945 --- /dev/null +++ b/intro_tour/app/Http/Controllers/UserteamController.php @@ -0,0 +1,85 @@ +get(); + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function edit($id) + { + // + } + + /** + * Update the specified resource in storage. + * + * @param \Illuminate\Http\Request $request + * @param int $id + * @return \Illuminate\Http\Response + */ + public function update(Request $request, $id) + { + // + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function destroy($id) + { + // + } +} diff --git a/intro_tour/app/Location.php b/intro_tour/app/Location.php index 93b1739..c443ea3 100644 --- a/intro_tour/app/Location.php +++ b/intro_tour/app/Location.php @@ -11,6 +11,6 @@ class Location extends Model ]; protected $fillable = [ - 'radius' + 'radius', 'done' ]; } diff --git a/intro_tour/app/Providers/RouteServiceProvider.php b/intro_tour/app/Providers/RouteServiceProvider.php index 7c1d1b0..5ff3b29 100644 --- a/intro_tour/app/Providers/RouteServiceProvider.php +++ b/intro_tour/app/Providers/RouteServiceProvider.php @@ -82,6 +82,7 @@ protected function mapApiRoutes() Route::apiResource('/events','EventController'); Route::apiResource('/locations','LocationController'); Route::apiResource('/questions','QuestionController'); + Route::apiResource('/teamparticipants', 'UserteamController'); }); } } diff --git a/intro_tour/app/Team.php b/intro_tour/app/Team.php index 8d4a30c..f644704 100644 --- a/intro_tour/app/Team.php +++ b/intro_tour/app/Team.php @@ -7,6 +7,10 @@ class Team extends Model { protected $fillable = [ - 'tour_id', 'team_name', 'team_leader', 'team_pin' + 'tour_id', 'team_name', 'team_leader', 'team_pin', 'team_score', 'questions_answerd' + ]; + + protected $casts = [ + 'questions_answerd' => 'array' ]; } diff --git a/intro_tour/database/migrations/2018_09_17_203118_create_participants_table.php b/intro_tour/database/migrations/2018_09_17_203118_create_participants_table.php index e1b495c..5e634fc 100644 --- a/intro_tour/database/migrations/2018_09_17_203118_create_participants_table.php +++ b/intro_tour/database/migrations/2018_09_17_203118_create_participants_table.php @@ -16,7 +16,7 @@ public function up() Schema::create('participants', function (Blueprint $table) { $table->increments('id'); $table->string('name'); - $table->integer('team_id'); + $table->string('team_id')->default('0'); $table->timestamps(); }); } diff --git a/intro_tour/database/migrations/2018_10_19_100436_add-questions-answerd-to-teams-table.php b/intro_tour/database/migrations/2018_10_19_100436_add-questions-answerd-to-teams-table.php new file mode 100644 index 0000000..2c1539d --- /dev/null +++ b/intro_tour/database/migrations/2018_10_19_100436_add-questions-answerd-to-teams-table.php @@ -0,0 +1,32 @@ +jsonb('questions_answerd')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('teams', function (Blueprint $table) { + $table->dropColumn('questions_answerd'); + }); + } +} diff --git a/intro_tour/routes/api.php b/intro_tour/routes/api.php index cae133e..d84c628 100644 --- a/intro_tour/routes/api.php +++ b/intro_tour/routes/api.php @@ -41,10 +41,14 @@ /* Participants routes */ Route::get('participants', 'ParticipantController@index'); -Route::get('participants/{participant}', 'ParticipantController@show'); +Route::get('participants/{id}', 'ParticipantController@show'); Route::post('participants', 'ParticipantController@store'); Route::put('participants/{participant}', 'ParticipantController@update'); Route::delete('participants/{participant}', 'ParticipantController@delete'); +/* ParticipantsTeam */ + +Route::get('teamparticipants', 'UserteamController@index'); +Route::get('teamparticipants/{pin}', 'UserteamController@show'); /* Admins */ Route::get('admins', 'AdminController@index'); @@ -73,5 +77,6 @@ // locations Route::get('locations', 'LocationController@index'); Route::get('locations/{id}', 'LocationController@show'); +Route::put('locations/{id}', 'LocationController@update'); //questions Route::get('questions/{id}', 'QuestionController@show');