superdesk/superdesk-client-core

View on GitHub
scripts/apps/desks/views/content-expiry.html

Summary

Maintainability
Test Coverage
<span ng-if="preview && contentExpiry.expire">
    <span ng-if="!contentExpiry.actualExpiry">{{contentExpiry.header | translate}}
    {{ contentExpiry.days}} <span class="helper-text" translate>day</span>
    {{ contentExpiry.hours}} <span class="helper-text" translate>hr</span>
    {{ contentExpiry.minutes}} <span class="helper-text" translate>min</span>
    </span>
    <span ng-if="contentExpiry.actualExpiry">
        {{contentExpiry.actualExpiry.text | translate}} {{contentExpiry.actualExpiry.expiry | translate}}
    </span>
</span>

<label ng-if="preview && !contentExpiry.expire">{{contentExpiry.header | translate}}
  {{contentExpiry.actualExpiry.text | translate}} {{contentExpiry.actualExpiry.expiry | translate}}
</label>

<div ng-if="!preview && contentExpiry.expire" class="form__row">
    <div class="">
        <span sd-switch ng-model="contentExpiry.expire"></span>
        <label class="inline-label">{{contentExpiry.header | translate}}
            <span class="label label--primary label--hollow"
                  ng-if="contentExpiry.actualExpiry"
                  title="{{ contentExpiry.actualExpiry.expiry | translate}}">{{ contentExpiry.actualExpiry.text | translate }}</span>
        </label>
    </div>
    <div class="form__row form__row--flex form__row--no-padding">
        <div class="form__row-item form__row-item--no-grow">
            <div class="sd-line-input sd-line-input--no-margin">
                <input class="sd-line-input__input sd-line-input__input--mini" type="number" ng-model="contentExpiry.days" min ="0" required>
            </div>
        </div>
        <div class="form__row-item form__row-item--no-grow">
            <span class="" translate>days</span>
        </div>
        <div class="form__row-item form__row-item--no-grow">
            <div class="sd-line-input sd-line-input--no-margin">
                <input class="sd-line-input__input sd-line-input__input--mini" type="number" ng-model="contentExpiry.hours" min ="0" max="23" required>
            </div>
        </div>
        <div class="form__row-item form__row-item--no-grow">
            <span class="" translate>hr</span>
        </div>
        <div class="form__row-item form__row-item--no-grow">
            <div class="sd-line-input sd-line-input--no-margin">
                <input class="sd-line-input__input sd-line-input__input--mini" type="number" ng-model="contentExpiry.minutes" min ="0" max="59" required>
            </div>
        </div>
        <div class="form__row-item form__row-item--no-grow">
            <span class="" translate>min</span>
        </div>
    </div>
</div>


<div ng-if="!preview && !contentExpiry.expire" class="form__row">
    <div class="form__row-item" style="padding-bottom: 1.4rem;">
        <span sd-switch ng-model="contentExpiry.expire"></span>
        <label class="inline-label">{{contentExpiry.header | translate}}
            <span class="label label--primary label--hollow"
                  ng-if="contentExpiry.actualExpiry"
                  title="{{ contentExpiry.actualExpiry.expiry | translate}}">{{ contentExpiry.actualExpiry.text | translate }}</span>
        </label>
    </div>
</div>