change button

This commit is contained in:
Peter Maquiran
2024-01-18 17:17:03 +01:00
parent c862ab9ad7
commit 888467f3de
7 changed files with 101 additions and 53 deletions
@@ -8,13 +8,14 @@ import { NewPublicationPageRoutingModule } from './new-publication-routing.modul
import { NewPublicationPage } from './new-publication.page';
import '@teamhive/capacitor-video-recorder';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
NewPublicationPageRoutingModule
NewPublicationPageRoutingModule,
FontAwesomeModule,
],
exports: [NewPublicationPage],
declarations: [NewPublicationPage]
@@ -32,20 +32,22 @@
<div class="d-flex justify-content-between">
<div class="d-flex">
<div *ngFor="let seleted of seletedContent.slice(0, displayLimit), let i = index" lot="start">
<div *ngFor="let seleted of seletedContent.slice(0, displayLimit), let i = index" lot="start" class="mr-10">
<div class="text-center cursor-pointer" (click)="deleteFromSeletedContent(i)" style="font-weight: 700;color: #c63527;">
X
</div>
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'" [(ngModel)]="capturedImage"
name="image" ngDefaultControl [src]="'data:image/jpg;base64,' + seleted.FileBase64"
(click)="imageSize(capturedImage)"></ion-img>
(click)="imageSize(capturedImage)" style="height: 69px;"></ion-img>
<video *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video'" width="70" height="70"
controls="controls" preload="metadata" autoplay="autoplay" webkit-playsinline="webkit-playsinline">
<source type="video/mp4" [src]="'data:video/mp4;base64,' + seleted.FileBase64">
</video>
<div class="text-center cursor-pointer" (click)="deleteFromSeletedContent(i)">
<ion-icon src="assets/images/theme/gov/icons-delete.svg" class="delete md hydrated"></ion-icon>
</div>
</div>
<!-- Display the blurred image and count if there are more images -->
@@ -80,7 +82,7 @@
</div>
</div> -->
<div class="ion-item-container-no-border">
<div class="ion-item-container-no-border pt-10">
<ion-label (click)="chossePhotoOrVideo()">
<div class="attach-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' "
@@ -94,7 +96,7 @@
</div>
</ion-label>
</div>
<div *ngIf="photoOrVideo" class="container-multiselect">
<div *ngIf="photoOrVideo" class="container-multiselect pt-10">
<button id="container-multiselect" class="multiselect-button" (click)="takePicture()">Fotografia</button>
<button id="container-multiselect" class="multiselect-button" (click)="startVideoRecording()">Video</button>
</div>
+8
View File
@@ -238,6 +238,14 @@ GetIdsPublicationNext(id:any){
/* params: params */
};
body.Files = body.Files.map( e => ({
FileBase64: e.FileBase64,
FileExtension: e.FileExtension,
OriginalFileName: 'foto'
}))
return this.http.put<any>(`${geturl}`, body, options)
}
@@ -7,13 +7,17 @@ import { IonicModule } from '@ionic/angular';
import { NewPublicationPageRoutingModule } from './new-publication-routing.module';
import { NewPublicationPage } from './new-publication.page';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
NewPublicationPageRoutingModule
NewPublicationPageRoutingModule,
MatProgressBarModule,
FontAwesomeModule,
],
exports: [NewPublicationPage],
declarations: [NewPublicationPage]
@@ -43,22 +43,39 @@
<div *ngIf="seletedContent.length > 0">
<ion-label class="attached-title pb-10">Anexos</ion-label>
<div>
<div class="d-flex">
<div class="d-flex" >
<div *ngFor="let seleted of seletedContent.slice(0, displayLimit), let i = index" lot="start" class="mr-10">
<div>
<div class="text-center cursor-pointer" (click)="deleteFromSeletedContent(i)" style="font-weight: 700;color: #c63527;">
X
</div>
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'"
name="image" ngDefaultControl [src]="seleted.FileBase64" style="width: 50px;"></ion-img>
name="image" ngDefaultControl [src]="seleted.FileBase64" style="height: 69px;"></ion-img>
<!-- <div class="progress-container" *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video'">
<div class="progress-bar" id="myProgressBar"></div>
</div> -->
<!-- <div *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video'">
<mat-progress-bar
*ngIf="seleted.chucksManager"
mode="determinate"
style="width: 50%"
></mat-progress-bar>
</div> -->
<video *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video'" width="70" height="70"
preload="metadata" webkit-playsinline="webkit-playsinline">
<source type="video/mp4" [src]="seleted.FileBase64">
</video>
<div class="text-center cursor-pointer" (click)="deleteFromSeletedContent(i)">
<ion-icon src="assets/images/theme/gov/icons-delete.svg" class="delete md hydrated"></ion-icon>
</div>
</div>
@@ -156,3 +156,24 @@ font-size: rem(25);
display: block;
}
.progress-container {
width: 50%;
background-color: #f1f1f1;
border: 1px solid #ddd;
border-radius: 5px;
overflow: hidden;
}
.progress-bar {
width: 0;
height: 30px;
background-color: #4caf50;
text-align: center;
line-height: 30px;
color: white;
}
@@ -401,12 +401,8 @@ export class NewPublicationPage implements OnInit {
}
let a = this.publication
this.publicationFormMV.setDataToFrom(a)
this.publicationFormMV.uploadVideosFiles()
// this.publicationFormMV.setDataToFrom(this.publication)
// this.publicationFormMV.uploadVideosFiles()
this.publication.Files = this.publication.Files.map( e => ({
FileBase64: e.FileBase64,
@@ -414,7 +410,6 @@ export class NewPublicationPage implements OnInit {
OriginalFileName: 'foto'
}))
const loader = this.toastService.loading()
try {