mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -5,7 +5,7 @@ import { FormsModule } from '@angular/forms';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { HomePageRoutingModule } from './home-routing.module';
|
||||
|
||||
import { LazyLoadImageModule } from 'ng-lazyload-image';
|
||||
import { HomePage } from './home.page';
|
||||
/* import { IonicSelectableModule } from 'ionic-selectable'; */
|
||||
|
||||
@@ -15,6 +15,7 @@ import { HomePage } from './home.page';
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
HomePageRoutingModule,
|
||||
LazyLoadImageModule
|
||||
],
|
||||
declarations: [HomePage],
|
||||
})
|
||||
|
||||
@@ -10,8 +10,16 @@ import { ViewPublicationsPage } from './view-publications.page';
|
||||
|
||||
import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||
|
||||
import { LazyLoadImageModule } from 'ng-lazyload-image'; // <-- import it
|
||||
import { Attributes, IntersectionObserverHooks, LazyLoadImageModule, LAZYLOAD_IMAGE_HOOKS } from 'ng-lazyload-image'; // <-- import it
|
||||
|
||||
export class LazyLoadImageHooks extends IntersectionObserverHooks {
|
||||
setup(attributes: Attributes) {
|
||||
attributes.offset = 10;
|
||||
attributes.defaultImagePath = "/assets/icon/icon-no-image.svg";
|
||||
attributes.errorImagePath = "/assets/icon/icon-no-image.svg";
|
||||
return super.setup(attributes);
|
||||
}
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -24,6 +32,7 @@ import { LazyLoadImageModule } from 'ng-lazyload-image'; // <-- import it
|
||||
LazyLoadImageModule
|
||||
],
|
||||
exports: [ViewPublicationsPage],
|
||||
declarations: [ViewPublicationsPage]
|
||||
declarations: [ViewPublicationsPage],
|
||||
providers: [{provide: LAZYLOAD_IMAGE_HOOKS, useClass: LazyLoadImageHooks}]
|
||||
})
|
||||
export class ViewPublicationsPageModule {}
|
||||
|
||||
@@ -26,25 +26,44 @@
|
||||
</ion-header>
|
||||
|
||||
<ion-content class="background-white">
|
||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<!-- <ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<div class="main-container background-white height-100 overflow-y-auto">
|
||||
<ion-list>
|
||||
<!-- [routerLink]="['/home/publications/view-publications/publication-detail', publication.publicationId]" -->
|
||||
</ion-refresher> -->
|
||||
<div class="main-container background-white height-100 overflow-y-auto">
|
||||
<ion-content>
|
||||
<ion-card *ngFor="let publication of getpublication let i = index">
|
||||
<ion-card-content>
|
||||
<div class="post-img">
|
||||
<img [lazyLoad]="publication.FileBase64">
|
||||
</div>
|
||||
<div class="post-content px-20">
|
||||
<div class="post-title-time">
|
||||
<div class="post-title">
|
||||
<ion-label>{{publication.Title}}</ion-label>
|
||||
</div>
|
||||
<div class="post-data">{{publication.DatePublication | date: 'dd-MM-yy | HH:mm'}}</div>
|
||||
</div>
|
||||
<div class="post-description">
|
||||
<p>{{publication.Message}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
</ion-content>
|
||||
<!-- <ion-list>
|
||||
<div class="post-item cursor-pointer"
|
||||
*ngFor="let publication of getpublication"
|
||||
(click)="goToPublicationDetail(publication.DocumentId)"
|
||||
>
|
||||
<div *ngIf="publication.FileBase64 != null">
|
||||
<div *ngIf="publication.FileBase64.length < 30; else imageLoaded" class="post-img">
|
||||
<img src="/assets/icon/icon-no-image.svg">
|
||||
</div>
|
||||
|
||||
<div class="post-img">
|
||||
<img [defaultImage]=defaultImage [lazyLoad]="publication.FileBase64">
|
||||
|
||||
<ng-template #imageLoaded>
|
||||
<div *ngIf="publication.FileBase64.length > 30" class="post-img">
|
||||
<img src="{{publication.FileBase64}}" alt="">
|
||||
<img [defaultImage]=defaultImage [lazyLoad]="publication.FileBase64">
|
||||
</div>
|
||||
</ng-template>
|
||||
</div>
|
||||
@@ -92,6 +111,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-list>
|
||||
</ion-list> -->
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
@@ -11,6 +11,7 @@ import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { forkJoin } from 'rxjs';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-publications',
|
||||
@@ -23,7 +24,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
publicationList: Publication[] = new Array();
|
||||
item: PublicationFolder;
|
||||
defaultImage = "https://governo.gov.ao/ao/noticias/presidente-joao-lourenco-ouviu-a-voz-da-igreja/"
|
||||
defaultImage = "/assets/icon/icon-no-image.svg";
|
||||
folderId: string;
|
||||
id: string;
|
||||
error: any;
|
||||
@@ -40,7 +41,8 @@ export class ViewPublicationsPage implements OnInit {
|
||||
private router: Router,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService) {
|
||||
public ThemeService: ThemeService,
|
||||
private toastService: ToastService,) {
|
||||
|
||||
this.item = new PublicationFolder();
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
@@ -64,7 +66,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.getPublicationDetail();
|
||||
this.getPublicationsIds();
|
||||
/* setTimeout(() => {
|
||||
this.getPublicationsIds();
|
||||
this.getPublications();
|
||||
}, 1000); */
|
||||
|
||||
this.backgroundservice.registerBackService('Online', () => {
|
||||
@@ -86,7 +88,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
// }
|
||||
//this.testForkJoin()
|
||||
//this.getPublicationDetail();
|
||||
// this.getPublicationsIds();
|
||||
// this.getPublications();
|
||||
}
|
||||
|
||||
doRefresh = (event) => {
|
||||
@@ -258,7 +260,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
});
|
||||
|
||||
this.getpublication = publicationArray;
|
||||
this.publicationList = publicationArray;
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -79,6 +79,10 @@ export class MessageService {
|
||||
}
|
||||
}
|
||||
|
||||
// if(typeof(this.file?.type)) {
|
||||
// this.hasFile = true
|
||||
// }
|
||||
|
||||
if(this.hasFile) {
|
||||
this.getFileFromDb()
|
||||
if(this.file.type != 'application/webtrix') {
|
||||
@@ -178,6 +182,7 @@ export class MessageService {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
redefinedMessage(ChatMessage) {
|
||||
|
||||
@@ -6,15 +6,27 @@ import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { ViewPublicationsPageRoutingModule } from './view-publications-routing.module';
|
||||
import { ViewPublicationsPage } from './view-publications.page';
|
||||
import { Attributes, IntersectionObserverHooks, LazyLoadImageModule, LAZYLOAD_IMAGE_HOOKS } from 'ng-lazyload-image';
|
||||
|
||||
export class LazyLoadImageHooks extends IntersectionObserverHooks {
|
||||
setup(attributes: Attributes) {
|
||||
attributes.offset = 10;
|
||||
attributes.defaultImagePath = "/assets/icon/icon-no-image.svg";
|
||||
attributes.errorImagePath = "/assets/icon/icon-no-image.svg";
|
||||
return super.setup(attributes);
|
||||
}
|
||||
}
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ViewPublicationsPageRoutingModule
|
||||
ViewPublicationsPageRoutingModule,
|
||||
LazyLoadImageModule
|
||||
],
|
||||
exports: [ViewPublicationsPage],
|
||||
declarations: [ViewPublicationsPage]
|
||||
declarations: [ViewPublicationsPage],
|
||||
providers: [{provide: LAZYLOAD_IMAGE_HOOKS, useClass: LazyLoadImageHooks}]
|
||||
})
|
||||
export class ViewPublicationsPageModule {}
|
||||
|
||||
@@ -39,7 +39,27 @@
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<div class="main-container px-20">
|
||||
<ion-list>
|
||||
<ion-content>
|
||||
<ion-card *ngFor="let publication of publicationList let i = index">
|
||||
<ion-card-content>
|
||||
<div class="post-img">
|
||||
<img [lazyLoad]="publication.FileBase64">
|
||||
</div>
|
||||
<div class="post-content px-20">
|
||||
<div class="post-title-time">
|
||||
<div class="post-title">
|
||||
<ion-label>{{publication.Title}}</ion-label>
|
||||
</div>
|
||||
<div class="post-data">{{publication.DatePublication | date: 'dd-MM-yy | HH:mm'}}</div>
|
||||
</div>
|
||||
<div class="post-description">
|
||||
<p>{{publication.Message}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
</ion-content>
|
||||
<!-- <ion-list>
|
||||
<div class="post-item d-md-block mb-10 cursor-pointer"
|
||||
*ngFor="let publication of publicationList"
|
||||
(click)="viewPublicationDetail(publication.DocumentId)">
|
||||
@@ -65,7 +85,7 @@
|
||||
<div class="center height-100" *ngIf="!publicationList">
|
||||
<p>{{error}}</p>
|
||||
</div>
|
||||
</ion-list>
|
||||
</ion-list> -->
|
||||
</div>
|
||||
<!-- fab placed to the bottom end -->
|
||||
<ion-fab vertical="bottom" horizontal="end">
|
||||
|
||||
@@ -137,7 +137,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
getFromDB() {
|
||||
this.storage.get('view_publications').then((viewPublications) => {
|
||||
this.getpublication = viewPublications;
|
||||
this.publicationList = viewPublications;
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -116,6 +116,7 @@ $app-theme: mat-light-theme(
|
||||
--ion-color-expediente: #dae3f3;
|
||||
}
|
||||
|
||||
// dark-mode
|
||||
@media (prefers-color-scheme: dark) {
|
||||
/*
|
||||
* Dark Colors
|
||||
|
||||
Reference in New Issue
Block a user