Vertical dashboard report added
This commit is contained in:
parent
5bbdf18b18
commit
84196a7d60
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<rng:grammar xmlns:rng="http://relaxng.org/ns/structure/1.0"
|
||||
xmlns:a="http://relaxng.org/ns/annotation/1.0"
|
||||
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
||||
<!-- Handling of element overloading when inheriting from a base
|
||||
template
|
||||
-->
|
||||
<rng:include href="common.rng"/>
|
||||
<rng:define name="graph">
|
||||
<rng:element name="graph">
|
||||
<rng:optional><rng:attribute name="string" /></rng:optional>
|
||||
<rng:optional>
|
||||
<rng:attribute name="type">
|
||||
<rng:choice>
|
||||
<rng:value>bar</rng:value>
|
||||
<rng:value>horizontalBar</rng:value>
|
||||
<rng:value>pie</rng:value>
|
||||
<rng:value>line</rng:value>
|
||||
<rng:value>pivot</rng:value>
|
||||
</rng:choice>
|
||||
</rng:attribute>
|
||||
</rng:optional>
|
||||
<rng:optional><rng:attribute name="js_class"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="stacked"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="order"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="orientation"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="interval"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="disable_linking"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="sample"/></rng:optional>
|
||||
<rng:zeroOrMore>
|
||||
<rng:ref name="field"/>
|
||||
</rng:zeroOrMore>
|
||||
</rng:element>
|
||||
</rng:define>
|
||||
<rng:start>
|
||||
<rng:choice>
|
||||
<rng:ref name="graph" />
|
||||
</rng:choice>
|
||||
</rng:start>
|
||||
</rng:grammar>
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates>
|
||||
|
||||
<t t-name="GraphView.buttons">
|
||||
<div class="btn-group" role="toolbar" aria-label="Main actions"/>
|
||||
<div class="btn-group" role="toolbar" aria-label="Change graph">
|
||||
<button class="btn btn-secondary fa fa-bar-chart-o o_graph_button" title="Bar Chart" aria-label="Bar Chart" data-mode="bar"/>
|
||||
<button class="btn btn-secondary fa fa-bars o_graph_button" title="Horizontal Bar Chart" aria-label="Horizontal Bar Chart" data-mode="horizontalBar"/>
|
||||
<button class="btn btn-secondary fa fa-area-chart o_graph_button" title="Line Chart" aria-label="Line Chart" data-mode="line"/>
|
||||
<button class="btn btn-secondary fa fa-pie-chart o_graph_button" title="Pie Chart" aria-label="Pie Chart" data-mode="pie"/>
|
||||
</div>
|
||||
<div class="btn-group" role="toolbar" aria-label="Change graph">
|
||||
<button class="btn btn-secondary fa fa-database o_graph_button" title="Stacked" aria-label="Stacked" data-mode="stack"/>
|
||||
</div>
|
||||
<div class="btn-group" role="toolbar" aria-label="Sort graph">
|
||||
<button class="btn btn-secondary fa fa-sort-amount-desc o_graph_button" title="Descending" aria-label="Descending" data-order="desc"/>
|
||||
<button class="btn btn-secondary fa fa-sort-amount-asc o_graph_button" title="Ascending" aria-label="Ascending" data-order="asc"/>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
</templates>
|
|
@ -0,0 +1,114 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<template>
|
||||
<t t-name="DashBoard">
|
||||
<t t-if="isMobile">
|
||||
<t t-set="node.attrs.layout" t-value="1"/>
|
||||
</t>
|
||||
<t t-if="!isMobile">
|
||||
<div class="oe_dashboard_links">
|
||||
<button type="button" class="button oe_dashboard_link_change_layout btn btn-secondary"
|
||||
title="Change Layout..">
|
||||
<img src="/board/static/src/img/layout_1-1-1.png" width="16" height="16" alt=""/>
|
||||
<span> Change Layout </span>
|
||||
</button>
|
||||
</div>
|
||||
</t>
|
||||
<table t-att-data-layout="node.attrs.layout" t-attf-class="oe_dashboard oe_dashboard_layout_#{node.attrs.layout}" cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td t-foreach="node.children" t-as="column" t-if="column.tag == 'column'"
|
||||
t-att-id="'column_' + column_index" t-attf-class="oe_dashboard_column index_#{column_index}">
|
||||
|
||||
<t t-foreach="column.children" t-as="action" t-if="action.tag == 'action'" t-call="DashBoard.action"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</t>
|
||||
<t t-name="DashBoard.action">
|
||||
<div t-att-data-id="action.attrs.id" class="oe_action">
|
||||
<h2 t-attf-class="oe_header #{action.attrs.string ? '' : 'oe_header_empty'}">
|
||||
<span class="oe_header_txt"> <t t-esc="action.attrs.string"/> </span>
|
||||
<input class = "oe_header_text" type="text"/>
|
||||
<t t-if="!action.attrs.string">&nbsp;</t>
|
||||
<span class='oe_icon oe_close'></span>
|
||||
<span class='oe_icon oe_minimize oe_fold' t-if="!action.attrs.fold"></span>
|
||||
<span class='oe_icon oe_maximize oe_fold' t-if="action.attrs.fold"></span>
|
||||
</h2>
|
||||
<div t-att-class="'oe_content' + (action.attrs.fold ? ' oe_folded' : '')"/>
|
||||
</div>
|
||||
</t>
|
||||
<t t-name="DashBoard.layouts">
|
||||
<div class="oe_dashboard_layout_selector">
|
||||
<p>
|
||||
<strong>Choose dashboard layout</strong>
|
||||
</p>
|
||||
<ul>
|
||||
<li t-foreach="'1 1-1 1-1-1 1-2 2-1'.split(' ')" t-as="layout" t-att-data-layout="layout">
|
||||
<img t-attf-src="/board/static/src/img/layout_#{layout}.png" alt=""/>
|
||||
<i t-if="layout == currentLayout" class="oe_dashboard_selected_layout fa fa-check fa-lg text-success" aria-label='Layout' role="img" title="Layout"/>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</t>
|
||||
<t t-name="DashBoard.NoContent">
|
||||
<div class="o_view_nocontent">
|
||||
<div class="o_nocontent_help">
|
||||
<p class="o_view_nocontent_neutral_face">
|
||||
Your personal dashboard is empty
|
||||
</p><p>
|
||||
To add your first report into this dashboard, go to any
|
||||
menu, switch to list or graph view, and click <i>"Add to
|
||||
Dashboard"</i> in the extended search options.
|
||||
</p><p>
|
||||
You can filter and group data before inserting into the
|
||||
dashboard using the search options.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
<t t-name="DashBoard.xml">
|
||||
<form t-att-string="form_title">
|
||||
<board t-att-style="style">
|
||||
<column t-foreach="columns" t-as="column">
|
||||
<action t-foreach="column" t-as="action" t-att="action"/>
|
||||
</column>
|
||||
</board>
|
||||
</form>
|
||||
</t>
|
||||
<div t-name="HomeWidget" class="oe_dashboard_home_widget"/>
|
||||
<t t-name="HomeWidget.content">
|
||||
<h3><t t-esc="widget.title"/></h3>
|
||||
<iframe width="100%" frameborder="0" t-att-src="url"/>
|
||||
</t>
|
||||
|
||||
<t t-name="AddToBoardMenu" owl="1">
|
||||
<li class="o_menu_item o_add_to_board" role="menuitem">
|
||||
<button type="button" class="dropdown-item"
|
||||
t-ref="fallback-focus"
|
||||
t-on-click="state.open = !state.open"
|
||||
>
|
||||
<t>Add to my dashboard</t>
|
||||
</button>
|
||||
<t t-if="state.open">
|
||||
<div class="dropdown-item-text">
|
||||
<input type="text" class="o_input" autofocus=""
|
||||
t-model.trim="state.name"
|
||||
t-on-keydown="_onInputKeydown"
|
||||
/>
|
||||
</div>
|
||||
<div class="dropdown-item-text">
|
||||
<button type="button" class="btn btn-primary" t-on-click="_addToBoard">Add</button>
|
||||
</div>
|
||||
</t>
|
||||
</li>
|
||||
</t>
|
||||
|
||||
<t t-name="SearchView.addtodashboard">
|
||||
<a href="#" class="dropdown-item o_add_to_dashboard_link o_closed_menu">Add to my Dashboard</a>
|
||||
<div class="dropdown-item-text o_add_to_dashboard">
|
||||
<input class="o_input o_add_to_dashboard_input" type="text"/>
|
||||
</div>
|
||||
<div class="dropdown-item-text o_add_to_dashboard">
|
||||
<button type="button" class="btn btn-primary o_add_to_dashboard_button">Add</button>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
Loading…
Reference in New Issue