# ===================================
#  Field Definitions
# ===================================

fields:

    title:
        label: rainlab.blog::lang.post.title
        span: left
        placeholder: rainlab.blog::lang.post.title_placeholder

    slug:
        label: rainlab.blog::lang.post.slug
        span: right
        placeholder: rainlab.blog::lang.post.slug_placeholder
        preset:
            field: title
            type: slug

    blog_type:
        label: Blog Type
        span: left
        type: dropdown
        options:
            1: Blog
            2: Room
            3: Offer
            4: Restaurant
            5: Wedding
            6: Meeting
            7: Destination


    toolbar:
        type: partial
        path: post_toolbar
        cssClass: collapse-visible

secondaryTabs:
    stretch: true
    fields:
        content:
            tab: rainlab.blog::lang.post.tab_edit
            type: RainLab\Blog\FormWidgets\BlogMarkdown
            cssClass: field-slim blog-post-preview
            stretch: true
            mode: split

        categories:
            tab: rainlab.blog::lang.post.tab_categories
            type: relation
            commentAbove: rainlab.blog::lang.post.categories_comment
            placeholder: rainlab.blog::lang.post.categories_placeholder

        published:
            tab: rainlab.blog::lang.post.tab_manage
            label: rainlab.blog::lang.post.published
            span: left
            type: checkbox

        published_at:
            tab: rainlab.blog::lang.post.tab_manage
            label: rainlab.blog::lang.post.published_on
            span: left
            cssClass: checkbox-align
            type: datepicker
            mode: datetime
            trigger:
                action: enable
                field: published
                condition: checked

        excerpt:
            tab: rainlab.blog::lang.post.tab_manage
            label: rainlab.blog::lang.post.excerpt
            type: textarea
            size: small

        excerpt_2:
            tab: rainlab.blog::lang.post.tab_manage
            label: "Excerpt 2"
            type: textarea
            size: small

        excerpt_3:
            tab: rainlab.blog::lang.post.tab_manage
            label: "Excerpt 3"
            type: textarea
            size: small

        featured_images:
            tab: rainlab.blog::lang.post.tab_manage
            label: rainlab.blog::lang.post.featured_images
            type: fileupload
            mode: image
            imageWidth: 200
            imageHeight: 200

        roomoffers:
            tab: List of Offers
            label: List of Offers
            type: repeater
            size: small
            # hidden: true
            # dependsOn: 
                # - ^categories
            trigger:
                action: show
                field: blog_type
                condition: value[2]
            form:
                fields:
                    offerslug:
                        label: Offer 
                        span: left
                        type: dropdown
                        options: ['\RainLab\Blog\Models\Post', 'getOffer']   
                    amount:
                        label: Price
                        span: right

        offerrooms:
            tab: List of Rooms
            label: List of Rooms
            type: repeater
            size: small
            # hidden: true
            # dependsOn: 
                # - ^categories
            trigger:
                action: show
                field: blog_type
                condition: value[3]

            form:
                fields:
                    roomslug:
                        label: Room
                        span: left
                        type: dropdown
                        options: ['\RainLab\Blog\Models\Post', 'getRoom']   
                    amount:
                        label: Price
                        span: right

        inclussions:
            tab: Offer Detail
            label: inclussions
            trigger:
                action: show
                field: blog_type
                condition: value[3]
            
        terms:
            tab: Offer Detail
            label: Terms 
            trigger:
                action: show
                field: blog_type
                condition: value[3]

        amenities:
            tab: Room Detail
            label: amenities
            trigger:
                action: show
                field: blog_type
                condition: value[2]

        facilities:
            tab: Room Detail
            label: Facilities 
            trigger:
                action: show
                field: blog_type
                condition: value[2]

        room_size:
            tab: Room Detail
            label: Room size
            size: small
            trigger:
                action: show
                field: blog_type
                condition: value[2]

        number_of_room:
            tab: Room Detail
            label: Total number of rooms
            size: small
            trigger:
                action: show
                field: blog_type
                condition: value[2]

        room_view:
            tab: Room Detail
            label: View
            size: small
            trigger:
                action: show
                field: blog_type
                condition: value[2]

        room_bedding:
            tab: Room Detail
            label: Bedding options
            size: small
            trigger:
                action: show
                field: blog_type
                condition: value[2]

        max_adult:
            tab: Room Detail
            label: Max adult
            size: small
            trigger:
                action: show
                field: blog_type
                condition: value[2]

        children_extrabed:
            tab: Room Detail
            label: Children & extrabed
            size: small
            trigger:
                action: show
                field: blog_type
                condition: value[2]

        restaurant_detail:
            tab: Restaurant Detail
            label: Restaurant Detail
            type: textarea
            size: small
            trigger:
                action: show
                field: blog_type
                condition: value[4]

        hour_detail:
            tab: Restaurant Detail
            label: Hour Detail
            size: small
            trigger:
                action: show
                field: blog_type
                condition: value[4]

        quick_fact:
            tab: Restaurant Detail
            label: Quick Fact
            size: small
            trigger:
                action: show
                field: blog_type
                condition: value[4]

        wedding_description:
            tab: Wedding Detail
            label: Wedding Description
            type: textarea
            size: small
            trigger:
                action: show
                field: blog_type
                condition: value[5]

        wedding_price:
            tab: Wedding Detail
            label: Wedding Price
            size: small
            trigger:
                action: show
                field: blog_type
                condition: value[5]

        meeting_description:
            tab: Meeting Detail
            label: Meeting Description
            type: textarea
            size: small
            trigger:
                action: show
                field: blog_type
                condition: value[6]

        meeting_price:
            tab: Meeting Detail
            label: Meeting Price
            size: small
            trigger:
                action: show
                field: blog_type
                condition: value[6]

        capacities:
            tab: Capacity Detail
            type: repeater
            size: small
            form:
                fields:
                    room_name:
                        label: Room Name
                        span: left
                        placeholder: Room Name
                    surface:
                        label: surface
                        span: right
                        placeholder: '... sqm'
                    height_min:
                        label: Height Min
                        span: left
                        placeholder: '...'
                    width_length:
                        label: Width/Length
                        span: right
                        placeholder: '...x...'
                    theatre:
                        label: Theatre
                        span: left
                        placeholder: '...'
                    class_room:
                        label: Class room
                        span: right
                        placeholder: '...'
                    royal_square:
                        label: Royal Square
                        span: left
                        placeholder: '...'
                    u_shape:
                        label: U Shape
                        span: right
                        placeholder: '...'
                    round_table:
                        label: Round Table
                        span: left
                        placeholder: '...'
                    cocktail:
                        label: Cocktail
                        span: right
                        placeholder: '...'
            trigger:
                action: show
                field: blog_type
                condition: value[6]

        destination_desc:
            tab: Destination Detail
            label: Description
            type: textarea
            size: small
            trigger:
                action: show
                field: blog_type
                condition: value[7]

        destination_lat:
            tab: Destination Detail
            label: Latitude
            size: small
            trigger:
                action: show
                field: blog_type
                condition: value[7]

        destination_lon:
            tab: Destination Detail
            label: Longitude
            size: small
            trigger:
                action: show
                field: blog_type
                condition: value[7]