Last active
August 3, 2019 10:48
-
-
Save amigrave/0cfb622d08cc401adbb8 to your computer and use it in GitHub Desktop.
Revisions
-
amigrave revised this gist
Oct 16, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -49,10 +49,10 @@ Here's an example of how you would change the title of a snippet, the image sour <ts ts-jquery="div.o_block_banner_snip" ts-operation="append"> <div> Additional <!-- Of course you can call a snippet from anoter snippet --> <ts ts-call="Separator"/> Content </div> </ts> </ts> -
amigrave revised this gist
Oct 16, 2014 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -48,7 +48,12 @@ Here's an example of how you would change the title of a snippet, the image sour <ts ts-jquery="h3" ts-operation="replace"/> <ts ts-jquery="div.o_block_banner_snip" ts-operation="append"> <div> My additional ... <!-- Of course you can call a snippet from anoter snippet --> <ts ts-call="Separator"/> ... content </div> </ts> </ts> -
amigrave revised this gist
Oct 16, 2014 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -39,10 +39,13 @@ Here's an example of how you would change the title of a snippet, the image sour <ts ts-jquery="h1" ts-operation="inner"> My brand new title </ts> <ts ts-jquery="img:first" ts-operation="attributes"> <attribute name="src">/img/test.png</attribute> </ts> <!-- here we replace by anything, it's how you remove a node --> <ts ts-jquery="h3" ts-operation="replace"/> <ts ts-jquery="div.o_block_banner_snip" ts-operation="append"> <div>My additional content</div> -
amigrave revised this gist
Oct 16, 2014 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,7 +31,7 @@ In order to properly showcase your snippets, you most probably want to make some This can be achieved using the `ts-extend` directive of QWeb.js. Here's an example of how you would change the title of a snippet, the image source remove the `<h3>` and add a div with additional content: ```xml <div id="js_snippets_showcase"> @@ -42,6 +42,8 @@ Here's an example of how you would change the title of a snippet, the image sour <ts ts-jquery="img:first" ts-operation="attributes"> <attribute name="src">/img/test.png</attribute> </ts> <ts ts-jquery="h3" ts-operation="replace"/> <!-- here we replace by anything, so it's removed --> <ts ts-jquery="div.o_block_banner_snip" ts-operation="append"> <div>My additional content</div> </ts> -
amigrave revised this gist
Oct 16, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,7 +28,9 @@ It means that you can call them like you would do with any other template, eg: The previous template would render the `Banner` and `Big Message` templates. In order to properly showcase your snippets, you most probably want to make some customization to them. This can be achieved using the `ts-extend` directive of QWeb.js. Here's an example of how you would change the title of a snippet, the image source and add a div with additional content: ```xml -
amigrave revised this gist
Oct 16, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,7 +28,7 @@ It means that you can call them like you would do with any other template, eg: The previous template would render the `Banner` and `Big Message` templates. In order to properly showcase your snippets, you most probably want to make some customization to them. This can be achieved using the `ts-extend` directive of QWeb.js. Here's an example of how you would change the title of a snippet, the image source and add a div with additional content: ```xml -
amigrave revised this gist
Oct 16, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,7 +29,7 @@ The previous template would render the `Banner` and `Big Message` templates. In order to properly showcase your snippets, you most probably want to make some customization to them. Here's an example of how you would change the title of a snippet, the image source and add a div with additional content: ```xml <div id="js_snippets_showcase"> -
amigrave revised this gist
Oct 16, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ A snippets showcase can be added to any page of your theme but it's intended to be used in the *demo* pages. In order to make a snippet showcase, you need a div with the class `js_snippets_showcase`. The content of this div will be parsed as a QWeb (client side) document using the prefix `ts`. Once parsed, the snippet showcase widget will render the template named `main`. -
amigrave revised this gist
Oct 16, 2014 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ In order to make a snippet showcase, you need a div with the class `js_snippets_showcase`. The content of this div will be parsed as a QWeb (client side) document using the prefix `ts`. Once parsed, the snippet showcase widget will render the template named `main`. Eg: @@ -11,7 +11,7 @@ Eg: </div> ``` In the snippets showcase mode, all the snippets are loaded through javascript and transformed into qweb templates. It means that you can call them like you would do with any other template, eg: ```xml @@ -27,7 +27,7 @@ The previous template would render the `Banner` and `Big Message` templates. In order to properly showcase your snippets, you most probably want to make some customization to them. Here's an example of how you would change the title of a snippet, change the image source and add a div with additional content: ```xml <div id="js_snippets_showcase"> @@ -52,4 +52,4 @@ Here's an example of how you would change the title of a snippet, change the ima Here are the different values for the `ts-operation` directive: `append`, `prepend`, `before`, `after`, `replace`, `inner`, `attributes` **NOTE:** This snippet showcase mode is only meant to make demo pages for the themes and should NOT be used for production pages. -
amigrave revised this gist
Oct 16, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ In order to make a snippet showcase, you need a div with the class `js_snippets_showcase`. The content of this div will be parsed as a QWeb document using the prefix `ts`. Once parsed, the snippet showcase widget will render the template named `main`. -
amigrave revised this gist
Oct 16, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ In order to make a snippet showcase, you need a div the with class `js_snippets_showcase`. The content of this div will be parsed as a QWeb document using the prefix `ts`. Once parsed, the snippet showcase widget will render the template named `main`. -
amigrave revised this gist
Oct 16, 2014 . 1 changed file with 41 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,21 +1,55 @@ In order to make a snippet showcase, you need a div with class `js_snippets_showcase`. The content of this div will be parsed as a QWeb document using the prefix `ts`. Once parsed, the snippet showcase widget will render the template named `main`. Eg: ```xml <div id="js_snippets_showcase"> <ts ts-name="main"> Hello <b>world</b> ! </ts> </div> ``` In the snippets showcase mode, all the snippets are loaded through javascript and transformed to qweb templates. It means that you can call them like you would do with any other template, eg: ```xml <div id="js_snippets_showcase"> <ts ts-name="main"> <ts ts-call="Banner"/> <ts ts-call="Big Message"/> </ts> </div> ``` The previous template would render the `Banner` and `Big Message` templates. In order to properly showcase your snippets, you most probably want to make some customization to them. Here's an example of how you would change the title of a snippet, change the image and add a div with content: ```xml <div id="js_snippets_showcase"> <ts ts-extend="Banner"> <ts ts-jquery="h1" ts-operation="inner"> My brand new title </ts> <ts ts-jquery="img:first" ts-operation="attributes"> <attribute name="src">/img/test.png</attribute> </ts> <ts ts-jquery="div.o_block_banner_snip" ts-operation="append"> <div>My additional content</div> </ts> </ts> <ts ts-name="main"> <ts ts-call="Banner"/> </ts> </div> ``` Here are the different values for the `ts-operation` directive: `append`, `prepend`, `before`, `after`, `replace`, `inner`, `attributes` **NOTE:** This snippet showcase mode is only meant to make demo page for the themes and shoult NOT be used for production pages -
amigrave renamed this gist
Oct 16, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
amigrave revised this gist
Oct 16, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ Test ```xml <div id="js_snippets_showcase"> <ts ts-extend="Banner"> -
amigrave revised this gist
Oct 16, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ Test ```xml <div id="js_snippets_showcase"> <ts ts-extend="Banner"> -
amigrave created this gist
Oct 16, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ ```xml <div id="js_snippets_showcase"> <ts ts-extend="Banner"> <ts ts-jquery="h1" ts-operation="inner">Example of snippet customisation.</ts> <ts ts-jquery="h4" ts-operation="inner">For the theme showcases.</ts> </ts> <ts ts-name="main"> <ts ts-call="Banner"/> <ts ts-call="Big Message"/> <ts ts-call="Text Block"/> <ts ts-call="Features"/> </ts> </div> ``` Here are the different values for the `ts-operation` directive: `append`, `prepend`, `before`, `after`, `replace`, `inner`, `attributes` ```