# You must use a tab-size of 4 spaces to edit this file.
---
zenario__email_template_manager:
    panels:
        newsletter_log:
            priv: _PRIV_VIEW_USER
            title: Log
            db_items:
                table: |
                    [[DB_PREFIX]][[ZENARIO_NEWSLETTER_PREFIX]]newsletter_user_link AS nul
                    LEFT JOIN [[DB_PREFIX]]users AS u ON u.id = nul.user_id
                id_column: "concat(nul.user_id, '_',  nul.newsletter_id)"
                
            refiners:
                newsletter:
                    sql: 'nul.newsletter_id = [[REFINER_ID]]'
            columns:
                id:
                    title: ID
                    db_column: nul.user_id
                    searchable: true
                    align_right: true
                    width: xsmall
                identifier:
                    title: Identifier
                    db_column: u.identifier
                    show_by_default: true
                    searchable: true
                salutation:
                    title: Salutation
                    db_column: u.salutation
                first_name:
                    title: First Name
                    db_column: u.first_name
                    searchable: true
                last_name:
                    title: Last Name
                    db_column: u.last_name
                    searchable: true
                email:
                    title: Email
                    db_column: u.email
                    show_by_default: true
                    searchable: true
                email_overridden_by:
                    title: Overridden by
                    db_column: nul.email_overridden_by
                    show_by_default: No
                    searchable: true
                    width: small
                screen_name:
                    title: Screen Name
                    db_column: u.screen_name
                    searchable: true
                status:
                    title: Status
                    db_column: u.status
                created_date:
                    title: Joined
                    db_column: u.created_date
                    format: date
                last_login:
                    title: Last Login
                    db_column: u.last_login
                    format: date
                email_sent:
                    title: Status
                    db_column: nul.email_sent
                    show_by_default: true
                    width: xsmall
                time_sent:
                    title: Time Sent
                    db_column: nul.time_sent
                    format: datetime
                    show_by_default: true
                    width: medium
                link_clicked:
                    title: Link clicked
                    table_join: |
                        [[DB_PREFIX]][[ZENARIO_NEWSLETTER_PREFIX]]newsletters_hyperlinks AS nh ON nul.clicked_hyperlink_id = nh.id
                    db_column: >
                        CONCAT(
                        'Link ',
                        nh.link_ordinal,
                        ', "',
                        SUBSTRING(nh.link_text,1,20),
                        '..." (',
                        nh.hyperlink,
                        ')')
                    show_by_default: true
                    searchable: true
                    width: large
                time_clicked_through:
                    title: Time clicked
                    db_column: nul.time_clicked_through
                    format: datetime
                    show_by_default: true
                    width: medium
            #collection_buttons:
            #    export:
            #        label: Export in CSV
            #        css_class: export
            #        do_csv_export: true
            default_sort_column: identifier
            item:
                css_class: user