superdesk/superdesk-client-core

View on GitHub
scripts/apps/archive/views/metadata-view.html

Summary

Maintainability
Test Coverage
<div class="metadata-view">

    <div ng-if="!loading" class="metadata-view__content-block">
        <dl>
            <dt>{{label('slugline')}}</dt>
            <dd sd-html-preview="item.slugline"></dd>
        </dl>
        <dl>
            <dt>{{label('urgency')}}</dt>
            <dd>{{ item.urgency }}</dd>
        </dl>
        <dl>
            <dt>{{label('priority')}}</dt>
            <dd>{{ item.priority }}</dd>
        </dl>
        <dl>
            <dt translate>Word Count</dt>
            <dd>{{ item.word_count }}</dd>
        </dl>
        <dl ng-if="item.keywords && item.keywords.length">
            <dt>{{label('keywords')}}</dt>
            <dd>{{ item.keywords | mergeWords}}</dd>
        </dl>

        <dl ng-if="item.ingest_provider">
            <dt translate>Ingest Provider</dt>
            <dd sd-meta-ingest data-item="item"></dd>
        </dl>

        <dl ng-if="item.original_source">
            <dt translate>Original Source</dt>
            <dd>{{ item.original_source }}</dd>
        </dl>

        <dl ng-if="item.source">
            <dt translate>Source</dt>
            <dd>{{ item.source }}</dd>
        </dl>

        <dl>
            <dt>{{label('anpa_take_key')}}</dt>
            <dd>{{ item.anpa_take_key }}</dd>
        </dl>
        <dl ng-if="item.signal">
            <dt translate>Signal</dt>
            <dd ng-repeat="signal in item.signal">{{ signal.name || signal.qcode }}</dd>
        </dl>
        <dl ng-if="item.anpa_category && item.anpa_category.length">
            <dt>{{label('anpa_category')}}</dt>
            <dd>{{ item.anpa_category | mergeWords:'name' }}</dd>
        </dl>
        <dl ng-repeat="cv in cvs track by cv._id" ng-if="item[cv.schema_field] | mergeWords:'name' : cv._id">
            <dt>{{ cv.display_name | translate }}</dt>
            <dd ng-show="getTermsTranslations(item[cv.schema_field], cv._id).length === 0" translate>None</dd>
            <dd ng-repeat="item in getTermsTranslations(item[cv.schema_field], cv._id)">{{item}}</dd>
        </dl>
        <dl ng-if="item.genre  && item.genre.length > 0 && !genreInCvs">
            <dt>{{label('genre')}}</dt>
            <dd>{{ item.genre | mergeWords:'name'}}</dd>
        </dl>
        <dl ng-if="item.place && item.place.length > 0 && !placeInCvs">
            <dt>{{label('place')}}</dt>
            <dd>{{ item.place | mergeWords:'name'}}</dd>
        </dl>
        <dl ng-if="item.ednote">
            <dt>{{label('ednote')}}</dt>
            <dd>{{ item.ednote }}</dd>
        </dl>
        <dl>
            <dt>{{label('dateline')}}</dt>
            <dd>{{ item.dateline.text }}</dd>
        </dl>
        <dl>
            <dt>{{label('byline')}}</dt>
            <dd>{{ item.byline }}</dd>
        </dl>
        <dl>
            <dt>{{label('sign_off')}}</dt>
            <dd>{{ item.sign_off }}</dd>
        </dl>
    </div>

    <div class="metadata-view__content-block">
        <dl ng-if="item._current_version">
            <dt translate>Version</dt>
            <dd>{{ item._current_version }}</dd>
        </dl>
        <dl ng-if="item.firstcreated">
            <dt translate>Created</dt>
            <dd sd-reldate-complex datetime="item.firstcreated"></dd>
        </dl>
        <dl ng-if="item.versioncreated">
            <dt translate>Last updated</dt>
            <dd sd-reldate-complex datetime="item.versioncreated"></dd>
        </dl>

        <dl ng-if="item.expiry">
            <dt translate>Expiry</dt>
            <dd sd-reldate-complex datetime="item.expiry"></dd>
        </dl>
        <dl ng-if="item.original_id">
            <dt translate>Original ID</dt>
            <dd>{{ item.original_id }}</dd>
        </dl>
        <dl ng-if="originalCreator">
            <dt translate>Original creator</dt>
            <dd>{{ originalCreator }}</dd>
        </dl>
        <dl ng-if="versionCreator">
            <dt translate>Version creator</dt>
            <dd>{{ versionCreator }}</dd>
        </dl>
    </div>

    <div class="metadata-view__content-block">
        <!-- Story details -->
        <dl ng-if="item.language">
            <dt translate>Language</dt>
            <dd>{{ item.language }}</dd>
        </dl>

        <dl>
            <dt translate>PubStatus</dt>
            <dd ng-if="item.pubstatus">{{ item.pubstatus }}</dd>
        </dl>

        <dl ng-if="item.ingest_provider_sequence">
            <dt translate>Ingest provider sequence</dt>
            <dd>{{ item.ingest_provider_sequence }}</dd>
        </dl>
        <dl ng-if="item.embargo">
            <dt translate>Embargo Timestamp</dt>
            <dd sd-reldate-complex data-useutc="false" datetime="item.embargo"></dd>
        </dl>
        <!-- publish schedule data -->
        <dl ng-if="item.publish_schedule">
            <dt translate>Publish Schedule</dt>
            <dd sd-reldate-complex data-useutc="false" datetime="item.publish_schedule"></dd>
        </dl>
        <dl ng-if="item.schedule_settings && (item.publish_schedule || item.embargo)">
            <dt translate>Time Zone</dt>
            <dd>{{ item.schedule_settings.time_zone || 'UTC'}}</dd>
        </dl>

        <dl ng-if="item.target_subscribers">
            <dt translate>Target Subscribers</dt>
            <dd>{{item.target_subscribers | mergeTargets}}</dd>
        </dl>

        <dl ng-if="item.target_regions && item.target_regions.length > 0">
            <dt translate>Target Regions</dt>
            <dd>{{item.target_regions | mergeTargets}}</dd>
        </dl>

        <dl ng-if="item.target_types && item.target_types.length > 0">
            <dt translate>Target Subscriber Types</dt>
            <dd>{{item.target_types | mergeTargets}}</dd>
        </dl>

        <!-- file specific data -->
        <dl ng-if="item.FileMeta">
            <dt translate>Aperture</dt><dd>{{ item.FileMeta.Aperture }}</dd>
            <dt translate>Exposure time</dt><dd>{{ item.FileMeta['Exposure time'] }}</dd>
            <dt translate>Focal length</dt><dd>{{ item.FileMeta['Focal length'] }}</dd>
            <dt translate>Iso</dt><dd>{{ item.FileMeta['ISO speed'] }}</dd>
            <dt translate>Flash</dt><dd>{{ item.FileMeta.Flash }}</dd>
        </dl>
    </div>

    <div class="metadata-view__content-block" ng-if="item.copyrightholder || item.copyrightholder || item.usageterms">
        <!-- copyright details details -->
        <dl>
            <dt translate>Copyright holder</dt>
            <dd ng-if="item.copyrightholder">{{ item.copyrightholder }}</dd>
        </dl>
        <dl>
            <dt translate>Copyright notice</dt>
            <dd ng-if="item.copyrightnotice">{{ item.copyrightnotice }}</dd>
        </dl>
        <dl>
            <dt translate>Usage terms</dt>
            <dd ng-if="item.usageterms">{{ item.usageterms }}</dd>
        </dl>
    </div>
    
    <div class="metadata-view__content-block">
        <dl>
            <dt translate>State</dt>
            <dd>
                <span sd-item-state data-state=item.state data-embargo=item.embargo
                    data-is-correction-workflow-enabled="isCorrectionWorkflowEnabled"></span>
                <span ng-if="item.flags.marked_for_not_publication" class="state-label not-for-publication" translate>Not For Publication</span>
                <span ng-if="item.flags.marked_for_legal" class="state-label legal" translate>Legal</span>
                <span ng-if="item.flags.marked_for_sms" class="state-label sms" translate>Sms</span>
                <span ng-if="item.rewritten_by" class="state-label updated" translate>Updated</span>
            </dd>
        </dl>
        <dl ng-if="item.guid">
            <dt translate>GUID</dt>
            <dd>{{ item.guid }}</dd>
        </dl>
        <dl ng-if="item.unique_name">
            <dt translate>Unique Name</dt>
            <dd>{{ item.unique_name }}</dd>
        </dl>
        <dl>
            <dt translate>Type</dt>
            <dd>{{ item.type }}</dd>
        </dl>
        <dl ng-if="item.renditions">
            <dt translate>Dimensions</dt>
            <dd>{{ item.renditions.original.width }} x {{ item.renditions.original.height }}</dd>
        </dl>
        <dl ng-if="item.type == 'picture' && item.archive_description && item.archive_description !== item.description_text">
            <dt translate>Description</dt>
            <dd sd-html-preview="item.archive_description"></dd>
        </dl>
    </div>
    <div class="metadata-view__content-block" ng-if="item.associations && item.associations.featuremedia"
         sd-associated-item-metadata
         data-association="item.associations.featuremedia" data-title="Feature Media">
    </div>
</div>