<?xml version="1.0" encoding="UTF-8"?>
<!-- vim:fdl=1:
-->
<templates id="template" xml:space="preserve">

<t t-name="WebClient">
    <div data-role="page">
        <div id="oe_header"></div>
        <div id="oe_app"></div>
    </div>
</t>

<t t-name="Login">
     <div data-role="header" data-theme="b">
        <h1>OpenERP</h1>
    </div>
    <div data-role="content">
        <fieldset>
            <div data-role="fieldcontain">
                <label for="database" class="select">Database:</label>
                <select id="database" name="database" data-native-menu="false">
                    <t t-if="db_list">
                        <t t-foreach="db_list" t-as="opt">
                            <option t-att-value="opt"><t t-esc="opt"/></option>
                        </t>
                    </t>
                </select>
                <label for="login">Login:</label>
                <input type="text" id="login" name="login" value=""/><br/>
                <label for="password">Password:</label>
                <input type="password" id="password" name="password" value=""/><br/>
                <a id="login_btn" data-theme="c" href="#" data-role="button">Login</a>
                <div class="login_error_message ui-btn-inner ui-btn-corner-all">
                    <span class="ui-btn-text">Bad username or password</span>
                </div>
             </div>
        </fieldset>
    </div>
</t>

<t t-name="HomePage">
    <div role="main" class="ui-content" data-role="content">
        <div id="oe_shortcuts" class="shortcuts"></div>
        <div id="oe_menu" class="menu"></div>
        <div id="oe_options" class="options"></div>
    </div>
</t>

<t t-name="Header">
    <div role="banner" class="ui-bar-b ui-header" data-role="header" data-theme="b">
        <h1 aria-level="1" role="heading" tabindex="0" class="ui-title">OpenERP</h1>
        <a id="home" class="ui-btn-right jqm-home ui-btn ui-btn-icon-notext ui-btn-corner-all ui-shadow ui-btn-up-b" data-direction="reverse" data-iconpos="notext" data-icon="home" href="#" title="Home" data-theme="b">
            <span class="ui-btn-inner ui-btn-corner-all">
                <span class="ui-btn-text">Home</span>
                <span class="ui-icon ui-icon-home ui-icon-shadow"></span>
            </span>
        </a>
    </div>
</t>

<t t-name="Shortcuts">
    <ul data-dividertheme="b" data-theme="c" data-inset="true" data-role="listview" class="ui-listview ui-listview-inset ui-corner-all ui-shadow">
        <li data-role="list-divider" role="heading" class="ui-li ui-li-divider ui-btn ui-bar-b ui-corner-top ui-btn-up-undefined">
            Shortcuts
        </li>
        <li data-theme="c" class="ui-btn ui-btn-icon-right ui-li ui-btn-up-c" t-foreach="sc" t-as="opt">
            <div class="ui-btn-inner ui-li">
                <div class="ui-btn-text">
                    <a href="#" class="ui-link-inherit" t-att-data-menu="opt.id" t-att-data-name="opt.name" t-att-data-res="opt.res_id">
                        <span><t t-esc="opt.name"/></span>
                    </a>
                </div>
                <span class="ui-icon ui-icon-arrow-r"></span>
            </div>
        </li>
    </ul>
</t>

<t t-name="Menu">
    <ul data-dividertheme="b" data-theme="c" data-inset="true" data-role="listview" class="ui-listview ui-listview-inset ui-corner-all ui-shadow">
        <li data-role="list-divider" role="heading" class="ui-li ui-li-divider ui-btn ui-bar-b ui-corner-top ui-btn-up-undefined">
            Menu
        </li>
        <li data-theme="c" class="ui-btn ui-btn-icon-right ui-li ui-btn-up-c" t-foreach="data.children" t-as="menu">
            <div class="ui-btn-inner ui-li">
                <div class="ui-btn-text">
                    <a href="#" class="ui-link-inherit" t-att-data-menu="menu.id" t-att-data-name="menu.name">
                        <span><t t-esc="menu.name"/></span>
                    </a>
                </div>
                <span class="ui-icon ui-icon-arrow-r"></span>
            </div>
        </li>
    </ul>
</t>

<t t-name="Menu.secondary">
    <div role="main" class="ui-content" data-role="content">
        <ul data-role="listview" class="ui-listview">
            <li data-theme="c" class="ui-btn ui-btn-icon-right ui-li ui-btn-up-c" t-foreach="menu.children" t-as="menu">
                <div class="ui-btn-inner ui-li">
                    <div class="ui-btn-text">
                        <a href="#" class="ui-link-inherit" t-attf-id="menu_#{menu.id}" t-att-data-menu="menu.id" t-att-data-name="menu.name">
                            <span><t t-esc="menu.name"/></span>
                        </a>
                    </div>
                        <span class="ui-icon ui-icon-arrow-r"></span>
                </div>
            </li>
        </ul>
    </div>
