# You must use a tab-size of 4 spaces to edit this file.
---
zenario__content:
    panels:
        image_tags:
            panel_type: multi_line_list
            title: Image tags
            no_items_message: No image tags found.
            db_items:
                table: '[[DB_PREFIX]]image_tags AS it'
                id_column: it.name
            columns:
                id:
                    db_column: it.id
                name:
                    title: Name
                    db_column: it.name
                    show_by_default: true
                    searchable: true
                color:
                    title: Color
                    db_column: it.color
                    show_by_default: true
                    searchable: true
                    format: enum
                    values:
                        blue: Blue
                        green: Green
                        grey: Grey
                        orange: Orange
                        red: Red
                        violet: Violet
                        yellow: Yellow
                usage_count:
                    title: Usage
                    show_by_default: true
                    db_column: |
                        (
                            SELECT COUNT(itl.image_id)
                            FROM [[DB_PREFIX]]image_tag_link AS itl
                            WHERE itl.tag_id = it.id
                        )
            
            item:
                css_class: media_image
            
            item_buttons:
                edit:
                    priv: _PRIV_MANAGE_MEDIA
                    label: Edit tag
                    admin_box:
                        path: zenario_image_tag
                view_images:
                    label: View images with this tag
                    visible_if_for_all_selected_items: >
                        zenario.engToBoolean(item.usage_count)
                    link:
                        path: zenario__library/panels/image_library
                        refiner: tag
                
                delete_unused:
                    priv: _PRIV_MANAGE_MEDIA
                    label: Delete
                    multiple_select: true
                    hide_in_select_mode: true
                    visible_if_for_all_selected_items: >
                        !zenario.engToBoolean(item.usage_count)
                    ajax:
                        confirm:
                            message: |
                                Are you sure you wish to delete the tag "[[name]]"?
                                
                                No images use this tag.
                            multiple_select_message: |
                                Are you sure you wish to delete the selected tags?
                                
                                No images use these tag.
                            button_message: Delete
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            delete: 1
                
                delete_used:
                    priv: _PRIV_MANAGE_MEDIA
                    label: Delete
                    multiple_select: true
                    hide_in_select_mode: true
                    visible_if_for_any_selected_items: >
                        zenario.engToBoolean(item.usage_count)
                    ajax:
                        confirm:
                            message: |
                                Are you sure you wish to delete the tag "[[name]]"?
                                
                                It will be removed from the images that use it.
                            multiple_select_message: |
                                Are you sure you wish to delete the selected tags?
                                
                                They will be removed from the images that use them.
                            button_message: Delete
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            delete: 1
                
                #view_dropdown:
                #    label: View
                #    multiple_select: true
                #    hide_when_children_are_not_visible: true
                #action_dropdown:
                #    label: Actions
                #    multiple_select: true
                #    hide_when_children_are_not_visible: true
            collection_buttons:
                create:
                    priv: _PRIV_MANAGE_MEDIA
                    label: Create tag
                    admin_box:
                        path: zenario_image_tag
                    css_class: zenario_create_a_new
                    hide_on_filter: true
