diff --git a/LICENSE b/LICENSE index 12334e0f..56df1d61 100644 --- a/LICENSE +++ b/LICENSE @@ -1,12 +1,9 @@ - -For copyright information, please see the COPYRIGHT file. - -Odoo is published under the GNU LESSER GENERAL PUBLIC LICENSE, Version 3 +OWL is published under the GNU LESSER GENERAL PUBLIC LICENSE, Version 3 (LGPLv3), as included below. Since the LGPL is a set of additional permissions on top of the GPL, the text of the GPL is included at the bottom as well. -Some external libraries and contributions bundled with Odoo may be published +Some external libraries and contributions bundled with OWL may be published under other GPL-compatible licenses. For these, please refer to the relevant source files and/or license files, in the source code tree. diff --git a/doc/qweb.md b/doc/qweb.md index 3adf36eb..6a11405d 100644 --- a/doc/qweb.md +++ b/doc/qweb.md @@ -11,12 +11,14 @@ - [`t-if` directive](#t-if-directive) - [Expression evaluation](#expression-evaluation) - [`t-att` directive (dynamic attributes)](#t-att-directive-dynamic-attributes) + - [`t-call` directive (sub templates)](#t-call-directive-sub-templates) + - [JS/OWL Specific Extensions](#jsowl-specific-extensions) - [`t-on` directive](#t-on-directive) - [Component: `t-widget`, `t-props`](#component-t-widget-t-props) - [`t-ref` directive](#t-ref-directive) - [`t-key` directive](#t-key-directive) - - [`t-transition` directive](#t-transition) + - [`t-transition` directive](#t-transition-directive) - [Debugging (`t-debug` and `t-log`)](#debugging-t-debug-and-t-log) - [White spaces](#white-spaces) - [Root nodes](#root-nodes) @@ -223,6 +225,55 @@ If an expression evaluates to a falsy value, it will not be set at all:
``` +### `t-call` directive (sub templates) + +QWeb templates can be used for top level rendering, but they can also be used +from within another template (to avoid duplication or give names to parts of +templates), using the `t-call` directive: + +```xml +
+

+
+ +
+ + +
+``` + +will be rendered as `

owl

`. This example shows that the sub +template is rendered with the execution context of the parent. The sub template +is actually inlined in the main template, but in a sub scope: variables defined +in the sub template do not escape. + +Sometimes, one might want to pass information to the sub template. In that case, +the content of the body of the `t-call` directive is available as a special +magic variable `0`: + +```xml + + This template was called with content: + + + +
+ + content + +
+``` + +will result in : + +```xml +
+ This template was called with content: + content +
+``` + + ## JS/OWL Specific Extensions ### `t-on` directive @@ -299,8 +350,7 @@ For example, a simple fade in/out effect can be done with this: } ``` -Note: you will find more information on animations in the [animation](doc/animations.md) -documentation. +Note: more information on animations are available [here](doc/animations.md). ### Debugging (`t-debug` and `t-log`)