2020-12-01 14:03:15 +01:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
2020-12-01 17:22:45 +01:00
|
|
|
import { ModalController, NavParams } from '@ionic/angular';
|
2020-12-02 15:08:45 +01:00
|
|
|
import { GalleryPage } from '../gallery/gallery.page';
|
2020-12-01 14:03:15 +01:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-new-publication',
|
|
|
|
|
templateUrl: './new-publication.page.html',
|
|
|
|
|
styleUrls: ['./new-publication.page.scss'],
|
|
|
|
|
})
|
|
|
|
|
export class NewPublicationPage implements OnInit {
|
2020-12-01 17:22:45 +01:00
|
|
|
publicationType:string;
|
|
|
|
|
publicationTitle:string;
|
|
|
|
|
constructor(
|
|
|
|
|
private modalController: ModalController,
|
|
|
|
|
private navParams: NavParams,
|
|
|
|
|
) {
|
|
|
|
|
this.publicationType = this.navParams.get('publicationType');
|
|
|
|
|
this.publicationTitle = 'Nova Publicação';
|
|
|
|
|
}
|
2020-12-01 14:03:15 +01:00
|
|
|
|
|
|
|
|
ngOnInit() {
|
2020-12-01 17:22:45 +01:00
|
|
|
this.setTitle();
|
|
|
|
|
}
|
|
|
|
|
save(){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
close(){
|
|
|
|
|
this.modalController.dismiss();
|
|
|
|
|
}
|
|
|
|
|
setTitle(){
|
|
|
|
|
if(this.publicationType == '1'){
|
|
|
|
|
this.publicationTitle = 'Nova Publicação Rápida'
|
|
|
|
|
}
|
2020-12-02 15:08:45 +01:00
|
|
|
else if(this.publicationType == '2'){
|
2020-12-01 17:22:45 +01:00
|
|
|
this.publicationTitle = 'Nova Publicação'
|
|
|
|
|
}
|
2020-12-02 15:08:45 +01:00
|
|
|
else if(this.publicationType == '3'){
|
|
|
|
|
this.publicationTitle = 'Editar Publicação'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async openGallery() {
|
|
|
|
|
const modal = await this.modalController.create({
|
|
|
|
|
component: GalleryPage,
|
|
|
|
|
componentProps:{
|
|
|
|
|
},
|
|
|
|
|
cssClass: 'new-publication',
|
|
|
|
|
backdropDismiss: false
|
|
|
|
|
});
|
|
|
|
|
await modal.present();
|
|
|
|
|
modal.onDidDismiss();
|
2020-12-01 14:03:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|