Skip to content
Snippets Groups Projects
Commit d897e9fa authored by florimondmanca's avatar florimondmanca
Browse files

refactor visit detail into multiple components, rename ui module to shared module

parent fbf1b973
No related branches found
No related tags found
No related merge requests found
Showing
with 150 additions and 4 deletions
...@@ -33,4 +33,4 @@ import { RevealComponent } from './reveal/reveal.component'; ...@@ -33,4 +33,4 @@ import { RevealComponent } from './reveal/reveal.component';
RevealComponent, RevealComponent,
] ]
}) })
export class UiModule { } export class SharedModule { }
import { Component, OnInit, Renderer } from '@angular/core'; import { Component, OnInit, Renderer } from '@angular/core';
import { Link } from 'app/ui'; import { Link } from 'app/shared';
@Component({ @Component({
selector: 'app-showcase-site', selector: 'app-showcase-site',
......
...@@ -4,7 +4,7 @@ import { NgModule } from '@angular/core'; ...@@ -4,7 +4,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { CoreModule } from 'app/core'; import { CoreModule } from 'app/core';
import { UiModule } from 'app/ui'; import { SharedModule } from 'app/shared';
import { Ng2EmojiModule } from 'ng2-emoji'; import { Ng2EmojiModule } from 'ng2-emoji';
// Components // Components
...@@ -41,7 +41,7 @@ import { MentionsComponent } from './mentions/mentions.component'; ...@@ -41,7 +41,7 @@ import { MentionsComponent } from './mentions/mentions.component';
CommonModule, CommonModule,
RouterModule, RouterModule,
CoreModule, CoreModule,
UiModule, SharedModule,
Ng2EmojiModule.forRoot(), Ng2EmojiModule.forRoot(),
], ],
declarations: [ declarations: [
......
<div class="container drop-shadow-sm">
<label class="name">
<strong>
{{ organizer.fullName }}
</strong>
</label>
<div *ngIf="organizer.phoneNumber" class="text-muted-sm">
<label>Téléphone</label>
<app-reveal [content]="organizer.phoneNumber"></app-reveal>
</div>
</div>
@import '~sass/variables';
.container {
text-align: center;
padding: 1em;
background: white;
width: 8em;
label {
display: block;
margin: .5em 0;
}
}
import { Component, Input } from '@angular/core';
import { User } from 'app/core';
@Component({
selector: 'app-organizer-card',
templateUrl: './organizer-card.component.html',
styleUrls: ['./organizer-card.component.scss']
})
export class OrganizerCardComponent {
@Input() organizer: User;
}
<span *ngIf="number > 0" class="badge badge-default badge-lg">
<i class="fa fa-user"></i> {{ number }}
<span [ngPlural]="number">
<ng-template ngPluralCase="=1">participant</ng-template>
<ng-template ngPluralCase="other">participants</ng-template>
</span>
</span>
import { Component, Input } from '@angular/core';
@Component({
selector: 'app-participant-number-badge',
templateUrl: './participant-number-badge.component.html',
styleUrls: ['./participant-number-badge.component.scss']
})
export class ParticipantNumberBadgeComponent {
@Input() number: number;
}
<span [ngSwitch]="accepted">
<span *ngSwitchCase="true" class="badge badge-success badge-lg">
<i class="fa fa-ticket"></i> Tu <span [ngSwitch]="passed">
<span *ngSwitchCase="true">as participé</span>
<span *ngSwitchDefault>participes</span>
</span> à cette sortie.
</span>
<span *ngSwitchCase="false" class="badge badge-danger badge-lg">
<i class="fa fa-times"></i> Ton inscription a été rejetée.
</span>
<span *ngSwitchDefault class="badge badge-info badge-lg">
<i class="fa fa-info"></i> Ton inscription est en attente de validation par les organisateurs.
</span>
</span>
import { Component, Input } from '@angular/core';
@Component({
selector: 'app-participation-badge',
templateUrl: './participation-badge.component.html',
styleUrls: ['./participation-badge.component.scss']
})
export class ParticipationBadgeComponent {
@Input() accepted: boolean;
@Input() passed: boolean;
}
<span *ngIf="open" class="badge badge-warning badge-lg"><i class="fa fa-clock-o"></i>
Inscriptions avant le {{ deadline | date:"dd/MM à HH:mm" }}
</span>
<span *ngIf="!open && !passed" class="badge badge-danger badge-lg" [ngClass]="{'tooltip bottom': !passed}">
<i class="fa fa-times"></i> Inscriptions fermées {{ deadline | amLocale:'fr' | amTimeAgo }}
<span class="tooltip-text drop-shadow-sm" *ngIf="!passed">
Tu peux encore tenter de t'inscrire
<a href="mailto:oser.sortie@gmail.com?subject=Inscription à la sortie : {{ title }}">par email</a>.
</span>
</span>
import { Component, Input } from '@angular/core';
import { Visit } from '../shared';
@Component({
selector: 'app-registration-badge',
templateUrl: './registration-badge.component.html',
styleUrls: ['./registration-badge.component.scss']
})
export class RegistrationBadgeComponent {
@Input() title: string;
@Input() open: boolean;
@Input() passed: boolean;
@Input() deadline: Date;
}
<table>
<tr>
<td>Lieu</td>
<td>{{ visit.place.name }}</td>
</tr>
<tr>
<td>Adresse</td>
<td>{{ visit.place.address.toString() }}</td>
</tr>
<tr>
<td>Date</td>
<td>{{ visit.date | date:"fullDate" }}</td>
</tr>
<tr>
<td>Heure de début</td>
<td>{{ visit.startTime | date:"shortTime"}}</td>
</tr>
<tr>
<td>Heure de fin estimée</td>
<td>{{ visit.endTime | date:"shortTime"}}</td>
</tr>
<tr>
<td>Lieu de rendez-vous</td>
<td>{{ visit.meetingPlace }}</td>
</tr>
</table>
@import '~sass/media-queries';
table {
width: 100%;
border: none;
border-spacing: .5em;
td:nth-child(1) {
font-weight: bold;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment