summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml
diff options
context:
space:
mode:
authorJulien Mougenot <jum@odoo.com>2019-05-27 14:59:14 +0000
committerVincent Schippefilt <vsc@odoo.com>2019-07-29 08:28:15 +0000
commitedc60f7fb4b73327787428e5a5a1f16604778343 (patch)
treeed92a0aff0def040fc8e8281679b62508c2bc971 /addons/web/static/src/xml
parentdb8d22621f8921bf42532af9bdd1c4ed1bddabef (diff)
[REF] web,web_editor: moved ColorpickerDialog to web
The reason this widget was moved is that the next improvement ([IMP] base: Configure document layout) defines a new field (FieldColor) which needs to call the colorpicker dialog inside of the base module. This couldn't be done while the dialog was located in the wysiwyg assets.
Diffstat (limited to 'addons/web/static/src/xml')
-rw-r--r--addons/web/static/src/xml/base.xml9
-rw-r--r--addons/web/static/src/xml/colorpicker_dialog.xml64
2 files changed, 73 insertions, 0 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index f9564dbe228..6d55901f0cd 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -1516,4 +1516,13 @@
</button>
</t>
+<t t-name="FieldColor">
+ <div class="o_field_colors_wrapper">
+ <span class="o_field_colors"></span>
+ <button class="o_reset_colors btn btn-link" title="Reset default colors" aria-label="Reset colors">
+ <i class="fa fa-refresh"></i>
+ </button>
+ </div>
+</t>
+
</templates>
diff --git a/addons/web/static/src/xml/colorpicker_dialog.xml b/addons/web/static/src/xml/colorpicker_dialog.xml
new file mode 100644
index 00000000000..e58c70b6acd
--- /dev/null
+++ b/addons/web/static/src/xml/colorpicker_dialog.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<templates id="template" xml:space="preserve">
+
+<t t-name="ColorpickerDialog">
+ <div class="o_colorpicker_widget">
+ <div class="row">
+ <div class="col-auto">
+ <div class="o_color_pick_area d-inline-block border">
+ <div class="o_picker_pointer rounded-circle" />
+ </div>
+ <div class="o_color_slider d-inline-block ml-2 border">
+ <div class="o_slider_pointer" />
+ </div>
+ <div class="o_opacity_slider d-inline-block ml-2 border">
+ <div class="o_opacity_pointer" />
+ </div>
+ </div>
+ <form class="col o_color_picker_inputs">
+ <div class="input-group">
+ <div class="input-group-prepend">
+ <span class="input-group-text rounded-0 o_color_preview" />
+ </div>
+ <input type="text" class="form-control o_hex_input" data-color-method="hex" />
+ </div>
+ <div class="form-row mt-2">
+ <div class="col">
+ <div class="form-group">
+ <label for="red">Red</label>
+ <input type="text" class="form-control o_red_input" data-color-method="rgb" id="red" />
+ </div>
+ <div class="form-group">
+ <label for="green">Green</label>
+ <input type="text" class="form-control o_green_input" data-color-method="rgb" id="green" />
+ </div>
+ <div class="form-group">
+ <label for="blue">Blue</label>
+ <input type="text" class="form-control o_blue_input" data-color-method="rgb" id="blue" />
+ </div>
+ </div>
+ <div class="col">
+ <div class="form-group">
+ <label for="hue">Hue</label>
+ <input type="text" class="form-control o_hue_input" data-color-method="hsl" id="hue" />
+ </div>
+ <div class="form-group">
+ <label for="saturation">Saturation %</label>
+ <input type="text" class="form-control o_saturation_input" data-color-method="hsl" id="saturation" />
+ </div>
+ <div class="form-group">
+ <label for="lightness">Lightness %</label>
+ <input type="text" class="form-control o_lightness_input" data-color-method="hsl" id="lightness" />
+ </div>
+ </div>
+ </div>
+ <div class="form-group">
+ <label for="opacity">Opacity %</label>
+ <input type="text" class="form-control o_opacity_input" data-color-method="opacity" id="opacity" />
+ </div>
+ </form>
+ </div>
+ </div>
+</t>
+
+</templates> \ No newline at end of file