</t>

<t t-name="Options">
    <ul data-dividertheme="b" data-theme="c" data-inset="true" data-role="listview" class="ui-listview ui-listview-inset ui-corner-all ui-shadow">
        <li data-role="list-divider" role="heading" class="ui-li ui-li-divider ui-btn ui-bar-b ui-corner-top ui-btn-up-undefined">
            Options
        </li>
        <li data-theme="c" class="ui-btn ui-btn-icon-right ui-li ui-btn-up-c">
            <div class="ui-btn-inner ui-li">
                <div class="ui-btn-text">
                    <a id="logout" href="#" class="ui-link-inherit">
                        Logout
                    </a>
                </div>
                    <span class="ui-icon ui-icon-arrow-r"></span>
            </div>
        </li>
        <li data-theme="c" class="ui-btn ui-btn-icon-right ui-li ui-btn-up-c">
            <div class="ui-btn-inner ui-li">
                <div class="ui-btn-text">
                    <a id="pref" href="#" class="ui-link-inherit">
                        Preferences
                    </a>
                </div>
                    <span class="ui-icon ui-icon-arrow-r"></span>
            </div>
        </li>
    </ul>
</t>

<t t-name="ListView">
    <div role="main" class="ui-content" data-role="content">
        <form class="ui-listview-filter ui-bar-c" role="search">
            <div id="search-data" class="ui-input-search ui-shadow-inset ui-btn-corner-all ui-btn-shadow ui-icon-searchfield ui-body-c">
                <input id="searchid" placeholder="Filter items..." data-type="search" class="ui-input-text ui-body-null" autosearch="true" setTimeDefault="700"/>
            </div>
        </form>
        <ul role="listbox" data-role="listview" class="ui-listview">
            <li data-theme="c" class="ui-btn ui-btn-icon-right ui-li ui-btn-up-c" t-foreach="records" t-as="record">
                <div class="ui-btn-inner ui-li">
                    <div class="ui-btn-text">
                        <a id="list-id" t-att-data-id="record[0]" href="#" class="ui-link-inherit">
                            <span><t t-esc="record[1]"/></span>
                        </a>
                    </div>
                        <span class="ui-icon ui-icon-arrow-r"></span>
                </div>
            </li>
        </ul>
    </div>
</t>

