File
Implements
Index
Properties
|
|
Methods
|
|
Inputs
|
|
Constructor
constructor(resourceService: ResourceService, activatedRoute: ActivatedRoute)
|
|
Parameters :
Name |
Type |
Optional |
resourceService |
ResourceService
|
No
|
activatedRoute |
ActivatedRoute
|
No
|
|
Methods
getTelemetryInteractObject
|
getTelemetryInteractObject()
|
|
|
showContentCreditsPopup
|
showContentCreditsPopup()
|
|
|
Public
collectionId
|
Type : string
|
|
Public
collectionMeta
|
Type : any
|
Default value : {}
|
|
contributionsLength
|
Type : number
|
|
getTelemetryInteractEdata
|
Default value : () => {...}
|
|
showContentCreditsModal
|
Type : boolean
|
|
import { Component, OnInit, Input } from '@angular/core';
import { ResourceService } from '@sunbird/shared';
import { ActivatedRoute } from '@angular/router';
import * as _ from 'lodash-es';
import { ContentData } from '@sunbird/shared';
@Component({
selector: 'app-collection-player-metadata',
templateUrl: './collection-player-metadata.component.html',
styleUrls: ['./collection-player-metadata.component.scss']
})
export class CollectionPlayerMetadataComponent implements OnInit {
@Input() metaData: ContentData;
instance: string;
public collectionMeta: any = {};
public collectionId: string;
contributions: string;
contributionsLength: number;
showContentCreditsModal: boolean;
constructor(public resourceService: ResourceService, private activatedRoute: ActivatedRoute) { }
ngOnInit() {
this.instance = _.upperCase(this.resourceService.instance);
this.activatedRoute.params.subscribe((params) => {
this.collectionId = params.collectionId;
});
}
showContentCreditsPopup () {
this.showContentCreditsModal = true;
}
getTelemetryInteractEdata = ({id, type = 'click'}) => ({id, type, pageid: 'collection-player'});
getTelemetryInteractObject() {
return {
id: this.collectionId,
type: _.get(this.metaData, 'contentType'),
ver: this.metaData.pkgVersion ? this.metaData.pkgVersion.toString() : '1.0'
};
}
}
<div *ngIf="metaData" class="ui divider mt-24"> </div>
<div *ngIf="metaData" class="collection-player-metadata sb-meta-data-container sb-meta-data-column d-flex flex-w-wrap mt-24">
<dl class="sb-meta-data" *ngIf="metaData.author">
<dt>{{resourceService?.frmelmnts?.lbl?.author}}</dt>
<dd>{{metaData.author}}</dd>
</dl>
<dl class="sb-meta-data" *ngIf="metaData.medium">
<dt>{{resourceService?.frmelmnts?.lbl?.medium | transposeTerms: 'frmelmnts.lbl.medium' : resourceService?.selectedLang}}</dt>
<dd>{{metaData.medium}}</dd>
</dl>
<dl class="sb-meta-data" *ngIf="metaData.gradeLevel">
<dt>{{resourceService?.frmelmnts?.lbl?.class | transposeTerms: 'frmelmnts.lbl.class' : resourceService?.selectedLang}}</dt>
<dd>
<span class="d-inline-block" *ngFor="let gradeLevel of metaData.gradeLevel; let isLast=last;">
{{gradeLevel}}<span *ngIf="!isLast">, </span>
</span>
</dd>
</dl>
<dl class="sb-meta-data" *ngIf="metaData.subject">
<dt>{{resourceService?.frmelmnts?.lbl?.subject | transposeTerms: 'frmelmnts.lbl.subject': resourceService?.selectedLang}}</dt>
<dd>{{metaData.subject}}</dd>
</dl>
<dl class="sb-meta-data" *ngIf="metaData.lastUpdatedOn">
<dt>{{resourceService?.frmelmnts?.lbl?.lastupdate}}</dt>
<dd>{{metaData.lastUpdatedOn | dateFormat: 'MMMM Do YYYY'}}</dd>
</dl>
<dl class="sb-meta-data" *ngIf="metaData.createdOn">
<dt>{{resourceService?.frmelmnts?.lbl?.createdon}}</dt>
<dd>{{metaData.createdOn | dateFormat: 'MMMM Do YYYY'}}</dd>
</dl>
<dl class="sb-meta-data">
<dt>{{resourceService.frmelmnts?.lbl?.createdInstanceName | interpolate:'{instance}': instance}}</dt>
<dd *ngIf="metaData.creator">{{metaData.creator}}</dd>
</dl>
<dl class="sb-meta-data">
<dt>{{resourceService.frmelmnts.lbl?.licenseTerms}}</dt>
<dd *ngIf="metaData && !(metaData.licenseDetails && metaData.licenseDetails['name']) && metaData.license">{{metaData.license}}‎</dd>
<dd *ngIf="metaData && metaData.licenseDetails && metaData.licenseDetails['name']">{{metaData.licenseDetails['name']}} {{metaData.licenseDetails['description']}}‎ <br /><a href="{{metaData.licenseDetails['url']}}" target="_blank">{{metaData.licenseDetails['url']}}</a></dd>
</dl>
<dl class="sb-meta-data" *ngIf="metaData.orgDetails && metaData.orgDetails.orgName">
<dt>{{resourceService.frmelmnts.lbl?.publishedOnInstanceName | interpolate:'{instance}': instance}}</dt>
<dd>
<span class="d-inline-block mr-20">{{metaData?.organisation?.join(', ')}}</span>
<a ng-if="metaData.orgDetails?.email" href="mailto:{{metaData.orgDetails?.email}}?subject={{metaData.name}}">{{metaData.orgDetails?.email}}</a>
</dd>
</dl>
<dl class="sb-meta-data">
<dt>{{resourceService.frmelmnts?.lbl?.contentCredits}}</dt>
<dd appTelemetryInteract [telemetryInteractObject]="getTelemetryInteractObject()" [telemetryInteractEdata]= "getTelemetryInteractEdata({id: 'view-credits'})">
<a tabindex="0" (click)="showContentCreditsPopup()" title="{{resourceService.frmelmnts.lbl.contentCredits}}" class="cursor-pointer text-underline">{{resourceService.frmelmnts?.lbl?.view}}</a>
</dd>
</dl>
</div>
<div *ngIf="metaData && metaData.originData" class="ui divider my-24"></div>
<h4 *ngIf="metaData && metaData.originData" class="sb-section-title mb-16 d-block">{{resourceService.frmelmnts?.lbl?.contentcopiedtitle}}</h4>
<div *ngIf="metaData && metaData.originData" class="sb-meta-data-container sb-meta-data-column d-flex flex-w-wrap">
<dl class="sb-meta-data" *ngIf="metaData.originData.name">
<dt>{{resourceService.frmelmnts?.lbl?.contenttype}}</dt>
<dd>{{metaData.originData.name}}</dd>
</dl>
<dl class="sb-meta-data" *ngIf="metaData.originData.author">
<dt>{{resourceService.frmelmnts.lbl?.originalAuthor}}</dt>
<dd *ngIf="metaData.creator">{{metaData.originData.author}}</dd>
</dl>
<dl class="sb-meta-data" *ngIf="metaData.originData.license">
<dt>{{resourceService.frmelmnts.lbl?.licenseTerms}}</dt>
<dd *ngIf="metaData.creator">{{metaData.originData.license}}‎</dd>
</dl>
<dl class="sb-meta-data" *ngIf="metaData.originData.organisation">
<dt>{{resourceService.frmelmnts.lbl?.publishedOnInstanceName | interpolate:'{instance}': instance}}</dt>
<dd>
<span class="d-inline-block mr-20">{{metaData.originData.organisation.join(', ')}}</span>
<a ng-if="metaData.orgDetails?.email" href="mailto:{{metaData.orgDetails?.email}}?subject={{metaData.name}}">{{metaData.originData.orgDetails?.email}}</a>
</dd>
</dl>
</div>
<app-content-credits [contentData]="metaData" *ngIf="showContentCreditsModal" (close)="showContentCreditsModal = false">
</app-content-credits>
@use "@project-sunbird/sb-styles/assets/mixins/mixins" as *;
@use 'components/metadata' as *;
Legend
Html element with directive