# You must use a tab-size of 4 spaces to edit this file.
---
zenario__library:
    panels:
        special_images:
            title: Special images library
            no_items_message: There are no special images in the library.
            
            db_items:
                table: |
                    [[DB_PREFIX]]files AS f
                id_column: f.id
                where_statement: |
                    WHERE f.`usage` = 'site_setting'
                    AND f.mime_type IN ('image/gif', 'image/png', 'image/jpeg', 'image/webp', 'image/svg+xml', 'image/x-icon', 'image/icon')
            
            panel_type: multi_line_list_or_grid
            css_class: two_line_list_panels
            use_tall_rows: true
            
            grid_view_microtemplate: zenario_grid_view_image
            slidedown_view_microtemplate: zenario_slidedown_view_image

            default_sort_column: filename
            label_format_for_popouts: |
                [[filename]]
                [[[width]] × [[height]]]
            label_format_for_picked_items: |
                [[filename]]
                [[[width]] × [[height]]]
            
            item:
                css_class: media_image

            columns:
                id:
                    title: ID
                    searchable: true
                    db_column: f.id
                    show_by_default: false
                    align_right: true
                    width: xxsmall
                usage:
                    title: Usage
                    db_column: f.usage
                    hidden: true
                filename:
                    title: Filename
                    width: large
                    searchable: true
                    db_column: f.filename
                    always_show: true
                    get_tags_from_column: tags
                alt_tag:
                    title: Default alt-tag
                    searchable: true
                    db_column: f.alt_tag
                    show_by_default: true
                title:
                    db_column: f.title
                checksum:
                    db_column: f.checksum
                short_checksum:
                    title: Checksum (short)
                    searchable: true
                    ascii_only: true
                    db_column: f.short_checksum
                    width: small
                    show_by_default: false
                mime_type:
                    server_side_only: true
                    db_column: f.mime_type
                uploaded_datetime:
                    title: Uploaded on
                    format: datetime
                    width: medium
                    searchable: true
                    db_column: f.created_datetime
                    show_by_default: true
                size:
                    title: Size
                    format: filesize
                    db_column: f.size
                    always_show: true
                    width: small
                
                width:
                    db_column: f.width
                height:
                    db_column: f.height
                dimensions:
                    parent: size
                    always_show: true
                    hidden_in_view_options: true
                    title: Dimensions
                    microtemplate: |
                        <% if (m.item.width && m.item.height) { %>
                            <% if (m.item.mime_type == 'image/svg+xml') { %>
                                {{m.item.width|e}} × {{m.item.height|e}}px; scalable
                            <% } else { %>
                                {{m.item.width|e}} × {{m.item.height|e}}px
                            <% } %>
                        <% } else { %>
                            {{'No dimensions; scalable'}}
                        <% } %>
                image_in_use:
                    hidden: true
            collection_buttons:
                upload:
                    priv: _PRIV_MANAGE_MEDIA
                    label: Upload
                    css_class: zenario_create_a_new
                    hide_on_filter: true
                    upload:
                        accept: 'image/png, image/jpeg, image/gif, image/webp, image/svg+xml, image/x-icon, image/icon'
                        extensions:
                            - .gif
                            - .jpg
                            - .jpeg
                            - .png
                            - .webp
                            - .svg
                            - .ico
                        multi: true
                        drag_and_drop: true
                        request:
                            upload: true
                add_from_image_library:
                    label: Add image from image library
                    onclick: |
                        if (window.zenarioOQuickMode) {
                            zenario.reloadPageWhenOrganizerQuickCloses = true;
                        }
                        zenarioO.collectionButtonClick('add_from_image_library');
                    pick_items:
                        path: zenario__library/panels/image_library
                        target_path: zenario__library/panels/image_library
                        min_path: zenario__library/panels/image_library
                        disallow_refiners_looping_on_min_path: true
                        multiple_select: true
                        visible_if_for_all_selected_items: |
                            item.privacy == 'public'
                        request:
                            add_from_image_library: 1
            item_buttons:
                edit:
                    label: Edit image properties
                    onclick: |
                        if (window.zenarioOQuickMode) {
                            zenario.reloadPageWhenOrganizerQuickCloses = true;
                        }
                        zenarioO.itemButtonClick('edit');
                    admin_box:
                        path: zenario_image
                actions_dropdown:
                    label: Actions
                    multiple_select: true
                    hide_when_children_are_not_visible: true
                view:
                    parent: actions_dropdown
                    label: View image
                    popout:
                        href: zenario/file.php?popout=1
                download:
                    parent: actions_dropdown
                    hide_in_select_mode: true
                    label: Download original
                    ajax:
                        confirm:
                            download: true
                            message: 'Download the image "[[filename]]"?'
                            message_type: warning
                            button_message: Download
                            cancel_button_message: Cancel
                        request:
                            download_image: 1
                        
                copy_to_image_library:
                    priv: _PRIV_MANAGE_MEDIA
                    label: Copy to image library
                    parent: actions_dropdown
                    hide_in_select_mode: true
                    multiple_select: true
                    disabled_if_for_any_selected_items: |
                        item.copy_exists_in_image_library
                    disabled_tooltip: A copy of one or more selected images already exists in the image library.
                    visible_if_for_all_selected_items: |
                        (item.mime_type != "image/x-icon" && item.mime_type != "image/icon")
                    ajax:
                        confirm:
                            message: >
                                Are you sure you wish to copy the selected image "[[filename]]" to the image library?
                            multiple_select_message: >
                                Are you sure you wish to copy the selected images to the image library?
                            button_message: Copy to image library
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            copy_to_image_library: 1
                
                delete:
                    priv: _PRIV_MANAGE_MEDIA
                    label: Delete
                    multiple_select: true
                    hide_in_select_mode: true
                    ajax:
                        confirm:
                            message: 'Are you sure you wish to delete the image "[[filename]]"?'
                            multiple_select_message: Are you sure you wish to delete these images?
                            button_message: Delete
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            delete: 1
                    disabled_if_for_any_selected_items: item.image_in_use
                    disabled_tooltip: |
                      This image can't be deleted because it is in use.