<t t-name="FormView">
    <div role="main" class="ui-content" data-role="content">
        <form>
            <t t-foreach="get_fields" t-as="field">
            <div data-role="fieldcontain">
                <t t-if="fields[field.attrs.name].type!='one2many' and fields[field.attrs.name].type!='many2many'" >
                <label class="ui-input-text">
                    <span>
                        <t t-if="!(field.attrs.string)" t-esc="fields[field.attrs.name].string"></t>
                        <t t-if="field.attrs.string" t-esc="field.attrs.string"></t>
                    </span>:
                </label>
                </t>
                <t t-if="fields[field.attrs.name].type == 'char'">
                    <t t-if="values[field.attrs.name]">
                        <input class="ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-c" type="text" t-att-value="values[field.attrs.name]"/><br/>
                    </t>
                    <t t-if="!(values[field.attrs.name])">
                        <input class="ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-c" type="text" value=""/><br/>
                    </t>
                </t>
                <t t-if="fields[field.attrs.name].type == 'boolean'">
                    <t t-if="values[field.attrs.name]">
                        <input type="checkbox" checked="yes"/><br/>
                    </t>
                    <t t-if="!(values[field.attrs.name])">
                        <input type="checkbox"/><br/>
                    </t>
                </t>
                <t t-if="fields[field.attrs.name].type == 'text'">
                    <textarea style="width:100%;" rows="8" name="textarea" id="textarea"></textarea><br/>
                </t>
                <t t-if="fields[field.attrs.name].type == 'float'">
                    <t t-if="values[field.attrs.name]">
                        <input class="ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-c" type="text" t-att-value="values[field.attrs.name]"/><br/>
                    </t>
                    <t t-if="!(values[field.attrs.name])">
                        <input class="ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-c" type="text" value=""/><br/>
                    </t>
                </t>
                <t t-if="fields[field.attrs.name].type == 'date'">
                    <t t-if="values[field.attrs.name]">
                        <input class="ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-c" type="text" t-att-value="values[field.attrs.name]"/><br/>
                    </t>
                    <t t-if="!(values[field.attrs.name])">
                        <input class="ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-c" type="text" value=""/><br/>
                    </t>
                </t>
                <t t-if="fields[field.attrs.name].type == 'datetime'">
                    <t t-if="values[field.attrs.name]">
                        <input class="ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-c" type="text" t-att-value="values[field.attrs.name]"/><br/>
                    </t>
                    <t t-if="!(values[field.attrs.name])">
                        <input class="ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-c" type="text" value=""/><br/>
                    </t>
                </t>
                <t t-if="fields[field.attrs.name].type == 'selection'">
                    <div class="ui-select">
                        <div data-theme="c" class="ui-btn ui-btn-icon-right ui-btn-corner-all ui-shadow ui-btn-up-c">
                            <span class="ui-btn-inner ui-btn-corner-all">
                                <span class="ui-btn-text">
                                    <t t-if="values[field.attrs.name]">
                                        <t t-foreach="fields[field.attrs.name].selection" t-as="opt">
                                            <t t-if="opt[0] == (values[field.attrs.name])">
                                                <t t-esc="opt[1]"/>
                                            </t>
                                        </t>
                                    </t>
                                </span>
                                <span class="ui-icon ui-icon-arrow-d ui-icon-shadow"></span>
                            </span>

                            <select t-att-id="'selection_'+fields[field.attrs.name].string">
                                <t t-foreach="fields[field.attrs.name].selection" t-as="opt">
                                    <option t-att-value="opt[0]"><t t-esc="opt[1]"/></option>
                                </t>
                            </select>
                        </div>
                    </div>
                </t>
                 <t t-if="fields[field.attrs.name].type == 'many2one'">

                    <div class="ui-select">
                        <div data-theme="c" class="ui-btn ui-btn-icon-right ui-btn-corner-all ui-shadow ui-btn-up-c">
                            <span class="ui-btn-inner ui-btn-corner-all">
                                <span class="ui-btn-text">
                                    <t t-if="values[field.attrs.name]">
                                        <t t-esc="values[field.attrs.name][1]"/>
                                    </t>
                                 </span>
                                <span class="ui-icon ui-icon-arrow-d ui-icon-shadow"></span>
                            </span>

                            <select t-att-id="'selection_'+fields[field.attrs.name].string">
                                <t t-if="fields[field.attrs.name].selection">
                                    <t t-foreach="fields[field.attrs.name].selection" t-as="opt">
                                        <t t-if="values[field.attrs.name]==opt[0]">
                                            <option t-att-value="opt[0]" selected="true" ><t t-esc="opt[1]"/></option>
                                        </t>
                                        <t t-if="values[field.attrs.name]!=opt[0]">
                                            <option t-att-value="opt[0]" ><t t-esc="opt[1]"/></option>
                                        </t>
                                    </t>
                                </t>
                            </select>
                        </div>
                    </div>
                </t>
                <t t-if="fields[field.attrs.name].type == 'one2many'">
                    <div class="info ui-collapsible-contain" data-collapsed="true" data-role="collapsible">
                        <h1 class="ui-collapsible-heading">
                            <a class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-shadow ui-corner-all ui-btn-up-c" href="#" data-theme="c" t-id="page.attrs.string">
                                <span class="ui-btn-inner ui-corner-all">
                                    <span class="ui-btn-text">
                                        <t t-esc="til"></t>
                                        <!-- <span class="ui-collapsible-heading-status"></span> -->
                                    </span>
                                    <span data-theme="d" class="ui-btn ui-btn-icon-left ui-btn-corner-all ui-shadow ui-btn-up-d">
                                        <span class="ui-btn-inner ui-btn-corner-all ui-corner-all">
                                            <span class="ui-btn-text"></span>
                                            <span class="ui-icon ui-icon-shadow ui-icon-plus"></span>
                                        </span>
                                    </span>
                                </span>
                            </a>
                            <div class="ui-collapsible-content ui-collapsible-content-collapsed" aria-hidden="true">
                                <div class="detail"></div>
                            </div>
                        </h1>
                    </div>
                </t>
            </div>
            </t>
            <t t-if="notebooks">
                <t t-foreach="notebooks.children" t-as="page">
                    <div class="info ui-collapsible-contain" data-collapsed="true" data-role="collapsible">
                        <h1 class="ui-collapsible-heading">
                            <a class="ui-collapsible-heading-toggle ui-btn ui-btn-icon-left ui-shadow ui-corner-all ui-btn-up-c" href="#" data-theme="c" t-id="page.attrs.string">
                                <span class="ui-btn-inner ui-corner-all">
                                    <span class="ui-btn-text">
                                        <t t-esc="page.attrs.string"></t>
                                        <!-- <span class="ui-collapsible-heading-status"></span> -->
                                    </span>
                                    <span data-theme="d" class="ui-btn ui-btn-icon-left ui-btn-corner-all ui-shadow ui-btn-up-d">
                                        <span class="ui-btn-inner ui-btn-corner-all ui-corner-all">
                                            <span class="ui-btn-text"></span>
                                            <span class="ui-icon ui-icon-shadow ui-icon-plus"></span>
                                        </span>
                                    </span>
                                </span>
                            </a>
                            <div class="ui-collapsible-content ui-collapsible-content-collapsed" aria-hidden="true">
                                <div class="detail"></div>
                            </div>
                        </h1>
                    </div>
                </t>
            </t>
        </form>
    </div>
</t>

</templates>
