Skip to content

Commit

Permalink
Merge pull request #194 from FJNR-inc/develop
Browse files Browse the repository at this point in the history
New release
  • Loading branch information
RignonNoel authored Mar 23, 2021
2 parents 907df0b + 3746801 commit 6c54c10
Show file tree
Hide file tree
Showing 11 changed files with 358 additions and 51 deletions.
10 changes: 10 additions & 0 deletions src/app/components/my-table/my-table.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ <h2 class="my-table__actions__title nt-title" *ngIf="settings.title">
</td>
<td class="my-table__table__line__cell my-table__table__line__cell--actions"
*ngIf="displayActionColumn()">
<a *ngIf="settings.openTabButton"
class="my-table__table__line__cell--actions__download"
(click)="openTab(item)">
<i class="fas fa-external-link-alt actionnable"></i>
</a>
<a *ngIf="settings.downloadButton"
class="my-table__table__line__cell--actions__download"
(click)="download(item)">
Expand All @@ -105,6 +110,11 @@ <h2 class="my-table__actions__title nt-title" *ngIf="settings.title">
(click)="remove(item)">
<i class="fa fa-trash actionnable"></i>
</a>
<a *ngIf="settings.removeButton"
class="my-table__table__line__cell--actions__remove"
(click)="remove(item)">
<i class="fa fa-trash actionnable"></i>
</a>
</td>
</tr>
</table>
Expand Down
6 changes: 6 additions & 0 deletions src/app/components/my-table/my-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface TableSetting {
removeButton?: boolean;
editButton?: boolean;
downloadButton?: boolean;
openTabButton?: boolean;
allowFiltering?: boolean;
columns?: TableSettingColumns[];
}
Expand All @@ -40,6 +41,7 @@ export class MyTableComponent implements OnInit, OnChanges {
@Input() useSearchBar = false;

@Output() selectItem: EventEmitter<any> = new EventEmitter();
@Output() openTabItem: EventEmitter<any> = new EventEmitter();
@Output() downloadItem: EventEmitter<any> = new EventEmitter();
@Output() editItem: EventEmitter<any> = new EventEmitter();
@Output() removeItem: EventEmitter<any> = new EventEmitter();
Expand Down Expand Up @@ -124,6 +126,10 @@ export class MyTableComponent implements OnInit, OnChanges {
}
}

openTab(item) {
this.openTabItem.emit(item);
}

download(item) {
this.downloadItem.emit(item);
}
Expand Down
33 changes: 31 additions & 2 deletions src/app/components/pages/admin/retreats/retreats.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,44 @@
(addButton)="OpenModalCreateRetreat()"
(selectItem)="redirectToRetreat($event.id)"
(changePage)="changePage($event)"
(openTabItem)="redirectToRetreat($event.id, true)"
(downloadItem)="exportReservations($event)"
[filters]="filters"
[useSearchBar]="true"
(searchBar)="updateFilter('search', $event)"
[confirmationOnDeletion]="false">
</app-my-table>
</div>
</div>

<app-nt-modal name="form_retreats"
typeModal="success"
(button2)="submitRetreat()"
[displayButtons]="false"
class="form-create-retreat"
maxWidth="600px">
<app-form [form]="retreatForm" [fields]="fields" [errors]="retreatErrors"></app-form>
<div class="form-create-retreat__selector" *ngIf="modalCreateMode === 'default'">
<div class="form-create-retreat__selector__item" (click)="modalCreateMode='simple'">
Creer une retraite
</div>
<div class="form-create-retreat__selector__item" (click)="modalCreateMode='bulk'">
Creer une liste de bloc virtuel
</div>
</div>

<div *ngIf="modalCreateMode === 'simple'" >
<app-form [form]="retreatForm" [fields]="fields" [errors]="retreatErrors"></app-form>
<button class="nt-button nt-button--full-width" type="submit" (click)="submitRetreat()">{{ 'retreats.create_retreat_modal.button' | translate }}</button>
</div>

<div *ngIf="modalCreateMode === 'bulk'" class="form-create-retreat__bulk" >
<div class="form-create-retreat__bulk__weekdays">
<div class="form-create-retreat__bulk__weekdays__day"
[ngClass]="{'form-create-retreat__bulk__weekdays__day--selected': selectedDays.lastIndexOf(day) > -1}"
*ngFor="let day of days" (click)="toogleDay(day)">
{{ day.label }}
</div>
</div>
<app-form [form]="retreatBulkForm" [fields]="bulk_fields" [errors]="retreatErrors"></app-form>
<button class="nt-button nt-button--full-width" type="submit" (click)="submitBulkRetreat()">{{ 'retreats.create_retreat_modal.button_bulk' | translate }}</button>
</div>
</app-nt-modal>
56 changes: 56 additions & 0 deletions src/app/components/pages/admin/retreats/retreats.component.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
@import '../../../../../assets/scss/theme';
@import '../../../../../assets/scss/easings';

.admin-retreats-page {
padding: 20px;
}

.form-create-retreat {
&__selector {
display: flex;
justify-content: space-around;

&__item {
margin: 20px;
padding: 20px;
text-align: center;
flex: 1;
border: 1px solid $nt-14;
border-radius: 10px;
display: flex;
justify-content: center;
align-items: center;
transition: $ease-in-sine 125ms;

&:hover {
color: white;
background-color: $nt-14;
cursor: pointer;
}
}
}

&__bulk {
&__weekdays {
display: flex;
flex-direction: row;
justify-content: center;
margin-top: 20px;
margin-bottom: 30px;

&__day {
display: flex;
align-items: center;
justify-content: center;
background-color: $color-main;
color: white;
margin: 0 10px;
border-radius: 50%;
width: 30px;
height: 30px;
cursor: pointer;

&--selected {
background-color: $nt-text;
}
}
}
}
}
Loading

0 comments on commit 6c54c10

Please sign in to comment.