forked from PnX-SI/GeoNature
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
511 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 0 additions & 90 deletions
90
frontend/src/app/GN2CommonModule/form/media/display-medias.component.html
This file was deleted.
Oops, something went wrong.
91 changes: 0 additions & 91 deletions
91
frontend/src/app/GN2CommonModule/form/media/display-medias.component.ts
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
frontend/src/app/GN2CommonModule/form/media/media-card.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<mat-card class="MediaCard"> | ||
<mat-card-title class="MediaCard__title"> | ||
{{ media.title_fr }} | ||
</mat-card-title> | ||
<mat-card-content class="MediaCard__content"> | ||
<pnx-media-item | ||
[inputMedia]="media" | ||
[diaporamaMedia]="diaporamaMedia" | ||
></pnx-media-item> | ||
</mat-card-content> | ||
<mat-card-footer class="MediaCard__footer"> | ||
<div> | ||
<a | ||
*ngIf="href" | ||
target="_blank" | ||
class="link-media float-right" | ||
[href]="href" | ||
> | ||
<mat-icon matTooltip="{{ 'Media.link' | translate }}">link</mat-icon> | ||
</a> | ||
{{ media.description_fr }} | ||
</div> | ||
<div>({{ type }}, {{ media.author }})</div> | ||
</mat-card-footer> | ||
</mat-card> |
19 changes: 19 additions & 0 deletions
19
frontend/src/app/GN2CommonModule/form/media/media-card.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.MediaCard { | ||
display: flex; | ||
flex-flow: column; | ||
justify-content: flex-start; | ||
height: inherit; | ||
max-height: inherit; | ||
max-width: 100%; | ||
border: none; | ||
box-shadow: none; | ||
|
||
&__content { | ||
display: block; | ||
max-height: 100%; | ||
height: 100%; | ||
|
||
overflow: auto; | ||
padding: 0; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
frontend/src/app/GN2CommonModule/form/media/media-card.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import { Media } from './media'; | ||
import { MediaService } from '@geonature_common/service/media.service'; | ||
import { ConfigService } from '@geonature/services/config.service'; | ||
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'; | ||
import { MediaType } from './media-type'; | ||
|
||
@Component({ | ||
selector: 'pnx-media-card', | ||
templateUrl: './media-card.component.html', | ||
styleUrls: ['./media-card.component.scss'], | ||
}) | ||
export class MediaCard { | ||
media: Media; | ||
href: string | false; | ||
type: MediaType; | ||
|
||
@Input() | ||
set inputMedia(media: any) { | ||
if (!(media instanceof Media)) { | ||
this.media = new Media(media); | ||
} else { | ||
this.media = media; | ||
} | ||
this.href = this.media.href(this.config.API_ENDPOINT, this.config.MEDIA_URL); | ||
this.type = this.ms.typeMedia(this.media); | ||
} | ||
|
||
@Input() | ||
diaporamaMedia: Array<any> | null = null; | ||
|
||
constructor( | ||
public ms: MediaService, | ||
public config: ConfigService, | ||
public _sanitizer: DomSanitizer | ||
) {} | ||
} |
Oops, something went wrong.