superdesk/superdesk-client-core

View on GitHub
scripts/apps/archive/views/upload.html

Summary

Maintainability
Test Coverage
<sd-multi-image-edit
    data-is-upload="true"
    data-images-original="imagesMetadata"
    data-validator="validator"
    data-hide-edit-pane="imagesMetadata.length < 1"
    cancel-handler="cancel"
    save-handler="handleImageMetadataEdit"
    get-thumbnail-html="getThumbnailHtml"
    get-icon-for-item-type="getIconForItemType"
    get-progress="getProgress"
    on-remove-item="onRemoveItem"
    upload-in-progress="saving">
    
    <sd-multi-edit-select-desk>
        <div ng-if="deskSelectionAllowed === true && desks !== null" class="dropdown dropdown--boxed" dropdown is-open="isOpen">
            <button class="dropdown__toggle dropdown__toggle--small dropdown__toggle--hollow dropdown-toggle" dropdown__toggle aria-haspopup="true" aria-expanded="false">
                <span class="dropdown__button-label">
                    Send to:</span> <span>{{selectedDesk.name}}</span>
                    <b class="dropdown__caret white"></b>
            </button>
            <!-- TODO: fix dropdown2 component so height adjusts according to available space-->
            <ul class="dropdown__menu dropdown--align-right" style="max-height: 400px; overflow: auto;">
                <li ng-repeat="desk in desks track by desk._id"><button ng-click="selectDesk(desk)">{{desk.name}}</button></li>
            </ul>
        </div>
    </sd-multi-edit-select-desk>

    <sd-multi-edit-additional-content>
        <div class="drag-area"
            ngf-drop="addFiles($files)"
            ngf-multiple="!uniqueUpload"
            ngf-drag="drag($isDragging, $class, $event)">
            <div ng-if="isDragging" class="upload__target" style="display: block"></div>
            <div ng-if="(!items.length) && canUpload()" class="upload__info">
                <div class="upload__info-icon"></div>
                <h3 class="upload__info-heading" translate>Drag Your Files Here</h3>
                <div class="upload__info-label" translate>or</div>
                <button ng-click="invokeImagesInput()" class="btn btn--hollow upload__info-button" translate>Select them from folder</button>
                <input ng-if="uniqueUpload" id="images-input" type="file" ngf-select="addFiles($files)" class="hide" data-test-id="image-upload-input">
                <input ng-if="!uniqueUpload" id="images-input" type="file" ngf-select="addFiles($files)" multiple class="hide" data-test-id="image-upload-input">
            </div>
        </div>
    </sd-multi-edit-additional-content>
</sd-multi-image-edit>