# You must use a tab-size of 4 spaces to edit this file.
---
plugin_settings:
    module_class_name: zenario_ctype_document
    tabs:
        first_tab:
            label: Settings
            fields:
                show_title:
                    plugin_setting:
                        name: show_title
                    label: "Show title of document content item"
                    type: checkbox
                    value: true
                    redraw_onchange: true
                title_tags:
                    visible_if: zenarioAB.value('show_title')
                    plugin_setting:
                        name: title_tags
                    type: select
                    values: &tags
                        h1: <h1>
                        h2: <h2>
                        h3: <h3>
                        h4: <h4>
                        h5: <h5>
                        h6: <h6>
                        p: <p>
                    value: h1
                    same_row: true
                
                view_and_download_links_local_file:
                    plugin_setting:
                        name: view_and_download_links_local_file
                    label: 'Buttons for viewing or downloading the file:'
                    type: radios
                    value: view_only
                    values:
                        view_only:
                            ord: 1
                            label: |
                              Show "View file" button
                        download_only:
                            ord: 2
                            label: |
                              Show "Download file" button
                        both:
                            ord: 3
                            label: |
                              Show both "View" and "Download" buttons
                        neither:
                            ord: 4
                            label: |
                              Show neither (not recommended)
                    format_onchange: true
                    notices_below:
                        document_cannot_be_viewed_or_downloaded:
                            hidden: true
                            type: warning
                            message: 'If neither button is shown, it will not be possible to view or download any documents displayed by this plugin.'
                local_file_view_button_label:
                    indent: 1
                    label: 'View button label:'
                    plugin_setting:
                        name: local_file_view_button_label
                    type: text
                    value: 'View file in browser'
                    show_phrase_icon: true
                    visible_if:
                        lib.valueIn: view_and_download_links_local_file, view_only, both
                local_file_download_button_label:
                    indent: 1
                    label: 'Download button label:'
                    plugin_setting:
                        name: local_file_download_button_label
                    type: text
                    value: 'Download now'
                    show_phrase_icon: true
                    notices_below:
                        plugin_setting_overridden_by_site_setting:
                            hidden: true
                            type: information
                            message: ''
                            html: true
                    visible_if:
                        lib.valueIn: view_and_download_links_local_file, download_only, both
                s3_file:
                    label: 'Show S3 file Download button for immediate download'
                    plugin_setting:
                        name: s3_file
                    type: checkbox
                    hidden: true
                    redraw_onchange: true
                s3_file_not_found_error_phrase:
                    indent: 1
                    plugin_setting:
                        name: s3_file_not_found_error_phrase
                        translate: true
                    label: 'Error phrase if S3 file is not found:'
                    type: text
                    value: 'AWS file not found or the storage settings are incorrect'
                    show_phrase_icon: true
                    visible_if: zenarioAB.value('s3_file')
                
                show_filename_local_file:
                    plugin_setting:
                        name: show_filename_local_file
                    label: 'Show filename'
                    type: checkbox
                    value: true
                show_filename_s3_file:
                    plugin_setting:
                        name: show_filename_s3_file
                    label: 'Show filename of S3 file'
                    type: checkbox
                    value: true
                    hidden: true
                
                show_local_file_type_and_size:
                    label: 'Show file type and size'
                    plugin_setting:
                        name: show_local_file_type_and_size
                    type: checkbox
                    value: 1
                show_s3_file_type_and_size:
                    label: 'Show file type and size of S3 file'
                    plugin_setting:
                        name: show_s3_file_type_and_size
                    type: checkbox
                    value: 1
                    hidden: true
                
                show_featured_image:
                    plugin_setting:
                        name: show_featured_image
                    label: "Show thumbnail of featured image"
                    type: checkbox
                    value: ""
                    format_onchange: true
                    
                image_canvas:
                    plugin_setting:
                        name: image_canvas
                    label: 'Featured image canvas:'
                    type: select
                    value: crop_and_zoom
                    values:
                        crop_and_zoom:
                            ord: 1
                            label: Crop and zoom
                        fixed_width:
                            ord: 2
                            label: Constrain by width
                        fixed_height:
                            ord: 3
                            label: Constrain by height
                        fixed_width_and_height:
                            ord: 4
                            label: Constrain by width and height
                        unlimited:
                            ord: 5
                            label: Unlimited size
                    format_onchange: true
                    indent: 1

                image_retina:
                    indent: 2
                    plugin_setting:
                        name: retina
                    label: 'This is a retina image'
                    type: checkbox
                    same_row: true
                    value: false
                    visible_if: lib.value('show_featured_image') && (lib.value('image_canvas') == 'unlimited')
                    side_note: |
                        Display image at double density.
                
                image_width:
                    plugin_setting:
                        name: image_width
                    label: 'Width:'
                    type: text
                    validation:
                        required_if_not_hidden: Please enter a width for listing photo.
                        numeric: The width must be a number.
                    value: 200
                    maxlength: "5"
                    style: 'width: 5em;'
                    post_field_html: '&nbsp;pixels'
                    indent: 2

                image_height:
                    plugin_setting:
                        name: image_height
                    label: 'Height:'
                    type: text
                    validation:
                        required_if_not_hidden: Please enter a height for listing photo.
                        numeric: The height must be a number.
                    value: 300
                    maxlength: "5"
                    style: 'width: 5em;'
                    post_field_html: '&nbsp;pixels'
                    indent: 2
                
                show_language_name:
                    plugin_setting:
                        name: show_language_name
                    label: "Show language name"
                    type: checkbox
                    redraw_onchange: true
                show_language_name_in_which_language:
                    indent: 1
                    plugin_setting:
                        name: show_language_name_in_which_language
                    type: radios
                    value: in_site_default_language
                    values:
                        in_site_default_language:
                            ord: 1
                            label: "Show in the default language ([[default_site_language]])"
                        in_local_language:
                            ord: 2
                            label: "Show translation in local language"
                    visible_if: lib.value('show_language_name')
                    validation:
                        required_if_not_hidden: "Please select one of the options."
                show_categories:
                    label: "List categories"
                    plugin_setting:
                        name: show_categories
                    type: checkbox
                    tooltip: Only top-level, public categories will be listed.
                
                show_permalink:
                    label: 'Show permalink'
                    plugin_setting:
                        name: show_permalink
                    type: checkbox
                    value: false
                    redraw_onchange: true
                permalink_target:
                    indent: 1
                    plugin_setting:
                        name: permalink_target
                    type: radios
                    value: to_doc_content_item
                    values:
                        to_doc_content_item:
                            label: "To document download content item"
                        to_file_itself:
                            label: "To file itself (only available on public content items)"
                    visible_if: zenarioAB.value('show_permalink')
                
                show_release_datetime:
                    label: "Show item's release date/time"
                    plugin_setting:
                        name: show_release_datetime
                    type: checkbox
                    value: "1"
                    format_onchange: true
                release_date_format:
                    label: 'Date format:'
                    plugin_setting:
                        name: release_date_format
                    type: select
                    values:
                        _SHORT:
                            ord: 1
                            label: Short
                        _MEDIUM:
                            ord: 2
                            label: Medium
                        _LONG:
                            ord: 3
                            label: Long
                    value: _MEDIUM
                    indent: 1
                release_datetime_html_tag:
                    plugin_setting:
                        name: release_datetime_html_tag
                    value: p
                    visible_if:
                        lib.value: show_release_datetime
                    type: select
                    values: *tags
                    same_row: true
                show_release_time:
                    label: 'Show time'
                    plugin_setting:
                        name: show_release_time
                    type: checkbox
                    value: "0"
                    indent: 1
                
                show_document_extra_data:
                    #Only appears if "Document content type: extra data" module is running.
                    label: "Show document extra data"
                    plugin_setting:
                        name: show_document_extra_data
                    type: checkbox
                    value: 1
                
                show_document_download_page_link:
                    label: "Show link to document download page"
                    plugin_setting:
                        name: show_document_download_page_link
                    type: checkbox
                
                dummy_comment_field:
                    #This dummy field is here so that the "Update" button does not cover up the phrase icon of the field above.
                    snippet:
                        html: ''
        advanced:
            label: Advanced
            fields:
                show_details_and_link:
                    label: 'Target content item:'
                    type: radios
                    plugin_setting:
                        name: show_details_and_link
                    values:
                        current_content_item:
                            ord: 1
                            label: Automatic (recommended)
                            side_note: This plugin should be in a slot on the layout for the Document content type. Creates a web page with summary details, from which the file can be downloaded.
                        another_content_item:
                            ord: 2
                            label: Specific document content item...
                            side_note: Use this to show a specific document content item to the visitor. The plugin can be placed on any content item or layout.
                    value: current_content_item
                    format_onchange: true
                another_document:
                    indent: 1
                    label: 'Select document content item:'
                    plugin_setting:
                        name: another_document
                        foreign_key_to: content
                    pick_items:
                        path: zenario__content/panels/content/refiners/content_type//document//
                        min_path: zenario__content/panels/content
                        max_path: zenario__content/panels/content
                        target_path: zenario__content/panels/content
                        select_phrase: Select...
                    validation:
                        required_if_not_hidden: Please select content item.
                
                show_published_date:
                    label: "Show item's published date"
                    plugin_setting:
                        name: show_published_date
                    type: checkbox
                    value: "1"
                    format_onchange: true
                published_date_format:
                    indent: 1
                    label: 'Date format:'
                    plugin_setting:
                        name: published_date_format
                    type: select
                    values:
                        _SHORT:
                            ord: 1
                            label: Short
                        _MEDIUM:
                            ord: 2
                            label: Medium
                        _LONG:
                            ord: 3
                            label: Long
                    value: _MEDIUM
                published_date_html_tag:
                    indent: 1
                    plugin_setting:
                        name: published_date_html_tag
                    value: p
                    visible_if:
                        lib.value: show_published_date
                    type: select
                    values: *tags
                    same_row: true
