# You must use a tab-size of 4 spaces to edit this file.
---
zenario__content:
    panels:
        access_codes:
            title: Access codes for staging mode
            db_items:
                table: >
                    [[DB_PREFIX]]content_item_versions AS v
                    INNER JOIN [[DB_PREFIX]]content_items AS c
                     ON c.id = v.id
                    AND c.type = v.type
                    AND c.admin_version = v.version
                    AND c.status IN ('first_draft', 'published_with_draft', 'hidden_with_draft', 'trashed_with_draft', 'unlisted_with_draft')
                id_column: v.access_code
                group_by: v.access_code
                where_statement: "WHERE v.access_code IS NOT NULL"
            no_items_message: No access codes found
            panel_type: multi_line_list
            notice:
                show: true
                type: information
                message: Access codes allow non-administrators to view content items in staging mode before they are published.
            default_sort_column: path
            label_format_for_grid_view: '[[access_code]]'
            columns:
                access_code:
                    title: Access code
                    db_column: v.access_code
                    searchable: true
                    always_show: true
                usage:
                    title: Usage
                    db_column: |
                        COUNT(DISTINCT c.id, c.type)
                    searchable: false
                    always_show: true
                    width: xsmall
            
            item:
                name: Access code
                names: Access codes
                css_class: access_code
                tooltip_when_link_is_active: 'View content items using the access code [[access_code]]'
                link:
                    path: zenario__content/panels/content
                    branch: true
                    refiner: uses_access_code
            
            collection_buttons:
                help:
                    label: Help
                    hide_in_select_mode: true
                    help:
                        message: |
                            Access codes allow non-administrators to view draft versions of content items before they are published.
                            
                            When access codes exist, this panel will list them, and show which draft content items use them.
                            
                            To create an access code, make a draft of one or more content items, and click the thumbs-up icon to enable staging mode. This will let you assign an access code for those items.
            item_buttons:
                view_content_items:
                    label: View content items
                    multiple_select: true
                    link:
                        path: zenario__content/panels/content
                        branch: true
                        refiner: uses_access_code
                delete_access_code:
                    label: Delete access code
                    multiple_select: true
                    multiple_select_label: Delete access codes
                    ajax:
                        confirm:
                            message: |
                                Delete access code "[[access_code]]"?
                                
                                This will remove the access code from all content items that currently use it.
                            multiple_select_message: |
                                Delete the selected access codes?
                                
                                This will remove the access codes from all content items that currently use them.
                            button_message: Delete
                            cancel_button_message: Cancel
                            message_type: warning
                        request:
                            delete_access_code: 1
