mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Retified attachments call list at event-details
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<ion-header>
|
<ion-header>
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-buttons slot="start">
|
<ion-buttons slot="start">
|
||||||
<ion-back-button (click)="navigateBack()" defaultHref="" icon="chevron-back"></ion-back-button>
|
<ion-back-button (click)="close()" defaultHref="" icon="chevron-back"></ion-back-button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
<ion-title>Anexos do evento</ion-title>
|
<ion-title>Anexos do evento</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
@@ -24,20 +24,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- Skeleton screen -->
|
<!-- Skeleton screen -->
|
||||||
<div *ngIf="!loadedEventAttachments">
|
<div *ngIf="!loadedEventAttachments">
|
||||||
<div class="ion-padding custom-skeleton">
|
|
||||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
|
||||||
<ion-skeleton-text animated></ion-skeleton-text>
|
|
||||||
<ion-skeleton-text animated style="width: 88%"></ion-skeleton-text>
|
|
||||||
<ion-skeleton-text animated style="width: 70%"></ion-skeleton-text>
|
|
||||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<ion-list-header>
|
|
||||||
<ion-label>
|
|
||||||
<ion-skeleton-text animated style="width: 20%"></ion-skeleton-text>
|
|
||||||
</ion-label>
|
|
||||||
</ion-list-header>
|
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-avatar slot="start">
|
<ion-avatar slot="start">
|
||||||
<ion-skeleton-text animated></ion-skeleton-text>
|
<ion-skeleton-text animated></ion-skeleton-text>
|
||||||
@@ -55,23 +42,9 @@
|
|||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-thumbnail slot="start">
|
<ion-avatar slot="start">
|
||||||
<ion-skeleton-text animated></ion-skeleton-text>
|
<ion-skeleton-text animated></ion-skeleton-text>
|
||||||
</ion-thumbnail>
|
</ion-avatar>
|
||||||
<ion-label>
|
|
||||||
<h3>
|
|
||||||
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
|
|
||||||
</h3>
|
|
||||||
<p>
|
|
||||||
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
|
||||||
</p>
|
|
||||||
</ion-label>
|
|
||||||
</ion-item>
|
|
||||||
<ion-item>
|
|
||||||
<ion-skeleton-text animated style="width: 27px; height: 27px" slot="start"></ion-skeleton-text>
|
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<h3>
|
<h3>
|
||||||
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
|
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { AttachmentsService } from 'src/app/services/attachments.service';
|
|||||||
import { Attachment } from 'src/app/models/attachment.model';
|
import { Attachment } from 'src/app/models/attachment.model';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||||
|
import { ModalController, NavParams } from '@ionic/angular';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-attachments',
|
selector: 'app-attachments',
|
||||||
@@ -16,19 +17,12 @@ export class AttachmentsPage implements OnInit {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private attachamentsService: AttachmentsService,
|
private attachamentsService: AttachmentsService,
|
||||||
private activatedRoute: ActivatedRoute,
|
|
||||||
private iab: InAppBrowser,
|
private iab: InAppBrowser,
|
||||||
private route: Router) { }
|
private modalCtrl: ModalController,
|
||||||
|
private navParams: NavParams) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
/* Emit new data when something changes */
|
this.loadAttachments(this.navParams.get('eventId'));
|
||||||
this.activatedRoute.paramMap.subscribe(paramMap =>{
|
|
||||||
if(!paramMap.has('eventId')){
|
|
||||||
//Redirect
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.loadAttachments(paramMap.get('eventId'));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
loadAttachments(eventid:string)
|
loadAttachments(eventid:string)
|
||||||
@@ -45,9 +39,8 @@ export class AttachmentsPage implements OnInit {
|
|||||||
const browser = this.iab.create(url,"_blank");
|
const browser = this.iab.create(url,"_blank");
|
||||||
browser.show();
|
browser.show();
|
||||||
}
|
}
|
||||||
|
close(){
|
||||||
navigateBack(){
|
this.modalCtrl.dismiss(null);
|
||||||
this.route.navigate(['/home/events',this.pageId]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -137,9 +137,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="loadedEventAttachments.length > 1">
|
<div *ngIf="loadedEventAttachments.length > 1">
|
||||||
<!-- <ion-button class="see-more-button" fill="none" shape="round" [routerLink]="['/home/attachments', loadedEvent.EventId]">
|
<ion-button class="see-more-button" fill="none" shape="round" (click)="openAttachments()"><!-- [routerLink]="['/home/attachments', loadedEvent.EventId]" -->
|
||||||
<ion-label color="secondary">Ver mais...</ion-label>
|
<ion-label color="secondary">Ver mais...</ion-label>
|
||||||
</ion-button> -->
|
</ion-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Skeleton Attachment -->
|
<!-- Skeleton Attachment -->
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { Attachment } from 'src/app/models/attachment.model';
|
|||||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||||
import { FormGroup, FormBuilder, Validators } from "@angular/forms";
|
import { FormGroup, FormBuilder, Validators } from "@angular/forms";
|
||||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||||
|
import { AttachmentsPage } from '../attachments/attachments.page';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -208,4 +209,27 @@ export class EventDetailPage implements OnInit {
|
|||||||
navigateTo(ev){
|
navigateTo(ev){
|
||||||
this.route.navigate(['/home/events',ev]);
|
this.route.navigate(['/home/events',ev]);
|
||||||
}
|
}
|
||||||
|
async openAttachments(){
|
||||||
|
const modal = await this.modalCtrl.create({
|
||||||
|
component: AttachmentsPage,
|
||||||
|
componentProps: {
|
||||||
|
eventId: this.pageId,
|
||||||
|
attachments: this.loadedEventAttachments
|
||||||
|
},
|
||||||
|
cssClass: 'attachments',
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
|
||||||
|
modal.onDidDismiss().then((data) => {
|
||||||
|
if (data['data'] != null)
|
||||||
|
{
|
||||||
|
let newattendees: EventPerson[] = data['data'];
|
||||||
|
this.loadedEvent.Attendees = newattendees;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user