Skip to content

Instantly share code, notes, and snippets.

@mhartington
Created April 29, 2020 14:37
Show Gist options
  • Save mhartington/4b2c3267b589747e34d9228a5f652819 to your computer and use it in GitHub Desktop.
Save mhartington/4b2c3267b589747e34d9228a5f652819 to your computer and use it in GitHub Desktop.
diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index 3c0cf79..ce873a3 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -7,7 +7,7 @@ const routes: Routes = [
loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
},
{
- path: 'match-details/:id',
+ path: 'match-details',
loadChildren: () => import('./pages/match-details/match-details.module').then( m => m.MatchDetailsPageModule)
},
/*{
diff --git a/src/app/pages/match-details-info/match-details-info-routing.module.ts b/src/app/pages/match-details-info/match-details-info-routing.module.ts
index 0746922..aa03cf1 100644
--- a/src/app/pages/match-details-info/match-details-info-routing.module.ts
+++ b/src/app/pages/match-details-info/match-details-info-routing.module.ts
@@ -5,7 +5,7 @@ import { MatchDetailsInfoPage } from './match-details-info.page';
const routes: Routes = [
{
- path: '',
+ path: ':id',
component: MatchDetailsInfoPage
}
];
diff --git a/src/app/pages/match-details/match-details-routing.module.ts b/src/app/pages/match-details/match-details-routing.module.ts
index 79c24d0..355daef 100644
--- a/src/app/pages/match-details/match-details-routing.module.ts
+++ b/src/app/pages/match-details/match-details-routing.module.ts
@@ -4,29 +4,15 @@ import { MatchDetailsPage } from './match-details.page';
const routes: Routes = [
{
- path: 'match-details',
+ path: '',
component: MatchDetailsPage,
children: [
{
- path: 'match-details-info/:id',
- loadChildren: () => import('../match-details-info/match-details-info.module').then(m => m.MatchDetailsInfoPageModule)
+ path: 'match-details-info',
+ loadChildren: () => import('../match-details-info/match-details-info.module').then(m => m.MatchDetailsInfoPageModule)
},
- /*{
- path: 'players',
- loadChildren: () => import('../tab3/players.module').then(m => m.PlayersPageModule)
- },*/
- {
- path: '',
- redirectTo: '/match-details/match-details-info',
- pathMatch: 'full'
- }
]
},
- {
- path: '',
-redirectTo: '/match-details/match-details-info',
- pathMatch: 'full'
- }
];
@NgModule({
diff --git a/src/app/pages/match-details/match-details.page.html b/src/app/pages/match-details/match-details.page.html
index 6ca6260..d284e01 100644
--- a/src/app/pages/match-details/match-details.page.html
+++ b/src/app/pages/match-details/match-details.page.html
@@ -1,37 +1,12 @@
-<ion-header>
- <ion-toolbar class="ion-icon-toolbar" color="black">
- <ion-buttons slot="start">
- <ion-button routerLink="/../login">
- <ion-icon slot="icon-only" name="log-in"></ion-icon>
- </ion-button>
- </ion-buttons>
- <ion-title>
- Ballincollig RFC
- </ion-title>
- <ion-buttons slot="end">
- <ion-button>
- <ion-icon slot="end" src="../../assets/icon/logo.svg" size="large"></ion-icon>
- </ion-button>
- </ion-buttons>
- </ion-toolbar>
-</ion-header>
-
-<ion-content padding>
<ion-tabs>
<ion-tab-bar slot="top" color="black">
-
+
<ion-tab-button tab="match-details-info">
<ion-label>Info</ion-label>
</ion-tab-button>
-
- <!--ion-tab-button tab="players">
- <ion-label>Player Profiles</ion-label>
- </ion-tab-button-->
-
+
</ion-tab-bar>
</ion-tabs>
-
-</ion-content>
\ No newline at end of file
diff --git a/src/app/tab2/fixtures.page.html b/src/app/tab2/fixtures.page.html
index 0497b80..72e71db 100644
--- a/src/app/tab2/fixtures.page.html
+++ b/src/app/tab2/fixtures.page.html
@@ -1,60 +1,72 @@
<ion-content #content>
-
- <!--ion-card *ngFor="let match of matches; let i = index" tappable routerLink="/../match-details-standard/{{match.id}}" id='{{i}}' [ngClass]="{'wGame': match?.team =='Women\'s','firstsGame': match?.team == '1st XV','u18sGame':match?.team == 'U-18'}"-->
-
- <ion-card *ngFor="let match of matches; let i = index" tappable [routerLink]="['/../match-details','match-details-info',match.id]" id='{{i}}' [ngClass]="{'wGame': match?.team =='Women\'s','firstsGame': match?.team == '1st XV','secondsGame': match?.team == '2nd XV','u18sGame':match?.team == 'U-18'}">
-
- <ion-card-content>
- <ion-grid >
- <ion-row>
- <ion-col></ion-col>
- <ion-col></ion-col>
- <ion-col class="team" col-3>
- <font *ngIf="match?.team == 'Women\'s'; else mensGame">W </font>
- <ng-template #mensGame>
- <font>{{match?.team}} </font>
- </ng-template>
- <font *ngIf="match?.competition == 'League'; else friendlyGame">L</font>
- <ng-template #friendlyGame>
- <font *ngIf="match?.competition == 'Friendly'; else cupGame">F</font>
- </ng-template>
- <ng-template #cupGame>
- <font>Cup</font>
- </ng-template>
- </ion-col>
- <ion-col></ion-col>
- <ion-col></ion-col>
- </ion-row>
-
- <!-- matchNotPlayed: If the match has been played then I don't want to show the day which it was played -->
- <ion-row *ngIf="match?.homeScore != ''; else matchNotPlayed">
- {{match?.date.seconds * 1000 | date:'d MMM yy' }}
- </ion-row>
- <ng-template #matchNotPlayed>
- <ion-row> {{match?.date.seconds * 1000 | date:'EE d MMM yy' }}</ion-row>
- </ng-template>
- <!-- matchNotPlayed: End -->
-
- <!-- noScoreReceived: If the match has been played and scores updated then display scores else show 'v' between team names-->
- <ion-row *ngIf="match?.homeScore != ''; else noScoreReceived" border="solid">
- <ion-col>{{match?.home}}</ion-col>
- <ion-col>{{match?.homeScore}} - {{match?.awayScore}}</ion-col>
- <ion-col> {{match?.away}}</ion-col>
- </ion-row>
-
- <ng-template #noScoreReceived>
- <ion-row>
- <ion-col>{{match?.home}}</ion-col>
- <ion-col> v </ion-col>
- <ion-col> {{match?.away}}</ion-col>
- </ion-row>
-
- </ng-template>
- <!-- noScoreReceived -->
-
- <ion-row> {{match?.date.seconds * 1000 | date:'h:mm a' }}</ion-row>
- </ion-grid>
- </ion-card-content>
- </ion-card>
-
-</ion-content>
\ No newline at end of file
+ <!--ion-card *ngFor="let match of matches; let i = index" tappable routerLink="/../match-details-standard/{{match.id}}" id='{{i}}' [ngClass]="{'wGame': match?.team =='Women\'s','firstsGame': match?.team == '1st XV','u18sGame':match?.team == 'U-18'}"-->
+
+ <ion-card
+ *ngFor="let match of matches; let i = index"
+ tappable
+ [routerLink]="['/', 'match-details','match-details-info', match.id]"
+ id="{{i}}"
+ [ngClass]="{'wGame': match?.team =='Women\'s','firstsGame': match?.team == '1st XV','secondsGame': match?.team == '2nd XV','u18sGame':match?.team == 'U-18'}"
+ >
+ <ion-card-content>
+ {{match.id}}
+ <ion-grid>
+ <ion-row>
+ <ion-col></ion-col>
+ <ion-col></ion-col>
+ <ion-col class="team" col-3>
+ <font *ngIf="match?.team == 'Women\'s'; else mensGame">W </font>
+ <ng-template #mensGame>
+ <font>{{match?.team}} </font>
+ </ng-template>
+ <font *ngIf="match?.competition == 'League'; else friendlyGame"
+ >L</font
+ >
+ <ng-template #friendlyGame>
+ <font *ngIf="match?.competition == 'Friendly'; else cupGame"
+ >F</font
+ >
+ </ng-template>
+ <ng-template #cupGame>
+ <font>Cup</font>
+ </ng-template>
+ </ion-col>
+ <ion-col></ion-col>
+ <ion-col></ion-col>
+ </ion-row>
+
+ <!-- matchNotPlayed: If the match has been played then I don't want to show the day which it was played -->
+ <ion-row *ngIf="match?.homeScore != ''; else matchNotPlayed">
+ {{match?.date.seconds * 1000 | date:'d MMM yy' }}
+ </ion-row>
+ <ng-template #matchNotPlayed>
+ <ion-row>
+ {{match?.date.seconds * 1000 | date:'EE d MMM yy' }}</ion-row
+ >
+ </ng-template>
+ <!-- matchNotPlayed: End -->
+
+ <!-- noScoreReceived: If the match has been played and scores updated then display scores else show 'v' between team names-->
+ <ion-row
+ *ngIf="match?.homeScore != ''; else noScoreReceived"
+ border="solid"
+ >
+ <ion-col>{{match?.home}}</ion-col>
+ <ion-col>{{match?.homeScore}} - {{match?.awayScore}}</ion-col>
+ <ion-col> {{match?.away}}</ion-col>
+ </ion-row>
+
+ <ng-template #noScoreReceived>
+ <ion-row>
+ <ion-col>{{match?.home}}</ion-col>
+ <ion-col> v </ion-col>
+ <ion-col> {{match?.away}}</ion-col>
+ </ion-row>
+ </ng-template>
+ <!-- noScoreReceived -->
+
+ <ion-row> {{match?.date.seconds * 1000 | date:'h:mm a' }}</ion-row>
+ </ion-grid>
+ </ion-card-content>
+ </ion-card>
+</ion-content>
diff --git a/src/app/tabs/tabs.page.html b/src/app/tabs/tabs.page.html
index 9d6bb4e..70ef941 100644
--- a/src/app/tabs/tabs.page.html
+++ b/src/app/tabs/tabs.page.html
@@ -1,37 +1,17 @@
-<ion-header>
- <ion-toolbar class="ion-icon-toolbar" color="black">
- <ion-buttons slot="start">
- <ion-button routerLink="/../login">
- <ion-icon slot="icon-only" name="log-in"></ion-icon>
- </ion-button>
- </ion-buttons>
- <ion-title>
- Ballincollig RFC
- </ion-title>
- <ion-buttons slot="end">
- <ion-button>
- <ion-icon slot="end" src="../../assets/icon/logo.svg" size="large"></ion-icon>
- </ion-button>
- </ion-buttons>
- </ion-toolbar>
-</ion-header>
-
-<ion-content padding>
<ion-tabs>
<ion-tab-bar slot="bottom" color="black">
-
+
<ion-tab-button tab="fixtures">
<ion-label>Fixtures</ion-label>
</ion-tab-button>
-
+
<ion-tab-button tab="players">
<ion-label>Player Profiles</ion-label>
</ion-tab-button>
-
+
</ion-tab-bar>
</ion-tabs>
-</ion-content>
\ No newline at end of file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment