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}} persoon 1">personen
+
+
{{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
+