cozy/cozy-mobile

View on GitHub
src/app/templates/file_viewer.jade

Summary

Maintainability
Test Coverage
.collection.files.z-depth-2.snap-content
    if loading
        .valign-wrapper
            .center.cozy-color
                .row
                    .col.s12
                        .preloader-wrapper.active
                            .spinner-layer.spinner-cozy
                                .circle-clipper.left
                                    .circle
                                .gap-patch
                                    .circle
                                .circle-clipper.right
                                    .circle
                    .col.s12
                        span= t('config_loading_files')
    else
        each file in files
            a.collection-item.download(href=file.link, data-key=file._id, data-doctype=file.docType, data-type=file.icon, data-fullpath=file.fullPath, data-name=file.name, data-is-cached=file.isCached?'true':'false', data-is-compatible-viewer=file.isCompatibleViewer?'true':'false', data-is-big=file.isBig?'true':'false')
                if file.isCached
                    i(class="icon mdi mdi-#{file.icon} is-cached")
                else
                    i(class="icon mdi mdi-#{file.icon}")
                span.title.truncate= file.name

                if file.docType.toLowerCase() == 'file'
                    button.actions
                        i.mdi.mdi-dots-vertical.btn-floating.waves-effect

                .progress
                    .determinate.fileProgress(style='width: 0%')

        else
            .valign-wrapper
                .center.cozy-color
                    i.mdi.mdi-file
                    span Aucun fichier


#actions-modal.modal.bottom-sheet
    .modal-content
        .collection.files
            .collection-header
                i.file-icon
                .name.truncate
            a.collection-item.waves-effect.no-cache.actionDownload
                i.icon.mdi.mdi-cloud-download
                span= t('modal_action_file_download')
            if isViewerCompatible
                a.collection-item.waves-effect.cache.no-big.actionDisplay.in
                    i.icon.mdi.mdi-play-circle-outline
                    span= t('modal_action_file_display_in')
                .collection-item.cache.big
                    i.icon.mdi.mdi-play-circle-outline
                    span= t('modal_action_file_big')
            a.collection-item.waves-effect.cache.actionDisplay
                i.icon.mdi.mdi-open-in-new
                span= t('modal_action_file_display_out')
            a.collection-item.waves-effect.cache.actionRemove
                i.icon.large.material-icons phonelink_erase
                span= t('modal_action_file_remove_device')


#open-error-modal.modal
    .modal-content
        h4= t('modal_file_open_error_title')
        p= t('modal_file_open_error_description')
    .modal-footer
        a.modal-action.modal-close.waves-effect.waves-green.btn-flat(href='#!') OK