<?php
/**
 * Detail modal partial.
 *
 * @package NNAXFUF_Plugin
 */
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}
?>
<!-- DETAIL-MODAL -->
<div id="nnaxfuf-detail-modal" class="nnaxfuf-modal uk-flex-top" uk-modal>
    <div class="uk-modal-dialog uk-modal-body uk-margin-auto-vertical uk-width-1-1 uk-width-2-3@s">

        <button class="uk-modal-close-default" type="button" uk-close></button>

        <h3 class="uk-modal-title" id="nnaxfuf_detail_modal_title"><?php esc_html_e( 'Details', 'nnax-frontend-user-files' ); ?></h3>

        <div class="uk-grid-small" uk-grid>
            <div class="uk-width-1-1 uk-width-1-2@l uk-flex-last uk-flex-first@m">
                <ul id="nnaxfuf_detail_tabs" class="uk-tab uk-margin-small-bottom" uk-tab>
                    <li class="uk-active"><a href="#"><?php esc_html_e( 'General', 'nnax-frontend-user-files' ); ?></a></li>
                    <li class="nnaxfuf-detail-file-only"><a href="#"><?php esc_html_e( 'File', 'nnax-frontend-user-files' ); ?></a></li>
                    <li class="nnaxfuf-detail-folder-only" hidden><a href="#"><?php esc_html_e( 'Folder', 'nnax-frontend-user-files' ); ?></a></li>
                    <?php do_action( 'nnaxfuf_detail_modal_tabs_extra' ); ?>
                    <li class="nnaxfuf-detail-history-only"><a href="#"><?php esc_html_e( 'History', 'nnax-frontend-user-files' ); ?></a></li>
                </ul>

                <ul id="nnaxfuf_detail_tab_switcher" class="uk-switcher">
                    <li>
                        <dl class="uk-description-list">
                            <dt><?php esc_html_e( 'Title', 'nnax-frontend-user-files' ); ?></dt>
                            <dd>
                                <div class="uk-inline uk-width-1-1">
                                    <span class="uk-form-icon" uk-icon="icon: pencil"></span>
                                    <input class="uk-input uk-form-small" type="text" id="nnaxfuf_detail_title_input" value="">
                                </div>
                                <small class="uk-text-muted nnaxfuf-detail-file-only" id="nnaxfuf_detail_extension_hint" hidden></small>
                            </dd>

                            <dt><?php esc_html_e( 'Owner', 'nnax-frontend-user-files' ); ?></dt>
                            <dd id="nnaxfuf_detail_owner">–</dd>

                            <?php if ( isset( $sharing_active ) && $sharing_active ) : ?>
                            <dt class="nnaxfuf-detail-owner-only"><?php esc_html_e( 'Shared with', 'nnax-frontend-user-files' ); ?></dt>
                            <dd class="nnaxfuf-detail-owner-only" id="nnaxfuf_detail_shared">–</dd>
                            <?php endif; ?>

                            <dt id="nnaxfuf_detail_date_label"><?php esc_html_e( 'Upload date', 'nnax-frontend-user-files' ); ?></dt>
                            <dd id="nnaxfuf_detail_date">–</dd>

                            <dt><?php esc_html_e( 'Last modified', 'nnax-frontend-user-files' ); ?></dt>
                            <dd id="nnaxfuf_detail_modified">–</dd>
                        </dl>
                    </li>

                    <li class="nnaxfuf-detail-file-only">
                        <dl class="uk-description-list">
                            <dt><?php esc_html_e( 'File link', 'nnax-frontend-user-files' ); ?></dt>
                            <dd>
                                <a href="#" id="nnaxfuf_detail_url" target="_blank" rel="noopener noreferrer">–</a>
                            </dd>

                            <dt><?php esc_html_e( 'Type', 'nnax-frontend-user-files' ); ?></dt>
                            <dd id="nnaxfuf_detail_type">–</dd>

                            <dt><?php esc_html_e( 'MIME', 'nnax-frontend-user-files' ); ?></dt>
                            <dd id="nnaxfuf_detail_mime">–</dd>

                            <dt><?php esc_html_e( 'File size', 'nnax-frontend-user-files' ); ?></dt>
                            <dd id="nnaxfuf_detail_size">–</dd>

                            <dt><?php esc_html_e( 'Meta', 'nnax-frontend-user-files' ); ?></dt>
                            <dd>
                                <div id="nnaxfuf_detail_custom_meta_fields" class="uk-margin-small-top"></div>
                            </dd>
                        </dl>
                    </li>

                    <li class="nnaxfuf-detail-folder-only" hidden>
                        <dl class="uk-description-list">
                            <dt><?php esc_html_e( 'Files in folder', 'nnax-frontend-user-files' ); ?></dt>
                            <dd id="nnaxfuf_detail_folder_file_count">0</dd>

                            <dt><?php esc_html_e( 'Files including subfolders', 'nnax-frontend-user-files' ); ?></dt>
                            <dd id="nnaxfuf_detail_folder_file_count_recursive">0</dd>

                            <dt><?php esc_html_e( 'Subfolders', 'nnax-frontend-user-files' ); ?></dt>
                            <dd id="nnaxfuf_detail_folder_subfolder_count">0</dd>

                            <dt><?php esc_html_e( 'Total size (recursive)', 'nnax-frontend-user-files' ); ?></dt>
                            <dd id="nnaxfuf_detail_folder_size">–</dd>

                        </dl>
                    </li>

                    <?php do_action( 'nnaxfuf_detail_modal_panes_extra' ); ?>

                    <li class="nnaxfuf-detail-history-only">
                        <h5 class="uk-heading-bullet uk-margin-small"><?php esc_html_e( 'Activity log', 'nnax-frontend-user-files' ); ?></h5>
                        <div id="nnaxfuf_detail_history" class="uk-margin-small-top uk-overflow-auto" style="max-height: 350px;">
                            <p class="uk-text-muted uk-text-small"><?php esc_html_e( 'Loading history...', 'nnax-frontend-user-files' ); ?></p>
                        </div>
                    </li>
                </ul>

            </div>

            <div class="uk-width-1-1 uk-width-1-2@l nnaxfuf-detail-preview-wrap uk-flex-first uk-flex-last@m">
                <h4 class="uk-heading-bullet uk-margin-small-bottom"><?php esc_html_e( 'Preview', 'nnax-frontend-user-files' ); ?></h4>
                <div id="nnaxfuf_detail_preview" class="nnaxfuf-detail-preview uk-padding-small uk-background-muted uk-border-rounded">
                    <!-- JS rendert hier Bild / PDF / Fallback -->
                </div>
            </div>
        </div>

        <div class="uk-margin-top uk-text-right">
            <a class="uk-button uk-button-default uk-button-small uk-margin-small uk-margin-small-top" href="#" id="nnaxfuf_detail_download_btn" hidden>
                <?php esc_html_e( 'Download as ZIP', 'nnax-frontend-user-files' ); ?>
            </a>
            <?php if ( isset( $sharing_active ) && $sharing_active ) : ?>
            <button class="uk-button uk-button-default uk-button-small uk-margin-small nnaxfuf-open-share-modal" type="button" id="nnaxfuf_detail_share_btn" hidden uk-toggle="target: #nnaxfuf-share-modal">
                <?php esc_html_e( 'Share', 'nnax-frontend-user-files' ); ?>
            </button>
            <?php endif; ?>
            <button class="uk-button uk-button-primary uk-button-small uk-margin-small" type="button" id="nnaxfuf_save_detail_title">
                <?php esc_html_e( 'Save changes', 'nnax-frontend-user-files' ); ?>
            </button>
            <button class="uk-button uk-button-default uk-button-small uk-margin-small uk-modal-close" type="button">
                <?php esc_html_e( 'Close', 'nnax-frontend-user-files' ); ?>
            </button>
        </div>

    </div>
</div>
