<?xml version="1.0"?>
<openerp>
    <data>

        <!-- DOCUMENTATION TOC VIEWS -->
        <record id="view_documentation_toc_list" model="ir.ui.view">
            <field name="name">forum.documentation.toc.list</field>
            <field name="model">forum.documentation.toc</field>
            <field name="arch" type="xml">
                <tree string="Documentation TOC" editable="bottom">
                    <field name="sequence" widget="handle"/>
                    <field name="name"/>
                    <field name="forum_id"/>
                    <field name="parent_id"/>
                </tree>
            </field>
        </record>
        <record id="action_documentation_toc" model="ir.actions.act_window">
            <field name="name">Documentation</field>
            <field name="res_model">forum.documentation.toc</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree</field>
        </record>
        <menuitem id="menu_documentation"
            parent="website_forum.menu_website_forum" groups="base.group_user"
            name="Documentation ToC" action="action_documentation_toc" sequence="20"/>


        <!-- Project Task Kanban View -->
        <record model="ir.ui.view" id="view_forum_post_kanban">
            <field name="name">forum.post.kanban</field>
            <field name="model">forum.post</field>
            <field name="arch" type="xml">
                <kanban default_group_by="documentation_stage_id" >
                    <field name="documentation_stage_id"/>
                    <field name="create_uid"/>
                    <field name="color"/>
                    <templates>
                    <t t-name="kanban-box">
                        <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
                            <div class="oe_dropdown_toggle oe_dropdown_kanban" groups="base.group_user">
                                <span class="oe_e">í</span>
                                <ul class="oe_dropdown_menu">
                                    <li t-if="widget.view.is_action_enabled('edit')"><a type="edit">Edit...</a></li>
                                    <li t-if="widget.view.is_action_enabled('delete')"><a type="delete">Delete</a></li>
                                    <li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
                                </ul>
                            </div>
                            <div class="oe_kanban_content">
                                <div><b><field name="name"/></b></div>
                                <div class="oe_kanban_bottom_right">
                                    <img t-att-src="kanban_image('res.users', 'image_small', record.create_uid.raw_value)" t-att-title="record.create_uid.value" width="24" height="24" class="oe_kanban_avatar"/>
                                </div>
                            </div>
                            <div class="oe_clear"></div>
                        </div>
                    </t>
                    </templates>
                </kanban>
            </field>
        </record>

        <record id="action_forum_doc_post" model="ir.actions.act_window">
            <field name="name">Documentation Posts</field>
            <field name="res_model">forum.post</field>
            <field name="view_type">form</field>
            <field name="view_mode">kanban,tree,form</field>
            <field name="domain">[('documentation_toc_id','&lt;&gt;', False)]</field>
        </record>
        <menuitem id="menu_forum_doc_posts"
            parent="website_forum.menu_website_forum" name="Documentation Posts"
            action="action_forum_doc_post" sequence="25"/>

        <record id="view_forum_post_doc_form" model="ir.ui.view">
            <field name="name">forum.post.form.doc</field>
            <field name="model">forum.post</field>
            <field name="inherit_id" ref="website_forum.view_forum_post_form"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='parent_id']" position="after">
                    <field name="documentation_toc_id"/>
                </xpath>
                <xpath expr="//sheet" position="before">
                    <header>
                        <field name="documentation_stage_id" widget="statusbar"/>
                    </header>
                </xpath>
            </field>
        </record>

        <record id="view_forum_post_doc_list" model="ir.ui.view">
            <field name="name">forum.post.list.doc</field>
            <field name="model">forum.post</field>
            <field name="inherit_id" ref="website_forum.view_forum_post_list"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='forum_id']" position="after">
                    <field name="documentation_toc_id"/>
                </xpath>
            </field>
        </record>

    </data>
</openerp>
