Fully Integrated With Others Apps
Get hundreds of open source apps for free
diff --git a/addons/website/static/description/website_edit.png b/addons/website/static/description/website_edit.png
new file mode 100644
index 00000000000..c199d1f40d8
Binary files /dev/null and b/addons/website/static/description/website_edit.png differ
diff --git a/addons/website/static/description/website_editor.png b/addons/website/static/description/website_editor.png
new file mode 100644
index 00000000000..87723ede0f1
Binary files /dev/null and b/addons/website/static/description/website_editor.png differ
diff --git a/addons/website/static/description/website_events.png b/addons/website/static/description/website_events.png
new file mode 100644
index 00000000000..cb9c12245fc
Binary files /dev/null and b/addons/website/static/description/website_events.png differ
diff --git a/addons/website/static/description/website_grid.png b/addons/website/static/description/website_grid.png
new file mode 100644
index 00000000000..ad063c2cb3c
Binary files /dev/null and b/addons/website/static/description/website_grid.png differ
diff --git a/addons/website/static/description/website_home.png b/addons/website/static/description/website_home.png
new file mode 100644
index 00000000000..5d9f8634574
Binary files /dev/null and b/addons/website/static/description/website_home.png differ
diff --git a/addons/website/static/description/website_mobile.png b/addons/website/static/description/website_mobile.png
new file mode 100644
index 00000000000..60b40ea910f
Binary files /dev/null and b/addons/website/static/description/website_mobile.png differ
diff --git a/addons/website/static/description/website_seo.png b/addons/website/static/description/website_seo.png
new file mode 100644
index 00000000000..7cb74e19878
Binary files /dev/null and b/addons/website/static/description/website_seo.png differ
diff --git a/addons/website/static/description/website_theme.png b/addons/website/static/description/website_theme.png
new file mode 100644
index 00000000000..a5955b29a60
Binary files /dev/null and b/addons/website/static/description/website_theme.png differ
diff --git a/addons/website/static/lib/bootstrap/css/bootstrap.css b/addons/website/static/lib/bootstrap/css/bootstrap.css
index 6845714fc94..75fe40edd05 100644
--- a/addons/website/static/lib/bootstrap/css/bootstrap.css
+++ b/addons/website/static/lib/bootstrap/css/bootstrap.css
@@ -41,7 +41,7 @@ code,kbd,pre,samp {
pre {
white-space:pre-wrap}
q {
- quotes:"\\201C" "\\201D" "\\2018" "\\2019"}
+ quotes:"\201C" "\201D" "\2018" "\2019"}
small {
font-size:80%}
sub,sup {
@@ -340,7 +340,7 @@ blockquote small {
line-height:1.428571429;
color:#999}
blockquote small:before {
- content:'\\2014 \\00A0'}
+ content:'\2014 \00A0'}
blockquote.pull-right {
padding-right:15px;
padding-left:0;
@@ -351,7 +351,7 @@ blockquote.pull-right p,blockquote.pull-right small {
blockquote.pull-right small:before {
content:''}
blockquote.pull-right small:after {
- content:'\\00A0 \\2014'}
+ content:'\00A0 \2014'}
q:before,q:after,blockquote:before,blockquote:after {
content:""}
address {
@@ -856,7 +856,7 @@ input[type="search"] {
box-sizing:border-box}
input[type="radio"],input[type="checkbox"] {
margin:4px 0 0;
- margin-top:1px \\9;
+ margin-top:1px \9;
line-height:normal}
input[type="file"] {
display:block}
@@ -1230,405 +1230,405 @@ input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"
font-weight:normal;
line-height:1}
.glyphicon-asterisk:before {
- content:"\\2a"}
+ content:"\2a"}
.glyphicon-plus:before {
- content:"\\2b"}
+ content:"\2b"}
.glyphicon-euro:before {
- content:"\\20ac"}
+ content:"\20ac"}
.glyphicon-minus:before {
- content:"\\2212"}
+ content:"\2212"}
.glyphicon-cloud:before {
- content:"\\2601"}
+ content:"\2601"}
.glyphicon-envelope:before {
- content:"\\2709"}
+ content:"\2709"}
.glyphicon-pencil:before {
- content:"\\270f"}
+ content:"\270f"}
.glyphicon-glass:before {
- content:"\\e001"}
+ content:"\e001"}
.glyphicon-music:before {
- content:"\\e002"}
+ content:"\e002"}
.glyphicon-search:before {
- content:"\\e003"}
+ content:"\e003"}
.glyphicon-heart:before {
- content:"\\e005"}
+ content:"\e005"}
.glyphicon-star:before {
- content:"\\e006"}
+ content:"\e006"}
.glyphicon-star-empty:before {
- content:"\\e007"}
+ content:"\e007"}
.glyphicon-user:before {
- content:"\\e008"}
+ content:"\e008"}
.glyphicon-film:before {
- content:"\\e009"}
+ content:"\e009"}
.glyphicon-th-large:before {
- content:"\\e010"}
+ content:"\e010"}
.glyphicon-th:before {
- content:"\\e011"}
+ content:"\e011"}
.glyphicon-th-list:before {
- content:"\\e012"}
+ content:"\e012"}
.glyphicon-ok:before {
- content:"\\e013"}
+ content:"\e013"}
.glyphicon-remove:before {
- content:"\\e014"}
+ content:"\e014"}
.glyphicon-zoom-in:before {
- content:"\\e015"}
+ content:"\e015"}
.glyphicon-zoom-out:before {
- content:"\\e016"}
+ content:"\e016"}
.glyphicon-off:before {
- content:"\\e017"}
+ content:"\e017"}
.glyphicon-signal:before {
- content:"\\e018"}
+ content:"\e018"}
.glyphicon-cog:before {
- content:"\\e019"}
+ content:"\e019"}
.glyphicon-trash:before {
- content:"\\e020"}
+ content:"\e020"}
.glyphicon-home:before {
- content:"\\e021"}
+ content:"\e021"}
.glyphicon-file:before {
- content:"\\e022"}
+ content:"\e022"}
.glyphicon-time:before {
- content:"\\e023"}
+ content:"\e023"}
.glyphicon-road:before {
- content:"\\e024"}
+ content:"\e024"}
.glyphicon-download-alt:before {
- content:"\\e025"}
+ content:"\e025"}
.glyphicon-download:before {
- content:"\\e026"}
+ content:"\e026"}
.glyphicon-upload:before {
- content:"\\e027"}
+ content:"\e027"}
.glyphicon-inbox:before {
- content:"\\e028"}
+ content:"\e028"}
.glyphicon-play-circle:before {
- content:"\\e029"}
+ content:"\e029"}
.glyphicon-repeat:before {
- content:"\\e030"}
+ content:"\e030"}
.glyphicon-refresh:before {
- content:"\\e031"}
+ content:"\e031"}
.glyphicon-list-alt:before {
- content:"\\e032"}
+ content:"\e032"}
.glyphicon-flag:before {
- content:"\\e034"}
+ content:"\e034"}
.glyphicon-headphones:before {
- content:"\\e035"}
+ content:"\e035"}
.glyphicon-volume-off:before {
- content:"\\e036"}
+ content:"\e036"}
.glyphicon-volume-down:before {
- content:"\\e037"}
+ content:"\e037"}
.glyphicon-volume-up:before {
- content:"\\e038"}
+ content:"\e038"}
.glyphicon-qrcode:before {
- content:"\\e039"}
+ content:"\e039"}
.glyphicon-barcode:before {
- content:"\\e040"}
+ content:"\e040"}
.glyphicon-tag:before {
- content:"\\e041"}
+ content:"\e041"}
.glyphicon-tags:before {
- content:"\\e042"}
+ content:"\e042"}
.glyphicon-book:before {
- content:"\\e043"}
+ content:"\e043"}
.glyphicon-print:before {
- content:"\\e045"}
+ content:"\e045"}
.glyphicon-font:before {
- content:"\\e047"}
+ content:"\e047"}
.glyphicon-bold:before {
- content:"\\e048"}
+ content:"\e048"}
.glyphicon-italic:before {
- content:"\\e049"}
+ content:"\e049"}
.glyphicon-text-height:before {
- content:"\\e050"}
+ content:"\e050"}
.glyphicon-text-width:before {
- content:"\\e051"}
+ content:"\e051"}
.glyphicon-align-left:before {
- content:"\\e052"}
+ content:"\e052"}
.glyphicon-align-center:before {
- content:"\\e053"}
+ content:"\e053"}
.glyphicon-align-right:before {
- content:"\\e054"}
+ content:"\e054"}
.glyphicon-align-justify:before {
- content:"\\e055"}
+ content:"\e055"}
.glyphicon-list:before {
- content:"\\e056"}
+ content:"\e056"}
.glyphicon-indent-left:before {
- content:"\\e057"}
+ content:"\e057"}
.glyphicon-indent-right:before {
- content:"\\e058"}
+ content:"\e058"}
.glyphicon-facetime-video:before {
- content:"\\e059"}
+ content:"\e059"}
.glyphicon-picture:before {
- content:"\\e060"}
+ content:"\e060"}
.glyphicon-map-marker:before {
- content:"\\e062"}
+ content:"\e062"}
.glyphicon-adjust:before {
- content:"\\e063"}
+ content:"\e063"}
.glyphicon-tint:before {
- content:"\\e064"}
+ content:"\e064"}
.glyphicon-edit:before {
- content:"\\e065"}
+ content:"\e065"}
.glyphicon-share:before {
- content:"\\e066"}
+ content:"\e066"}
.glyphicon-check:before {
- content:"\\e067"}
+ content:"\e067"}
.glyphicon-move:before {
- content:"\\e068"}
+ content:"\e068"}
.glyphicon-step-backward:before {
- content:"\\e069"}
+ content:"\e069"}
.glyphicon-fast-backward:before {
- content:"\\e070"}
+ content:"\e070"}
.glyphicon-backward:before {
- content:"\\e071"}
+ content:"\e071"}
.glyphicon-play:before {
- content:"\\e072"}
+ content:"\e072"}
.glyphicon-pause:before {
- content:"\\e073"}
+ content:"\e073"}
.glyphicon-stop:before {
- content:"\\e074"}
+ content:"\e074"}
.glyphicon-forward:before {
- content:"\\e075"}
+ content:"\e075"}
.glyphicon-fast-forward:before {
- content:"\\e076"}
+ content:"\e076"}
.glyphicon-step-forward:before {
- content:"\\e077"}
+ content:"\e077"}
.glyphicon-eject:before {
- content:"\\e078"}
+ content:"\e078"}
.glyphicon-chevron-left:before {
- content:"\\e079"}
+ content:"\e079"}
.glyphicon-chevron-right:before {
- content:"\\e080"}
+ content:"\e080"}
.glyphicon-plus-sign:before {
- content:"\\e081"}
+ content:"\e081"}
.glyphicon-minus-sign:before {
- content:"\\e082"}
+ content:"\e082"}
.glyphicon-remove-sign:before {
- content:"\\e083"}
+ content:"\e083"}
.glyphicon-ok-sign:before {
- content:"\\e084"}
+ content:"\e084"}
.glyphicon-question-sign:before {
- content:"\\e085"}
+ content:"\e085"}
.glyphicon-info-sign:before {
- content:"\\e086"}
+ content:"\e086"}
.glyphicon-screenshot:before {
- content:"\\e087"}
+ content:"\e087"}
.glyphicon-remove-circle:before {
- content:"\\e088"}
+ content:"\e088"}
.glyphicon-ok-circle:before {
- content:"\\e089"}
+ content:"\e089"}
.glyphicon-ban-circle:before {
- content:"\\e090"}
+ content:"\e090"}
.glyphicon-arrow-left:before {
- content:"\\e091"}
+ content:"\e091"}
.glyphicon-arrow-right:before {
- content:"\\e092"}
+ content:"\e092"}
.glyphicon-arrow-up:before {
- content:"\\e093"}
+ content:"\e093"}
.glyphicon-arrow-down:before {
- content:"\\e094"}
+ content:"\e094"}
.glyphicon-share-alt:before {
- content:"\\e095"}
+ content:"\e095"}
.glyphicon-resize-full:before {
- content:"\\e096"}
+ content:"\e096"}
.glyphicon-resize-small:before {
- content:"\\e097"}
+ content:"\e097"}
.glyphicon-exclamation-sign:before {
- content:"\\e101"}
+ content:"\e101"}
.glyphicon-gift:before {
- content:"\\e102"}
+ content:"\e102"}
.glyphicon-leaf:before {
- content:"\\e103"}
+ content:"\e103"}
.glyphicon-eye-open:before {
- content:"\\e105"}
+ content:"\e105"}
.glyphicon-eye-close:before {
- content:"\\e106"}
+ content:"\e106"}
.glyphicon-warning-sign:before {
- content:"\\e107"}
+ content:"\e107"}
.glyphicon-plane:before {
- content:"\\e108"}
+ content:"\e108"}
.glyphicon-random:before {
- content:"\\e110"}
+ content:"\e110"}
.glyphicon-comment:before {
- content:"\\e111"}
+ content:"\e111"}
.glyphicon-magnet:before {
- content:"\\e112"}
+ content:"\e112"}
.glyphicon-chevron-up:before {
- content:"\\e113"}
+ content:"\e113"}
.glyphicon-chevron-down:before {
- content:"\\e114"}
+ content:"\e114"}
.glyphicon-retweet:before {
- content:"\\e115"}
+ content:"\e115"}
.glyphicon-shopping-cart:before {
- content:"\\e116"}
+ content:"\e116"}
.glyphicon-folder-close:before {
- content:"\\e117"}
+ content:"\e117"}
.glyphicon-folder-open:before {
- content:"\\e118"}
+ content:"\e118"}
.glyphicon-resize-vertical:before {
- content:"\\e119"}
+ content:"\e119"}
.glyphicon-resize-horizontal:before {
- content:"\\e120"}
+ content:"\e120"}
.glyphicon-hdd:before {
- content:"\\e121"}
+ content:"\e121"}
.glyphicon-bullhorn:before {
- content:"\\e122"}
+ content:"\e122"}
.glyphicon-certificate:before {
- content:"\\e124"}
+ content:"\e124"}
.glyphicon-thumbs-up:before {
- content:"\\e125"}
+ content:"\e125"}
.glyphicon-thumbs-down:before {
- content:"\\e126"}
+ content:"\e126"}
.glyphicon-hand-right:before {
- content:"\\e127"}
+ content:"\e127"}
.glyphicon-hand-left:before {
- content:"\\e128"}
+ content:"\e128"}
.glyphicon-hand-up:before {
- content:"\\e129"}
+ content:"\e129"}
.glyphicon-hand-down:before {
- content:"\\e130"}
+ content:"\e130"}
.glyphicon-circle-arrow-right:before {
- content:"\\e131"}
+ content:"\e131"}
.glyphicon-circle-arrow-left:before {
- content:"\\e132"}
+ content:"\e132"}
.glyphicon-circle-arrow-up:before {
- content:"\\e133"}
+ content:"\e133"}
.glyphicon-circle-arrow-down:before {
- content:"\\e134"}
+ content:"\e134"}
.glyphicon-globe:before {
- content:"\\e135"}
+ content:"\e135"}
.glyphicon-tasks:before {
- content:"\\e137"}
+ content:"\e137"}
.glyphicon-filter:before {
- content:"\\e138"}
+ content:"\e138"}
.glyphicon-fullscreen:before {
- content:"\\e140"}
+ content:"\e140"}
.glyphicon-dashboard:before {
- content:"\\e141"}
+ content:"\e141"}
.glyphicon-heart-empty:before {
- content:"\\e143"}
+ content:"\e143"}
.glyphicon-link:before {
- content:"\\e144"}
+ content:"\e144"}
.glyphicon-phone:before {
- content:"\\e145"}
+ content:"\e145"}
.glyphicon-usd:before {
- content:"\\e148"}
+ content:"\e148"}
.glyphicon-gbp:before {
- content:"\\e149"}
+ content:"\e149"}
.glyphicon-sort:before {
- content:"\\e150"}
+ content:"\e150"}
.glyphicon-sort-by-alphabet:before {
- content:"\\e151"}
+ content:"\e151"}
.glyphicon-sort-by-alphabet-alt:before {
- content:"\\e152"}
+ content:"\e152"}
.glyphicon-sort-by-order:before {
- content:"\\e153"}
+ content:"\e153"}
.glyphicon-sort-by-order-alt:before {
- content:"\\e154"}
+ content:"\e154"}
.glyphicon-sort-by-attributes:before {
- content:"\\e155"}
+ content:"\e155"}
.glyphicon-sort-by-attributes-alt:before {
- content:"\\e156"}
+ content:"\e156"}
.glyphicon-unchecked:before {
- content:"\\e157"}
+ content:"\e157"}
.glyphicon-expand:before {
- content:"\\e158"}
+ content:"\e158"}
.glyphicon-collapse-down:before {
- content:"\\e159"}
+ content:"\e159"}
.glyphicon-collapse-up:before {
- content:"\\e160"}
+ content:"\e160"}
.glyphicon-log-in:before {
- content:"\\e161"}
+ content:"\e161"}
.glyphicon-flash:before {
- content:"\\e162"}
+ content:"\e162"}
.glyphicon-log-out:before {
- content:"\\e163"}
+ content:"\e163"}
.glyphicon-new-window:before {
- content:"\\e164"}
+ content:"\e164"}
.glyphicon-record:before {
- content:"\\e165"}
+ content:"\e165"}
.glyphicon-save:before {
- content:"\\e166"}
+ content:"\e166"}
.glyphicon-open:before {
- content:"\\e167"}
+ content:"\e167"}
.glyphicon-saved:before {
- content:"\\e168"}
+ content:"\e168"}
.glyphicon-import:before {
- content:"\\e169"}
+ content:"\e169"}
.glyphicon-export:before {
- content:"\\e170"}
+ content:"\e170"}
.glyphicon-send:before {
- content:"\\e171"}
+ content:"\e171"}
.glyphicon-floppy-disk:before {
- content:"\\e172"}
+ content:"\e172"}
.glyphicon-floppy-saved:before {
- content:"\\e173"}
+ content:"\e173"}
.glyphicon-floppy-remove:before {
- content:"\\e174"}
+ content:"\e174"}
.glyphicon-floppy-save:before {
- content:"\\e175"}
+ content:"\e175"}
.glyphicon-floppy-open:before {
- content:"\\e176"}
+ content:"\e176"}
.glyphicon-credit-card:before {
- content:"\\e177"}
+ content:"\e177"}
.glyphicon-transfer:before {
- content:"\\e178"}
+ content:"\e178"}
.glyphicon-cutlery:before {
- content:"\\e179"}
+ content:"\e179"}
.glyphicon-header:before {
- content:"\\e180"}
+ content:"\e180"}
.glyphicon-compressed:before {
- content:"\\e181"}
+ content:"\e181"}
.glyphicon-earphone:before {
- content:"\\e182"}
+ content:"\e182"}
.glyphicon-phone-alt:before {
- content:"\\e183"}
+ content:"\e183"}
.glyphicon-tower:before {
- content:"\\e184"}
+ content:"\e184"}
.glyphicon-stats:before {
- content:"\\e185"}
+ content:"\e185"}
.glyphicon-sd-video:before {
- content:"\\e186"}
+ content:"\e186"}
.glyphicon-hd-video:before {
- content:"\\e187"}
+ content:"\e187"}
.glyphicon-subtitles:before {
- content:"\\e188"}
+ content:"\e188"}
.glyphicon-sound-stereo:before {
- content:"\\e189"}
+ content:"\e189"}
.glyphicon-sound-dolby:before {
- content:"\\e190"}
+ content:"\e190"}
.glyphicon-sound-5-1:before {
- content:"\\e191"}
+ content:"\e191"}
.glyphicon-sound-6-1:before {
- content:"\\e192"}
+ content:"\e192"}
.glyphicon-sound-7-1:before {
- content:"\\e193"}
+ content:"\e193"}
.glyphicon-copyright-mark:before {
- content:"\\e194"}
+ content:"\e194"}
.glyphicon-registration-mark:before {
- content:"\\e195"}
+ content:"\e195"}
.glyphicon-cloud-download:before {
- content:"\\e197"}
+ content:"\e197"}
.glyphicon-cloud-upload:before {
- content:"\\e198"}
+ content:"\e198"}
.glyphicon-tree-conifer:before {
- content:"\\e199"}
+ content:"\e199"}
.glyphicon-tree-deciduous:before {
- content:"\\e200"}
+ content:"\e200"}
.glyphicon-briefcase:before {
- content:"\\1f4bc"}
+ content:"\1f4bc"}
.glyphicon-calendar:before {
- content:"\\1f4c5"}
+ content:"\1f4c5"}
.glyphicon-pushpin:before {
- content:"\\1f4cc"}
+ content:"\1f4cc"}
.glyphicon-paperclip:before {
- content:"\\1f4ce"}
+ content:"\1f4ce"}
.glyphicon-camera:before {
- content:"\\1f4f7"}
+ content:"\1f4f7"}
.glyphicon-lock:before {
- content:"\\1f512"}
+ content:"\1f512"}
.glyphicon-bell:before {
- content:"\\1f514"}
+ content:"\1f514"}
.glyphicon-bookmark:before {
- content:"\\1f516"}
+ content:"\1f516"}
.glyphicon-fire:before {
- content:"\\1f525"}
+ content:"\1f525"}
.glyphicon-wrench:before {
- content:"\\1f527"}
+ content:"\1f527"}
.caret {
display:inline-block;
width:0;
@@ -2442,7 +2442,7 @@ textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon
.breadcrumb>li+li:before {
padding:0 5px;
color:#ccc;
- content:"/\\00a0"}
+ content:"/\00a0"}
.breadcrumb>.active {
color:#999}
.pagination {
@@ -3375,9 +3375,9 @@ body.modal-open,.modal-open .navbar-fixed-top,.modal-open .navbar-fixed-bottom {
margin-left:-10px;
font-family:serif}
.carousel-control .icon-prev:before {
- content:'\\2039'}
+ content:'\2039'}
.carousel-control .icon-next:before {
- content:'\\203a'}
+ content:'\203a'}
.carousel-indicators {
position:absolute;
bottom:10px;
diff --git a/addons/website/static/lib/bootstrap/fonts/glyphicons-halflings-regular.eot b/addons/website/static/lib/bootstrap/fonts/glyphicons-halflings-regular.eot
new file mode 100644
index 00000000000..87eaa434234
Binary files /dev/null and b/addons/website/static/lib/bootstrap/fonts/glyphicons-halflings-regular.eot differ
diff --git a/addons/website/static/lib/bootstrap/fonts/glyphicons-halflings-regular.svg b/addons/website/static/lib/bootstrap/fonts/glyphicons-halflings-regular.svg
new file mode 100644
index 00000000000..5fee0685496
--- /dev/null
+++ b/addons/website/static/lib/bootstrap/fonts/glyphicons-halflings-regular.svg
@@ -0,0 +1,228 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/website/static/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf b/addons/website/static/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf
new file mode 100644
index 00000000000..be784dc1d5b
Binary files /dev/null and b/addons/website/static/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf differ
diff --git a/addons/website/static/lib/bootstrap/fonts/glyphicons-halflings-regular.woff b/addons/website/static/lib/bootstrap/fonts/glyphicons-halflings-regular.woff
new file mode 100644
index 00000000000..2cc3e4852a5
Binary files /dev/null and b/addons/website/static/lib/bootstrap/fonts/glyphicons-halflings-regular.woff differ
diff --git a/addons/website/static/src/css/editor.css b/addons/website/static/src/css/editor.css
index 31167984b83..64f58c8db11 100644
--- a/addons/website/static/src/css/editor.css
+++ b/addons/website/static/src/css/editor.css
@@ -1,3 +1,4 @@
+@charset "UTF-8";
/* ---- CKEditor Minimal Reset ---- */
.navbar.navbar-inverse .cke_chrome {
border: none;
@@ -7,6 +8,19 @@
background: transparent;
}
+.navbar.navbar-inverse .cke_toolbar {
+ position: relative;
+ top: 1px;
+}
+.navbar.navbar-inverse .cke_combo_button {
+ padding-top: 3px;
+ padding-bottom: 3px;
+}
+.navbar.navbar-inverse .cke_button {
+ padding-top: 7px;
+ padding-bottom: 7px;
+}
+
.navbar.navbar-inverse .cke_top {
background: transparent;
border: none;
@@ -86,6 +100,9 @@ table.editorbar-panel {
cursor: pointer;
width: 100%;
}
+table.editorbar-panel td {
+ border: 1px solid #aaaaaa;
+}
table.editorbar-panel td.selected {
background-color: #b1c9d9;
}
@@ -99,6 +116,18 @@ table.editorbar-panel td.selected {
user-select: auto;
}
+.modal-dialog.select-image {
+ width: 80%;
+}
+
+.modal .existing-attachments .pager {
+ margin: 0;
+}
+
+.modal .image-preview {
+ margin-bottom: 0.5em;
+}
+
.cke_widget_drag_handler_container {
display: none !important;
}
@@ -108,192 +137,232 @@ table.editorbar-panel td.selected {
position: fixed;
left: 0px;
right: 0px;
- bottom: 0px;
- max-height: 280px;
- min-height: 140px;
+ top: 50px;
background: #282828;
box-shadow: 0px 10px 10px -10px black inset;
+ z-index: 1010;
+ overflow: hidden;
+ height: 110px;
+}
+#oe_snippets:hover {
+ height: auto;
+}
+#oe_snippets .scroll {
+ white-space: nowrap;
overflow-y: auto;
- z-index: 20000;
}
-#oe_snippets .nav-pills {
- padding: 3px 8px;
+#oe_snippets .nav {
+ padding: 3px 15px;
+ width: 162px;
background: #444444;
+ position: fixed;
+ z-index: 1;
+ height: 108px;
}
-#oe_snippets .nav-pills > li > a {
+#oe_snippets .nav > li {
+ display: block;
+ float: none;
+}
+#oe_snippets .nav > li > a {
padding: 2px 10px !important;
+ width: 100%;
+ display: block;
}
#oe_snippets .pill-content {
- height: 140px;
+ display: inline-block;
+ height: 110px;
+ white-space: nowrap;
+ padding-left: 166px;
+}
+#oe_snippets .pill-content > div {
+ display: inline-block;
+}
+#oe_snippets .pill-content > div label {
+ width: 44px;
+ height: 100%;
+ color: white;
+ padding-left: 10px;
+}
+#oe_snippets .pill-content > div label div {
+ width: 100px;
+ text-align: center;
+ -webkit-transform: translate(-39px, 44px) rotate(-90deg);
+ -moz-transform: translate(-39px, 44px) rotate(-90deg);
+ -o-transform: translate(-39px, 44px) rotate(-90deg);
+ transform: translate(-39px, 44px) rotate(-90deg);
+ -webkit-transform-origin: 50% 50%;
+ -moz-transform-origin: 50% 50%;
+ -ms-transform-origin: 50% 50%;
+ -o-transform-origin: 50% 50%;
+ transform-origin: 50% 50%;
}
.oe_snippet {
display: inline-block;
vertical-align: top;
- background: white;
- width: 120px;
- height: 120px;
+ width: 108px;
+ height: 108px;
border-radius: 3px;
- margin: 10px;
- margin-right: 0px;
+ margin: 1px;
+ margin-top: 0px;
position: relative;
- box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.2);
overflow: hidden;
-webkit-user-select: none;
user-select: none;
cursor: move;
-}
-.oe_snippet .oe_snippet_thumbnail.oe_label {
- text-align: center;
- background: #747474;
- background-image: radial-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.4));
- height: 100%;
- line-height: 120px;
- color: white;
- text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.95);
- box-shadow: 0px 0px 0px 1px rgba(255, 255, 255, 0.07) inset;
-}
-.oe_snippet .oe_snippet_body {
- display: none;
-}
-.oe_snippet > * {
pointer-events: none;
}
-.oe_snippet > :not(.oe_snippet_body):not(.oe_snippet_thumbnail) {
+.oe_snippet .oe_snippet_thumbnail {
+ pointer-events: auto;
+ text-align: center;
+ height: 100%;
+ background: transparent;
+ color: white;
+ text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.95);
+ position: relative;
+}
+.oe_snippet .oe_snippet_thumbnail span, .oe_snippet .oe_snippet_thumbnail div {
+ line-height: 18px;
+}
+.oe_snippet > :not(.oe_snippet_thumbnail) {
display: none !important;
}
-.oe_snippet > *:first-child:not(.oe_snippet_thumbnail) {
- display: block;
- -webkit-transform-origin-x: 5px;
- -webkit-transform-origin-y: 10px;
- -webkit-transform: scale(0.095);
+
+#oe_snippets .oe_snippet_thumbnail {
+ background: #747474;
+ background-image: radial-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.4));
+ box-shadow: 0px 0px 0px 1px rgba(255, 255, 255, 0.07) inset;
}
/* ---- SNIPPETS DROP ZONES ---- */
+.col-md-12 {
+ float: left;
+}
+
.oe_drop_zone.oe_insert {
display: block;
- height: 32px;
- margin: -16px 0px;
+ height: 48px;
+ margin: 0px;
+ margin-bottom: -48px;
-webkit-transition: margin 250ms linear;
width: 100%;
- z-index: 1000;
position: absolute;
- background: rgba(153, 0, 255, 0.17);
- border-radius: 3px;
+ z-index: 1000;
}
-.oe_drop_zone.oe_insert:first-child:not(:last-child) {
- margin-top: -8px;
- margin-bottom: -24px;
-}
-.oe_drop_zone.oe_insert:last-child:not(:first-child) {
- margin-top: -24px;
- margin-bottom: -8px;
-}
-.oe_drop_zone.oe_insert:before {
+.oe_drop_zone.oe_insert:not(.oe_vertical):before {
content: "";
display: block;
border-top: dashed 2px rgba(209, 178, 255, 0.72);
position: relative;
- top: 16px;
-}
-.oe_drop_zone.oe_insert:first-child:not(:last-child):before {
- top: 8px;
-}
-.oe_drop_zone.oe_insert:last-child:not(:first-child):before {
- top: 24px;
+ top: 0px;
}
.oe_drop_zone.oe_insert.oe_hover:before {
border-top: dashed 2px rgba(116, 255, 161, 0.72);
}
.oe_drop_zone.oe_insert.oe_vertical {
- width: 16px;
- display: inline-block;
- position: absolute;
- margin: 0px !important;
+ width: 48px;
+ float: left;
+ position: relative;
+ margin: 0px -24px !important;
}
-
-.oe_drop_zone {
+.oe_drop_zone.oe_insert.oe_overlay {
background: rgba(153, 0, 255, 0.17);
border-radius: 3px;
}
-.oe_drop_zone.oe_hover {
+
+.oe_drop_zone, .oe_drop_zone_style {
+ background: rgba(153, 0, 255, 0.17);
+ border-radius: 3px;
+}
+.oe_drop_zone.oe_hover, .oe_drop_zone_style.oe_hover {
background: rgba(0, 255, 133, 0.22);
z-index: 1001;
}
+.oe_drop_zone_style {
+ color: white;
+ height: 48px;
+ margin-bottom: 32px;
+}
+
/* ---- SNIPPET MANIPULATOR ---- */
.oe_overlay {
- display: block;
+ display: none;
position: absolute;
background: transparent;
border-radius: 3px;
- opacity: 0;
transition: opacity 100ms linear;
box-sizing: border-box;
pointer-events: none;
}
-.oe_overlay.oe_hover {
- opacity: 1;
- cursor: pointer;
-}
-.oe_overlay.oe_selected, .oe_overlay.oe_active {
- opacity: 1;
- background: transparent;
+.oe_overlay.oe_active {
+ display: block;
border-style: dashed;
border-width: 1px;
box-shadow: 0px 0px 0px 1px rgba(255, 255, 255, 0.3), 0px 0px 0px 1px rgba(255, 255, 255, 0.3) inset;
-}
-.oe_overlay.oe_selected {
- border-color: rgba(0, 153, 255, 0.5);
-}
-.oe_overlay .oe_handle {
- display: none !important;
-}
-.oe_overlay.oe_active {
border-color: rgba(153, 0, 255, 0.5);
}
.oe_overlay.oe_active .oe_handle {
display: block !important;
pointer-events: auto;
}
+.oe_overlay.oe_active .oe_handle:before {
+ position: relative;
+ top: 50%;
+ left: 50%;
+ display: block;
+ background: white;
+ border: solid 1px #9900ff;
+ border-radius: 8px;
+ width: 16px;
+ height: 16px;
+ margin: -8px;
+ padding-left: 1px;
+ font-size: 14px;
+ line-height: 14px;
+ color: #9900ff;
+ -webkit-transition: background 100ms linear;
+}
+.oe_overlay.oe_active .oe_handle:hover:before {
+ background: #9900ff;
+ color: white;
+}
+.oe_overlay.oe_active .oe_handle.e:before {
+ content: "⇨";
+}
+.oe_overlay.oe_active .oe_handle.s:before {
+ content: "⇩";
+}
+.oe_overlay.oe_active .oe_handle.w:before {
+ content: "⇦";
+}
+.oe_overlay.oe_active .oe_handle.n:before {
+ content: "⇧";
+}
.oe_overlay .icon.btn {
display: inline-block;
}
.oe_overlay .oe_overlay_options {
- display: none;
- z-index: 1002;
-}
-.oe_overlay .oe_overlay_options .oe_options, .oe_overlay .oe_overlay_options .oe_label, .oe_overlay .oe_overlay_options .oe_move {
position: absolute;
- display: block;
- z-index: 1002;
+ width: 100%;
+ text-align: center;
top: -11px;
+ z-index: 1002;
}
-.oe_overlay .oe_overlay_options .oe_options {
+.oe_overlay .oe_overlay_options .btn, .oe_overlay .oe_overlay_options a {
pointer-events: auto;
- left: -14px;
+ cursor: pointer;
}
-.oe_overlay .oe_overlay_options .oe_label {
- top: -8px;
- right: 6px;
- background: white;
- font-size: 75%;
- color: rgba(153, 0, 255, 0.5);
- padding: 0 5px;
+.oe_overlay .oe_overlay_options .dropdown {
+ display: inline-block;
}
-.oe_overlay .oe_overlay_options .oe_move {
- pointer-events: auto;
- left: 50%;
-}
-.oe_overlay .oe_overlay_options .oe_move .js_box_move {
- margin-left: -50%;
+.oe_overlay .oe_overlay_options .dropdown-menu {
+ text-align: left;
+ min-width: 180px;
}
.oe_overlay .oe_overlay_options .dropdown-menu select, .oe_overlay .oe_overlay_options .dropdown-menu input {
display: block;
}
-.oe_overlay.oe_active .oe_overlay_options {
- display: block;
-}
.oe_handle {
pointer-events: auto;
@@ -414,10 +483,30 @@ table.editorbar-panel td.selected {
.oe_seo_configuration .oe_seo_suggestion {
cursor: pointer;
}
+.oe_seo_configuration .oe_seo_keyword {
+ padding: 0.2em 0.4em 0.2em 0.5em;
+ border-radius: 0.4em;
+}
+.oe_seo_configuration .keyword-in-title {
+ background-color: #5cb85c;
+ color: white;
+}
+.oe_seo_configuration .keyword-in-description {
+ background-color: #428bca;
+ color: white;
+}
+.oe_seo_configuration .keyword-in-body {
+ background-color: #5bc0de;
+ color: white;
+}
/* ---- ACE EDITOR ---- */
.oe_ace_view_editor {
transition: all 0.2s ease-in;
+ -webkit-transition: all 0.2s ease-in;
+ -ms-transition: all 0.2s ease-in;
+ -o-transition: all 0.2s ease-in;
+ -moz-transition: all 0.2s ease-in;
opacity: 0.3;
position: fixed;
top: 51px;
@@ -435,10 +524,16 @@ table.editorbar-panel td.selected {
.oe_ace_view_editor .oe_ace_view_editor_title .oe_view_list {
width: 50%;
height: 32px;
+ font-size: 14px;
+ font-family: "Monaco", "Menlo", "Ubuntu Mono", "Consolas", "source-code-pro", monospace;
+ line-height: normal;
}
.oe_ace_view_editor .oe_ace_view_editor_title .btn {
height: 32px;
padding: 0 4px 0 4px;
+ font-size: 14px;
+ font-family: "Monaco", "Menlo", "Ubuntu Mono", "Consolas", "source-code-pro", monospace;
+ line-height: normal;
}
.oe_ace_view_editor .ace_editor {
position: absolute;
diff --git a/addons/website/static/src/css/editor.sass b/addons/website/static/src/css/editor.sass
index 597804812f1..90b02d3b83a 100644
--- a/addons/website/static/src/css/editor.sass
+++ b/addons/website/static/src/css/editor.sass
@@ -8,6 +8,17 @@
.navbar.navbar-inverse .cke_inner
background: transparent
+.navbar.navbar-inverse
+ .cke_toolbar
+ position: relative
+ top: 1px
+ .cke_combo_button
+ padding-top: 3px
+ padding-bottom: 3px
+ .cke_button
+ padding-top: 7px
+ padding-bottom: 7px
+
.navbar.navbar-inverse .cke_top
background: transparent
border: none
@@ -77,6 +88,8 @@
table.editorbar-panel
cursor: pointer
width: 100%
+ td
+ border: 1px solid #aaa
td.selected
background-color: #b1c9d9
@@ -91,6 +104,16 @@ table.editorbar-panel
-o-user-select: auto
user-select: auto
+.modal-dialog.select-image
+ width: 80%
+
+.modal .existing-attachments
+ .pager
+ margin: 0
+
+.modal .image-preview
+ margin-bottom: 0.5em
+
// "remove" drag & drop of CKE widgets
.cke_widget_drag_handler_container
display: none !important
@@ -101,165 +124,198 @@ table.editorbar-panel
position: fixed
left: 0px
right: 0px
- bottom: 0px
- max-height: 280px
- min-height: 140px
+ top: 50px
background: rgb(40,40,40)
box-shadow: 0px 10px 10px -10px black inset
- overflow-y: auto
- z-index: 20000
- .nav-pills
- padding: 3px 8px
+ z-index: 1010
+ overflow: hidden
+ height: 110px
+ &:hover
+ height: auto
+ .scroll
+ white-space: nowrap
+ overflow-y: auto
+ .nav
+ padding: 3px 15px
+ width: 162px
background: #444444
- > li > a
- padding: 2px 10px !important
+ > li
+ display: block
+ float: none
+ > a
+ padding: 2px 10px !important
+ width: 100%
+ display: block
+ position: fixed
+ z-index: 1
+ height: 108px
.pill-content
- height: 140px
+ display: inline-block
+ height: 110px
+ white-space: nowrap
+ padding-left: 166px
+ > div
+ display: inline-block
+ label
+ width: 44px
+ height: 100%
+ color: #fff
+ padding-left: 10px
+ div
+ width: 100px
+ text-align: center
+ -webkit-transform: translate(-39px, 44px) rotate(-90deg)
+ -moz-transform: translate(-39px, 44px) rotate(-90deg)
+ -o-transform: translate(-39px, 44px) rotate(-90deg)
+ transform: translate(-39px, 44px) rotate(-90deg)
+ -webkit-transform-origin: 50% 50%
+ -moz-transform-origin: 50% 50%
+ -ms-transform-origin: 50% 50%
+ -o-transform-origin: 50% 50%
+ transform-origin: 50% 50%
.oe_snippet
display: inline-block
vertical-align: top
- background: white
- width: 120px
- height: 120px
+ width: 108px
+ height: 108px
border-radius: 3px
- margin: 10px
- margin-right: 0px
+ margin: 1px
+ margin-top: 0px
position: relative
- box-shadow: 0px 3px 10px rgba(0,0,0,0.2)
overflow: hidden
-webkit-user-select: none
user-select: none
cursor: move
+ pointer-events: none
- .oe_snippet_thumbnail.oe_label
+ .oe_snippet_thumbnail
+ pointer-events: auto
text-align: center
- background: rgb(116, 116, 116)
- background-image: radial-gradient(rgba(0,0,0,0.25),rgba(0,0,0,0.4))
height: 100%
- line-height: 120px
+ background: transparent
color: white
text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.95)
- box-shadow: 0px 0px 0px 1px rgba(255, 255, 255, 0.07) inset
-
- .oe_snippet_body
- display: none
- & > *
- pointer-events: none
- & > :not(.oe_snippet_body):not(.oe_snippet_thumbnail)
+ position: relative
+ span, div
+ line-height: 18px
+ & > :not(.oe_snippet_thumbnail)
display: none !important
- & > *:first-child:not(.oe_snippet_thumbnail)
- display: block
- -webkit-transform-origin-x: 5px
- -webkit-transform-origin-y: 10px
- -webkit-transform: scale(0.095)
-
+#oe_snippets .oe_snippet_thumbnail
+ background: rgb(116, 116, 116)
+ background-image: radial-gradient(rgba(0,0,0,0.25),rgba(0,0,0,0.4))
+ box-shadow: 0px 0px 0px 1px rgba(255, 255, 255, 0.07) inset
/* ---- SNIPPETS DROP ZONES ---- */
+.col-md-12
+ float: left
.oe_drop_zone.oe_insert
display: block
- height: 32px
- margin: -16px 0px
+ height: 48px
+ margin: 0px
+ margin-bottom: -48px
-webkit-transition: margin 250ms linear
width: 100%
+ position: absolute
z-index: 1000
- &:first-child:not(:last-child)
- margin-top: -8px
- margin-bottom: -24px
- &:last-child:not(:first-child)
- margin-top: -24px
- margin-bottom: -8px
- &:before
+ &:not(.oe_vertical):before
content: ""
display: block
border-top: dashed 2px rgba(209, 178, 255, 0.72)
position: relative
- top: 16px
- &:first-child:not(:last-child):before
- top: 8px
- &:last-child:not(:first-child):before
- top: 24px
+ top: 0px
&.oe_hover:before
border-top: dashed 2px rgba(116, 255, 161, 0.72)
&.oe_vertical
- width: 16px
- display: inline-block
- position: absolute
- margin: 0px !important
+ width: 48px
+ float: left
+ position: relative
+ margin: 0px -24px !important
&.oe_overlay
- position: absolute
- background: rgba(153, 0, 255, 0.17)
- border-radius: 3px
+ background: rgba(153, 0, 255, 0.17)
+ border-radius: 3px
-.oe_drop_zone
+.oe_drop_zone, .oe_drop_zone_style
background: rgba(153, 0, 255, 0.17)
border-radius: 3px
&.oe_hover
background: rgba(0, 255, 133, 0.22)
z-index: 1001
+.oe_drop_zone_style
+ color: white
+ height: 48px
+ margin-bottom: 32px
+
/* ---- SNIPPET MANIPULATOR ---- */
.oe_overlay
- display: block
+ display: none
position: absolute
- background: transparent //rgba(153, 0, 255, 0.05)
+ background: transparent
border-radius: 3px
- opacity: 0
transition: opacity 100ms linear
box-sizing: border-box
pointer-events: none
- &.oe_hover
- opacity: 1
- cursor: pointer
- &.oe_selected, &.oe_active
- opacity: 1
- background: transparent
+ &.oe_active
+ display: block
border-style: dashed
border-width: 1px
box-shadow: 0px 0px 0px 1px rgba(255,255,255,0.3), 0px 0px 0px 1px rgba(255,255,255,0.3) inset
- &.oe_selected
- border-color: rgba(0, 153, 255, 0.5)
- .oe_handle
- display: none !important
- &.oe_active
border-color: rgba(153, 0, 255, 0.5)
.oe_handle
display: block !important
pointer-events: auto
+ &:before
+ position: relative
+ top: 50%
+ left: 50%
+ display: block
+ background: rgba(255, 255, 255, 1)
+ border: solid 1px rgba(153, 0, 255, 1)
+ border-radius: 8px
+ width: 16px
+ height: 16px
+ margin: -8px
+ padding-left: 1px
+ font-size: 14px
+ line-height: 14px
+ color: rgba(153, 0, 255, 1)
+ -webkit-transition: background 100ms linear
+ &:hover:before
+ background: rgba(153, 0, 255, 1)
+ color: #fff
+ .oe_handle.e:before
+ content: "⇨"
+ .oe_handle.s:before
+ content: "⇩"
+ .oe_handle.w:before
+ content: "⇦"
+ .oe_handle.n:before
+ content: "⇧"
+
.icon.btn
display: inline-block
.oe_overlay_options
- display: none
+ position: absolute
+ width: 100%
+ text-align: center
+ top: -11px
z-index: 1002
- .oe_options,.oe_label,.oe_move
- position: absolute
- display: block
- z-index: 1002
- top: -11px
- .oe_options
+ .btn, a
pointer-events: auto
- left: -14px
- .oe_label
- top: -8px
- right: 6px
- background: #fff
- font-size: 75%
- color: rgba(153, 0, 255, 0.5)
- padding: 0 5px
- .oe_move
- pointer-events: auto
- left: 50%
- .js_box_move
- margin-left: -50%
+ cursor: pointer
+ .dropdown
+ display: inline-block
+ .dropdown-menu
+ text-align: left
+ min-width: 180px
.dropdown-menu select,.dropdown-menu input
display: block
- &.oe_active .oe_overlay_options
- display: block
.oe_handle
pointer-events: auto
@@ -354,6 +410,10 @@ $icon_close: #E00101
/* ---- SEO TOOLS ---- */
$remove_color: $icon_close
+$in_title_color: #5cb85c
+$in_description_color: #428bca
+$in_body_color: #5bc0de
+$highlighted_text_color: #ffffff
.oe_seo_configuration
.modal-dialog
width: 80%
@@ -361,6 +421,18 @@ $remove_color: $icon_close
color: $remove_color
.oe_seo_suggestion
cursor: pointer
+ .oe_seo_keyword
+ padding: .2em .4em .2em .5em
+ border-radius: .4em
+ .keyword-in-title
+ background-color: $in_title_color
+ color: $highlighted_text_color
+ .keyword-in-description
+ background-color: $in_description_color
+ color: $highlighted_text_color
+ .keyword-in-body
+ background-color: $in_body_color
+ color: $highlighted_text_color
/* ---- ACE EDITOR ---- */
@@ -369,8 +441,16 @@ $editorbar_height: 40px
// TODO Fix => might break with themes
$navbar_height: 51px
+@mixin editor-font
+ font-size: 14px
+ font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace
+ line-height: normal
.oe_ace_view_editor
transition: all 0.2s ease-in
+ -webkit-transition: all 0.2s ease-in
+ -ms-transition: all 0.2s ease-in
+ -o-transition: all 0.2s ease-in
+ -moz-transition: all 0.2s ease-in
opacity: 0.3
position: fixed
top: $navbar_height
@@ -386,9 +466,11 @@ $navbar_height: 51px
.oe_view_list
width: 50%
height: $editorbar_height - 8px
+ @include editor-font
.btn
height: $editorbar_height - 8px
padding: 0 4px 0 4px
+ @include editor-font
.ace_editor
position: absolute
top: $editorbar_height
diff --git a/addons/website/static/src/css/fonts/glyphicons-halflings-regular.eot b/addons/website/static/src/css/fonts/glyphicons-halflings-regular.eot
new file mode 100644
index 00000000000..87eaa434234
Binary files /dev/null and b/addons/website/static/src/css/fonts/glyphicons-halflings-regular.eot differ
diff --git a/addons/website/static/src/css/fonts/glyphicons-halflings-regular.svg b/addons/website/static/src/css/fonts/glyphicons-halflings-regular.svg
new file mode 100644
index 00000000000..5fee0685496
--- /dev/null
+++ b/addons/website/static/src/css/fonts/glyphicons-halflings-regular.svg
@@ -0,0 +1,228 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/website/static/src/css/fonts/glyphicons-halflings-regular.ttf b/addons/website/static/src/css/fonts/glyphicons-halflings-regular.ttf
new file mode 100644
index 00000000000..be784dc1d5b
Binary files /dev/null and b/addons/website/static/src/css/fonts/glyphicons-halflings-regular.ttf differ
diff --git a/addons/website/static/src/css/fonts/glyphicons-halflings-regular.woff b/addons/website/static/src/css/fonts/glyphicons-halflings-regular.woff
new file mode 100644
index 00000000000..2cc3e4852a5
Binary files /dev/null and b/addons/website/static/src/css/fonts/glyphicons-halflings-regular.woff differ
diff --git a/addons/website/static/src/css/snippets.css b/addons/website/static/src/css/snippets.css
index 5b7d404a1fd..628689b78cf 100644
--- a/addons/website/static/src/css/snippets.css
+++ b/addons/website/static/src/css/snippets.css
@@ -206,4 +206,16 @@
[data-snippet-id] {
min-height: 10px;
min-width: 10px;
-}
\ No newline at end of file
+}
+
+
+/* Custom CSS for snippets */
+.carousel.oe_small .carousel-inner {
+ height: 200px;
+}
+.carousel.oe_medium .carousel-inner {
+ height: 300px;
+}
+.carousel.oe_big .carousel-inner {
+ height: 450px;
+}
diff --git a/addons/website/static/src/css/website.css b/addons/website/static/src/css/website.css
index 75de4387083..c48d4fa9b2a 100644
--- a/addons/website/static/src/css/website.css
+++ b/addons/website/static/src/css/website.css
@@ -78,6 +78,78 @@
margin-bottom: 0px !important;
}
+.pt128 {
+ padding-top: 128px !important;
+}
+
+.pt92 {
+ padding-top: 92px !important;
+}
+
+.pt64 {
+ padding-top: 64px !important;
+}
+
+.pt48 {
+ padding-top: 48px !important;
+}
+
+.pt32 {
+ padding-top: 32px !important;
+}
+
+.pt16 {
+ padding-top: 16px !important;
+}
+
+.pt8 {
+ padding-top: 8px !important;
+}
+
+.pt4 {
+ padding-top: 4px !important;
+}
+
+.pt0 {
+ padding-top: 0px !important;
+}
+
+.pb128 {
+ padding-bottom: 128px !important;
+}
+
+.pb92 {
+ padding-bottom: 92px !important;
+}
+
+.pb64 {
+ padding-bottom: 64px !important;
+}
+
+.pb48 {
+ padding-bottom: 48px !important;
+}
+
+.pb32 {
+ padding-bottom: 32px !important;
+}
+
+.pb16 {
+ padding-bottom: 16px !important;
+}
+
+.pb8 {
+ padding-bottom: 8px !important;
+}
+
+.pb4 {
+ padding-bottom: 4px !important;
+}
+
+.pb0 {
+ padding-bottom: 0px !important;
+}
+
/* Grid of unequally tall elements */
.grid > [class*="col-md"] {
display: inline-block;
@@ -95,6 +167,28 @@
vertical-align: bottom;
}
+/* Extra Styles */
+img.shadow {
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ -ms-border-radius: 3px;
+ -o-border-radius: 3px;
+ border-radius: 3px;
+ -webkit-box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2);
+ -moz-box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2);
+ box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2);
+ margin: 0 auto;
+}
+
+h1.text-muted, h2.text-muted, h3.text-muted {
+ margin-top: 10px;
+}
+
+/* ----- BOOTSTRAP HACK FOR HEADER NAV BAR ----- */
+.navbar.navbar-default.navbar-static-top {
+ margin-bottom: 0;
+}
+
/* ----- BOOTSTRAP HACK FOR STICKY FOOTER ----- */
html, body, #wrapwrap {
box-sizing: border-box;
@@ -121,19 +215,87 @@ footer {
padding-bottom: 12px;
}
+/* ---- HACK FOR COVERING UP CK EDITOR BOGUS P INSERTION --- */
+.oe_structure.oe_empty:empty, [data-oe-type=html]:empty, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child {
+ background-image: url("/website/static/src/img/drag_here.png");
+ background-repeat: no-repeat;
+ background-position: center top;
+ height: 200px !important;
+}
+
+.oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child {
+ position: static;
+}
+
+.oe_structure.oe_empty:empty:before, [data-oe-type=html]:empty:before, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child:before, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child:before {
+ content: "Drag Building Blocks Here";
+ text-align: center;
+ display: block;
+ padding-top: 100px;
+ padding-bottom: 50px;
+ color: grey;
+ font-size: 24px;
+}
+
/* ---- HACK FOR COVERING UP CK EDITOR BOGUS P INSERTION --- */
.navbar .nav > li > p {
margin-bottom: 0px;
}
-.carousel .item {
- color: white;
+.carousel-inner .item {
+ height: 100%;
+}
+
+.carousel .carousel-caption h1, .carousel .carousel-caption h2, .carousel .carousel-caption h3 {
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+.carousel .carousel-image {
+ right: 10%;
+ left: 50%;
+ top: 5%;
+ bottom: 5%;
+ position: absolute;
+ text-align: center;
+}
+.carousel .carousel-image img {
+ height: 100%;
+ margin: 0 auto;
+}
+.carousel .item.text_image .carousel-caption {
+ left: auto;
+ right: auto;
+ bottom: 10%;
+ text-align: left;
+ padding: 20px;
+ background: rgba(0, 0, 0, 0.4);
+}
+.carousel .item.text_only .carousel-image {
+ display: none;
+}
+.carousel .item.text_only .carousel-caption {
+ left: 10%;
+ right: 10%;
+ top: 10%;
+ text-align: center;
+}
+.carousel .item.image_text .carousel-caption {
+ left: auto;
+ text-align: left;
+ right: 10%;
+ bottom: 10%;
+ padding: 20px;
+ background: rgba(0, 0, 0, 0.4);
+}
+.carousel .item.image_text .carousel-image {
+ right: 50%;
+ left: 10%;
}
/* ---- HOMEPAGE THEME CUSTOMIZATION ---- */
.dark {
background: #eff8f8;
- background: rgba(100, 200, 200, 0.1);
+ background: rgba(100, 200, 200, 0.14);
-webkit-box-shadow: 0px 5px 9px -7px rgba(0, 0, 255, 0.5) inset, 0px -3px 9px -7px rgba(0, 0, 255, 0.5) inset;
-moz-box-shadow: 0px 5px 9px -7px rgba(0, 0, 255, 0.5) inset, 0px -3px 9px -7px rgba(0, 0, 255, 0.5) inset;
box-shadow: 0px 5px 9px -7px rgba(0, 0, 255, 0.5) inset, 0px -3px 9px -7px rgba(0, 0, 255, 0.5) inset;
@@ -143,8 +305,8 @@ footer {
padding-left: 16px;
}
-div#wrap .carousel {
- top: -20px;
+#themes-list .well {
+ padding: 0 0 20px 0;
}
/* -- Hack for removing double scrollbar from mobile preview -- */
diff --git a/addons/website/static/src/css/website.sass b/addons/website/static/src/css/website.sass
index 86cfad27fc6..9f7efa2c416 100644
--- a/addons/website/static/src/css/website.sass
+++ b/addons/website/static/src/css/website.sass
@@ -49,6 +49,44 @@
.mb0
margin-bottom: 0px !important
+.pt128
+ padding-top: 128px !important
+.pt92
+ padding-top: 92px !important
+.pt64
+ padding-top: 64px !important
+.pt48
+ padding-top: 48px !important
+.pt32
+ padding-top: 32px !important
+.pt16
+ padding-top: 16px !important
+.pt8
+ padding-top: 8px !important
+.pt4
+ padding-top: 4px !important
+.pt0
+ padding-top: 0px !important
+
+.pb128
+ padding-bottom: 128px !important
+.pb92
+ padding-bottom: 92px !important
+.pb64
+ padding-bottom: 64px !important
+.pb48
+ padding-bottom: 48px !important
+.pb32
+ padding-bottom: 32px !important
+.pb16
+ padding-bottom: 16px !important
+.pb8
+ padding-bottom: 8px !important
+.pb4
+ padding-bottom: 4px !important
+.pb0
+ padding-bottom: 0px !important
+
/* Grid of unequally tall elements */
.grid > [class*="col-md"]
display: inline-block
@@ -62,6 +100,27 @@
&.grid-align-bottom > [class*="col-md"]
vertical-align: bottom
+/* Extra Styles */
+
+img.shadow
+ -webkit-border-radius: 3px
+ -moz-border-radius: 3px
+ -ms-border-radius: 3px
+ -o-border-radius: 3px
+ border-radius: 3px
+ -webkit-box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2)
+ -moz-box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2)
+ box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2)
+ margin: 0 auto
+
+h1.text-muted, h2.text-muted, h3.text-muted
+ margin-top: 10px
+
+/* ----- BOOTSTRAP HACK FOR HEADER NAV BAR ----- */
+
+.navbar.navbar-default.navbar-static-top
+ margin-bottom: 0
+
/* ----- BOOTSTRAP HACK FOR STICKY FOOTER ----- */
html,body, #wrapwrap
@@ -86,6 +145,26 @@ footer
/* ---- HACK FOR COVERING UP CK EDITOR BOGUS P INSERTION --- */
+.oe_structure.oe_empty:empty, [data-oe-type=html]:empty, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child
+ background-image: url('/website/static/src/img/drag_here.png')
+ background-repeat: no-repeat
+ background-position: center top
+ height: 200px !important
+
+.oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child
+ position: static
+
+.oe_structure.oe_empty:empty:before, [data-oe-type=html]:empty:before, .oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child:before, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child:before
+ content: 'Drag Building Blocks Here'
+ text-align: center
+ display: block
+ padding-top: 100px
+ padding-bottom: 50px
+ color: grey
+ font-size: 24px
+
+/* ---- HACK FOR COVERING UP CK EDITOR BOGUS P INSERTION --- */
+
.navbar .nav > li > p
margin-bottom: 0px
@@ -95,14 +174,57 @@ footer
// .nav > li a
// display: block
-.carousel .item
- color: white
+.carousel-inner .item
+ height: 100%
+
+.carousel
+ .carousel-caption
+ h1, h2, h3
+ margin-top: 10px
+ margin-bottom: 10px
+ .carousel-image
+ right: 10%
+ left: 50%
+ top: 5%
+ bottom: 5%
+ position: absolute
+ text-align: center
+ img
+ height: 100%
+ margin: 0 auto
+ .item.text_image
+ .carousel-caption
+ left: auto
+ right: auto
+ bottom: 10%
+ text-align: left
+ padding: 20px
+ background: rgba(0, 0, 0, 0.4)
+ .item.text_only
+ .carousel-image
+ display: none
+ .carousel-caption
+ left: 10%
+ right: 10%
+ top: 10%
+ text-align: center
+ .item.image_text
+ .carousel-caption
+ left: auto
+ text-align: left
+ right: 10%
+ bottom: 10%
+ padding: 20px
+ background: rgba(0, 0, 0, 0.4)
+ .carousel-image
+ right: 50%
+ left: 10%
/* ---- HOMEPAGE THEME CUSTOMIZATION ---- */
.dark
background: #eff8f8
- background: rgba(100, 200, 200, 0.1)
+ background: rgba(100, 200, 200, 0.14)
-webkit-box-shadow: 0px 5px 9px -7px rgba(0, 0, 255, 0.5) inset, 0px -3px 9px -7px rgba(0, 0, 255, 0.5) inset
-moz-box-shadow: 0px 5px 9px -7px rgba(0, 0, 255, 0.5) inset, 0px -3px 9px -7px rgba(0, 0, 255, 0.5) inset
box-shadow: 0px 5px 9px -7px rgba(0, 0, 255, 0.5) inset, 0px -3px 9px -7px rgba(0, 0, 255, 0.5) inset
@@ -110,8 +232,8 @@ footer
.nav-hierarchy
padding-left: 16px
-div#wrap .carousel
- top: -20px
+#themes-list .well
+ padding: 0 0 20px 0
/* -- Hack for removing double scrollbar from mobile preview -- */
div#mobile-preview.modal
diff --git a/addons/website/static/src/img/banner/aqua.jpg b/addons/website/static/src/img/banner/aqua.jpg
new file mode 100644
index 00000000000..47ce77005d4
Binary files /dev/null and b/addons/website/static/src/img/banner/aqua.jpg differ
diff --git a/addons/website/static/src/img/banner/baby_blue.jpg b/addons/website/static/src/img/banner/baby_blue.jpg
new file mode 100644
index 00000000000..38a3d85bc28
Binary files /dev/null and b/addons/website/static/src/img/banner/baby_blue.jpg differ
diff --git a/addons/website/static/src/img/banner/banner_picture.png b/addons/website/static/src/img/banner/banner_picture.png
new file mode 100644
index 00000000000..47836637498
Binary files /dev/null and b/addons/website/static/src/img/banner/banner_picture.png differ
diff --git a/addons/website/static/src/img/banner/black.jpg b/addons/website/static/src/img/banner/black.jpg
new file mode 100644
index 00000000000..7aaee7a0fb4
Binary files /dev/null and b/addons/website/static/src/img/banner/black.jpg differ
diff --git a/addons/website/static/src/img/banner/business_guy.jpg b/addons/website/static/src/img/banner/business_guy.jpg
new file mode 100644
index 00000000000..691729beb7e
Binary files /dev/null and b/addons/website/static/src/img/banner/business_guy.jpg differ
diff --git a/addons/website/static/src/img/banner/color_splash.jpg b/addons/website/static/src/img/banner/color_splash.jpg
new file mode 100644
index 00000000000..e17ae39e70f
Binary files /dev/null and b/addons/website/static/src/img/banner/color_splash.jpg differ
diff --git a/addons/website/static/src/img/banner/flower.jpg b/addons/website/static/src/img/banner/flower.jpg
new file mode 100644
index 00000000000..7208e4c99d9
Binary files /dev/null and b/addons/website/static/src/img/banner/flower.jpg differ
diff --git a/addons/website/static/src/img/banner/flower_field.jpg b/addons/website/static/src/img/banner/flower_field.jpg
new file mode 100644
index 00000000000..eec572fbb89
Binary files /dev/null and b/addons/website/static/src/img/banner/flower_field.jpg differ
diff --git a/addons/website/static/src/img/greenfields.jpg b/addons/website/static/src/img/banner/greenfields.jpg
similarity index 100%
rename from addons/website/static/src/img/greenfields.jpg
rename to addons/website/static/src/img/banner/greenfields.jpg
diff --git a/addons/website/static/src/img/banner/landscape.jpg b/addons/website/static/src/img/banner/landscape.jpg
new file mode 100644
index 00000000000..35dfa6206c4
Binary files /dev/null and b/addons/website/static/src/img/banner/landscape.jpg differ
diff --git a/addons/website/static/src/img/landscape.png b/addons/website/static/src/img/banner/landscape.png
similarity index 100%
rename from addons/website/static/src/img/landscape.png
rename to addons/website/static/src/img/banner/landscape.png
diff --git a/addons/website/static/src/img/banner/mango.jpg b/addons/website/static/src/img/banner/mango.jpg
new file mode 100644
index 00000000000..9f88e2fb987
Binary files /dev/null and b/addons/website/static/src/img/banner/mango.jpg differ
diff --git a/addons/website/static/src/img/banner/mountains.jpg b/addons/website/static/src/img/banner/mountains.jpg
new file mode 100644
index 00000000000..47e53c82c8c
Binary files /dev/null and b/addons/website/static/src/img/banner/mountains.jpg differ
diff --git a/addons/website/static/src/img/banner/orange_red.jpg b/addons/website/static/src/img/banner/orange_red.jpg
new file mode 100644
index 00000000000..18838410c9f
Binary files /dev/null and b/addons/website/static/src/img/banner/orange_red.jpg differ
diff --git a/addons/website/static/src/img/banner/velour.jpg b/addons/website/static/src/img/banner/velour.jpg
new file mode 100644
index 00000000000..f3b0cf1d528
Binary files /dev/null and b/addons/website/static/src/img/banner/velour.jpg differ
diff --git a/addons/website/static/src/img/banner/wood.jpg b/addons/website/static/src/img/banner/wood.jpg
new file mode 100644
index 00000000000..738ff955918
Binary files /dev/null and b/addons/website/static/src/img/banner/wood.jpg differ
diff --git a/addons/website/static/src/img/banner/yellow_green.jpg b/addons/website/static/src/img/banner/yellow_green.jpg
new file mode 100644
index 00000000000..efd4dad9278
Binary files /dev/null and b/addons/website/static/src/img/banner/yellow_green.jpg differ
diff --git a/addons/website/static/src/img/big_picture.png b/addons/website/static/src/img/big_picture.png
new file mode 100644
index 00000000000..cecb39679d5
Binary files /dev/null and b/addons/website/static/src/img/big_picture.png differ
diff --git a/addons/website/static/src/img/drag_here.png b/addons/website/static/src/img/drag_here.png
new file mode 100644
index 00000000000..f2e3d38b2df
Binary files /dev/null and b/addons/website/static/src/img/drag_here.png differ
diff --git a/addons/website/static/src/img/image_text.jpg b/addons/website/static/src/img/image_text.jpg
new file mode 100644
index 00000000000..f34acfc771b
Binary files /dev/null and b/addons/website/static/src/img/image_text.jpg differ
diff --git a/addons/website/static/src/img/landscape.jpg b/addons/website/static/src/img/landscape.jpg
new file mode 100644
index 00000000000..8c4d19c947e
Binary files /dev/null and b/addons/website/static/src/img/landscape.jpg differ
diff --git a/addons/website/static/src/img/library/baby.jpg b/addons/website/static/src/img/library/baby.jpg
new file mode 100644
index 00000000000..2e1b0cb877a
Binary files /dev/null and b/addons/website/static/src/img/library/baby.jpg differ
diff --git a/addons/website/static/src/img/library/business_conference.jpg b/addons/website/static/src/img/library/business_conference.jpg
new file mode 100644
index 00000000000..407137d159a
Binary files /dev/null and b/addons/website/static/src/img/library/business_conference.jpg differ
diff --git a/addons/website/static/src/img/library/business_hands.jpg b/addons/website/static/src/img/library/business_hands.jpg
new file mode 100644
index 00000000000..cb012519301
Binary files /dev/null and b/addons/website/static/src/img/library/business_hands.jpg differ
diff --git a/addons/website/static/src/img/library/business_stats.jpg b/addons/website/static/src/img/library/business_stats.jpg
new file mode 100644
index 00000000000..1123100c675
Binary files /dev/null and b/addons/website/static/src/img/library/business_stats.jpg differ
diff --git a/addons/website/static/src/img/library/engineer.jpg b/addons/website/static/src/img/library/engineer.jpg
new file mode 100644
index 00000000000..bd0fa56c38f
Binary files /dev/null and b/addons/website/static/src/img/library/engineer.jpg differ
diff --git a/addons/website/static/src/img/library/flight.jpg b/addons/website/static/src/img/library/flight.jpg
new file mode 100644
index 00000000000..0071979a015
Binary files /dev/null and b/addons/website/static/src/img/library/flight.jpg differ
diff --git a/addons/website/static/src/img/library/gears.jpg b/addons/website/static/src/img/library/gears.jpg
new file mode 100644
index 00000000000..868c2532c41
Binary files /dev/null and b/addons/website/static/src/img/library/gears.jpg differ
diff --git a/addons/website/static/src/img/library/helpdesk.jpg b/addons/website/static/src/img/library/helpdesk.jpg
new file mode 100644
index 00000000000..9591abe164e
Binary files /dev/null and b/addons/website/static/src/img/library/helpdesk.jpg differ
diff --git a/addons/website/static/src/img/library/landscape_tree.jpg b/addons/website/static/src/img/library/landscape_tree.jpg
new file mode 100644
index 00000000000..fd5c9446c7b
Binary files /dev/null and b/addons/website/static/src/img/library/landscape_tree.jpg differ
diff --git a/addons/website/static/src/img/library/lazagne.jpg b/addons/website/static/src/img/library/lazagne.jpg
new file mode 100644
index 00000000000..21f10a01ca7
Binary files /dev/null and b/addons/website/static/src/img/library/lazagne.jpg differ
diff --git a/addons/website/static/src/img/library/manufacturing.jpg b/addons/website/static/src/img/library/manufacturing.jpg
new file mode 100644
index 00000000000..dc7266e46a8
Binary files /dev/null and b/addons/website/static/src/img/library/manufacturing.jpg differ
diff --git a/addons/website/static/src/img/library/personal_laptop.jpg b/addons/website/static/src/img/library/personal_laptop.jpg
new file mode 100644
index 00000000000..069487766dd
Binary files /dev/null and b/addons/website/static/src/img/library/personal_laptop.jpg differ
diff --git a/addons/website/static/src/img/library/school_kids.jpg b/addons/website/static/src/img/library/school_kids.jpg
new file mode 100644
index 00000000000..107b56bba97
Binary files /dev/null and b/addons/website/static/src/img/library/school_kids.jpg differ
diff --git a/addons/website/static/src/img/library/ship_sea.jpg b/addons/website/static/src/img/library/ship_sea.jpg
new file mode 100644
index 00000000000..cd0057dbdd6
Binary files /dev/null and b/addons/website/static/src/img/library/ship_sea.jpg differ
diff --git a/addons/website/static/src/img/library/vegetables.jpg b/addons/website/static/src/img/library/vegetables.jpg
new file mode 100644
index 00000000000..61a2518bbc4
Binary files /dev/null and b/addons/website/static/src/img/library/vegetables.jpg differ
diff --git a/addons/website/static/src/img/library/world.jpg b/addons/website/static/src/img/library/world.jpg
new file mode 100644
index 00000000000..b7b36d65360
Binary files /dev/null and b/addons/website/static/src/img/library/world.jpg differ
diff --git a/addons/website/static/src/img/openerp_logo.png b/addons/website/static/src/img/openerp_logo.png
new file mode 100644
index 00000000000..285a059cb06
Binary files /dev/null and b/addons/website/static/src/img/openerp_logo.png differ
diff --git a/addons/website/static/src/img/text_image.png b/addons/website/static/src/img/text_image.png
new file mode 100644
index 00000000000..ac02ef230c7
Binary files /dev/null and b/addons/website/static/src/img/text_image.png differ
diff --git a/addons/website/static/src/js/website.ace.js b/addons/website/static/src/js/website.ace.js
index fd26c50aefd..206813f237b 100644
--- a/addons/website/static/src/js/website.ace.js
+++ b/addons/website/static/src/js/website.ace.js
@@ -3,20 +3,33 @@
var globalEditor;
+ var hash = "#advanced-view-editor";
+
var website = openerp.website;
website.templates.push('/website/static/src/xml/website.ace.xml');
+ website.ready().then(function () {
+ if (window.location.hash.indexOf(hash) >= 0) {
+ launch();
+ }
+ });
+
+ function launch () {
+ if (globalEditor) {
+ globalEditor.open();
+ } else {
+ globalEditor = new website.ace.ViewEditor(this);
+ globalEditor.appendTo($(document.body));
+ }
+ }
+
website.EditorBar.include({
events: _.extend({}, website.EditorBar.prototype.events, {
'click a[data-action=ace]': 'launchAce',
}),
- launchAce: function () {
- if (globalEditor) {
- globalEditor.open();
- } else {
- globalEditor = new website.ace.ViewEditor(this);
- globalEditor.appendTo($(document.body));
- }
+ launchAce: function (e) {
+ e.preventDefault();
+ launch();
},
});
@@ -55,88 +68,143 @@
website.ace.ViewEditor = openerp.Widget.extend({
template: 'website.ace_view_editor',
events: {
- 'change #ace-view-list': 'displayView',
- 'click button[data-action=save]': 'saveView',
+ 'change #ace-view-list': 'displaySelectedView',
+ 'click button[data-action=save]': 'saveViews',
'click button[data-action=format]': 'formatXml',
'click button[data-action=close]': 'close',
},
+ init: function (parent) {
+ this.buffers = {};
+ this._super(parent);
+ },
start: function () {
var self = this;
+ self.aceEditor = ace.edit(self.$('#ace-view-editor')[0]);
+ self.aceEditor.setTheme("ace/theme/monokai");
var viewId = $(document.documentElement).data('view-xmlid');
openerp.jsonRpc('/website/customize_template_get', 'call', {
'xml_id': viewId,
'optional': false,
}).then(function (views) {
- self.loadViewList.call(self, views);
+ self.loadViews.call(self, views);
+ self.open.call(self);
+ });
+ },
+ loadViews: function (views) {
+ var self = this;
+ var activeViews = _.filter(views, function (view) {
+ return view.active;
+ });
+ var $viewList = self.$('#ace-view-list');
+ _.each(activeViews, function (view) {
+ if (view.id) {
+ new website.ace.ViewOption(self, view).appendTo($viewList);
+ self.loadView(view.id);
+ }
+ });
+ },
+ loadView: function (id) {
+ var viewId = parseInt(id, 10);
+ var self = this;
+ openerp.jsonRpc('/web/dataset/call', 'call', {
+ model: 'ir.ui.view',
+ method: 'read',
+ args: [[viewId], ['arch'], website.get_context()],
+ }).then(function(result) {
+ var editingSession = self.buffers[viewId] = new ace.EditSession(result[0].arch);;
+ editingSession.setMode("ace/mode/xml");
+ editingSession.setUndoManager(new ace.UndoManager());
+ editingSession.on("change", function () {
+ setTimeout(function () {
+ var $option = self.$('#ace-view-list').find('[value='+viewId+']');
+ var bufferName = $option.text();
+ var dirtyMarker = " (unsaved changes)";
+ var isDirty = editingSession.getUndoManager().hasUndo();
+ if (isDirty && bufferName.indexOf(dirtyMarker) < 0) {
+ $option.text(bufferName + dirtyMarker);
+ } else if (!isDirty && bufferName.indexOf(dirtyMarker) > 0) {
+ $option.text(bufferName.substring(0, bufferName.indexOf(dirtyMarker)));
+ }
+ }, 1);
+ });
+ if (viewId === self.selectedViewId()) {
+ self.displayView.call(self, viewId);
+ }
});
- this.$el.hover();
},
selectedViewId: function () {
return parseInt(this.$('#ace-view-list').val(), 10);
},
- loadViewList: function (views) {
- var activeViews = _.filter(views, function (view) {
- return view.active;
- });
- var $viewList = this.$('#ace-view-list');
- _.each(activeViews, function (view) {
- if (view.id) {
- new website.ace.ViewOption(this, view).appendTo($viewList);
- }
- });
- var editor = ace.edit(this.$('#ace-view-editor')[0]);
- editor.setTheme("ace/theme/monokai");
- this.aceEditor = editor;
- this.open();
+ displayView: function (id) {
+ var viewId = parseInt(id, 10);
+ var editingSession = this.buffers[viewId];
+ if (editingSession) {
+ this.aceEditor.setSession(editingSession);
+ }
},
- displayView: function () {
- var editor = this.aceEditor;
- openerp.jsonRpc('/web/dataset/call', 'call', {
- model: 'ir.ui.view',
- method: 'read',
- args: [[this.selectedViewId()], ['arch'], website.get_context()],
- }).then(function(result) {
- var xml = new website.ace.XmlDocument(result[0].arch);
- var editingSession = new ace.EditSession(xml.xml);
- editingSession.setMode("ace/mode/xml");
- editingSession.setUndoManager(new ace.UndoManager());
- editor.setSession(editingSession);
- });
+ displaySelectedView: function () {
+ this.displayView(this.selectedViewId());
+ this.updateHash();
},
formatXml: function () {
var xml = new website.ace.XmlDocument(this.aceEditor.getValue());
this.aceEditor.setValue(xml.format());
},
- saveView: function () {
+ saveViews: function () {
var self = this;
- var xml = new website.ace.XmlDocument(this.aceEditor.getValue());
+ var toSave = _.filter(_.map(self.buffers, function (editingSession, viewId) {
+ return {
+ id: parseInt(viewId, 10),
+ isDirty: editingSession.getUndoManager().hasUndo(),
+ text: editingSession.getValue(),
+ };
+ }), function (session) {
+ return session.isDirty;
+ });
+ var requests = _.map(toSave, self.saveView);
+ $.when.apply($, requests).then(function () {
+ self.reloadPage.call(self);
+ }).fail(function (source, error) {
+ var message = (error.data.arguments[0] === "Access Denied") ? "Access denied: please sign in" : error.message;
+ self.displayError.call(self, message);
+ });
+ },
+ saveView: function (session) {
+ var xml = new website.ace.XmlDocument(session.text);
if (xml.isWellFormed()) {
- openerp.jsonRpc('/web/dataset/call', 'call', {
+ return openerp.jsonRpc('/web/dataset/call', 'call', {
model: 'ir.ui.view',
method: 'write',
- args: [[this.selectedViewId()], { 'arch': xml.xml }, website.get_context()],
- }).then(function(result) {
- self.reloadPage();
- }).fail(function (error) {
- self.displayError(error);
+ args: [[session.id], { 'arch': xml.xml }, website.get_context()],
});
} else {
- self.displayError();
+ return $.Deferred().fail("Malformed XML document");
}
},
+ updateHash: function () {
+ window.location.hash = hash + "?view=" + this.selectedViewId();
+ },
reloadPage: function () {
- // TODO Reload { header + div#wrap + footer } only
+ this.updateHash();
window.location.reload();
},
displayError: function (error) {
// TODO Improve feedback (e.g. update 'Save' button + tooltip)
- alert("Malformed XML document");
+ alert(error);
},
open: function () {
this.$el.removeClass('oe_ace_closed').addClass('oe_ace_open');
- this.displayView();
+ var curentHash = window.location.hash;
+ var indexOfView = curentHash.indexOf("?view=");
+ if (indexOfView >= 0) {
+ var viewId = parseInt(curentHash.substring(indexOfView + 6, curentHash.length), 10);
+ this.$('#ace-view-list').val(viewId).change();
+ } else {
+ window.location.hash = hash;
+ }
},
close: function () {
+ window.location.hash = "";
var self = this;
this.$el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function () {
globalEditor = null;
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index 16443ac36c4..b2a93b9cfd6 100644
--- a/addons/website/static/src/js/website.editor.js
+++ b/addons/website/static/src/js/website.editor.js
@@ -236,10 +236,17 @@
this.rte = new website.RTE(this);
this.rte.on('change', this, this.proxy('rte_changed'));
+ var instanceReady = false;
+ this.rte.on('instanceReady', this, function () {
+ clearTimeout(instanceReady);
+ instanceReady = setTimeout(function () {
+ self.trigger('rte:ready');
+ }, 0);
+ });
return $.when(
this._super.apply(this, arguments),
- this.rte.prependTo(this.$('#website-top-edit .nav.pull-right'))
+ this.rte.appendTo(this.$('#website-top-edit .nav.pull-right'))
);
},
edit: function () {
@@ -667,23 +674,34 @@
},
'change input[type=file]': 'file_selection',
'change input.url': 'preview_image',
- 'click .existing-attachments a': 'select_existing',
+ 'click a[href=#existing]': 'browse_existing',
+ 'change select.image-style': 'preview_image',
}),
start: function () {
var selection = this.editor.getSelection();
var el = selection && selection.getSelectedElement();
this.element = null;
+
+ var $select = this.$('.image-style');
+ var $options = $select.children();
+ this.image_styles = $options.map(function () { return this.value; }).get();
+
if (el && el.is('img')) {
this.element = el;
+ _(this.image_styles).each(function (style) {
+ if (el.hasClass(style)) {
+ $select.val(style);
+ }
+ });
+ // set_image must follow setup of image style
this.set_image(el.getAttribute('src'));
}
- return $.when(
- this._super(),
- this.fetch_existing().then(this.proxy('fetched_existing')));
+ return this._super();
},
save: function () {
var url = this.$('input.url').val();
+ var style = this.$('.image-style').val();
var element, editor = this.editor;
if (!(element = this.element)) {
element = editor.document.createElement('img');
@@ -697,7 +715,10 @@
}, 0);
}
element.setAttribute('src', url);
- this._super();
+ $(element.$).removeClass(this.image_styles.join(' '));
+ if (style) { element.addClass(style); }
+
+ return this._super();
},
/**
@@ -735,17 +756,54 @@
var image = this.$('input.url').val();
if (!image) { return; }
- this.$('img.image-preview').attr('src', image);
+ this.$('img.image-preview')
+ .attr('src', image)
+ .removeClass(this.image_styles.join(' '))
+ .addClass(this.$('select.image-style').val());
+ },
+
+ browse_existing: function (e) {
+ e.preventDefault();
+ new website.editor.ExistingImageDialog(this).appendTo(document.body);
+ },
+ });
+
+ var IMAGES_PER_ROW = 6;
+ var IMAGES_ROWS = 4;
+ website.editor.ExistingImageDialog = website.editor.Dialog.extend({
+ template: 'website.editor.dialog.image.existing',
+ events: _.extend({}, website.editor.Dialog.prototype.events, {
+ 'click .existing-attachments img': 'select_existing',
+ 'click .pager > li': function (e) {
+ e.preventDefault();
+ var $target = $(e.currentTarget);
+ if ($target.hasClass('disabled')) {
+ return;
+ }
+ this.page += $target.hasClass('previous') ? -1 : 1;
+ this.display_attachments();
+ },
+ }),
+ init: function (parent) {
+ this.image = null;
+ this.page = 0;
+ this.parent = parent;
+ this._super(parent.editor);
+ },
+
+ start: function () {
+ return $.when(
+ this._super(),
+ this.fetch_existing().then(this.proxy('fetched_existing')));
},
fetch_existing: function () {
- // FIXME: lazy load attachments?
return openerp.jsonRpc('/web/dataset/call_kw', 'call', {
model: 'ir.attachment',
method: 'search_read',
args: [],
kwargs: {
- fields: ['name'],
+ fields: ['name', 'website_url'],
domain: [['res_model', '=', 'ir.ui.view']],
order: 'name',
context: website.get_context(),
@@ -753,17 +811,36 @@
});
},
fetched_existing: function (records) {
+ this.records = records;
+ this.display_attachments();
+ },
+ display_attachments: function () {
+ var per_screen = IMAGES_PER_ROW * IMAGES_ROWS;
+
+ var from = this.page * per_screen;
+ var records = this.records;
+
// Create rows of 3 records
var rows = _(records).chain()
- .groupBy(function (_, index) { return Math.floor(index / 3); })
+ .slice(from, from + per_screen)
+ .groupBy(function (_, index) { return Math.floor(index / IMAGES_PER_ROW); })
.values()
.value();
+
this.$('.existing-attachments').replaceWith(
- openerp.qweb.render('website.editor.dialog.image.existing', {rows: rows}));
+ openerp.qweb.render(
+ 'website.editor.dialog.image.existing.content', {rows: rows}));
+ this.$('.pager')
+ .find('li.previous').toggleClass('disabled', (from === 0)).end()
+ .find('li.next').toggleClass('disabled', (from + per_screen >= records.length));
+
},
select_existing: function (e) {
- e.preventDefault();
- this.set_image(e.currentTarget.getAttribute('href'));
+ var link = $(e.currentTarget).attr('src');
+ if (link) {
+ this.parent.set_image(link);
+ }
+ this.close()
},
});
diff --git a/addons/website/static/src/js/website.mobile.js b/addons/website/static/src/js/website.mobile.js
index 6487b2b457b..d4630d0a0c2 100644
--- a/addons/website/static/src/js/website.mobile.js
+++ b/addons/website/static/src/js/website.mobile.js
@@ -17,7 +17,7 @@
'hidden.bs.modal': 'destroy'
},
start: function () {
- document.getElementById("mobile-viewport").src = window.location.href + "?mobile-preview=true";
+ document.getElementById("mobile-viewport").src = window.location.origin + window.location.pathname + "#mobile-preview";
this.$el.modal();
},
});
diff --git a/addons/website/static/src/js/website.seo.js b/addons/website/static/src/js/website.seo.js
index 738bd46d413..1d9234165c4 100644
--- a/addons/website/static/src/js/website.seo.js
+++ b/addons/website/static/src/js/website.seo.js
@@ -6,30 +6,52 @@
website.EditorBar.include({
events: _.extend({}, website.EditorBar.prototype.events, {
- 'click a[data-action=promote-current-page]': 'promotePage',
+ 'click a[data-action=promote-current-page]': 'launchSeo',
}),
- promotePage: function () {
+ launchSeo: function () {
(new website.seo.Configurator()).appendTo($(document.body));
},
});
website.seo = {};
+ function analyzeKeyword(htmlPage, keyword) {
+ return htmlPage.isInTitle(keyword) ? {
+ title: 'keyword-in-title',
+ description: "This keyword is used in the page title",
+ } : htmlPage.isInDescription(keyword) ? {
+ title: 'keyword-in-description',
+ description: "This keyword is used in the page description",
+ } : htmlPage.isInBody(keyword) ? {
+ title: 'keyword-in-body',
+ description: "This keyword is used in the page content."
+ } : { title: "", description: "" };
+ }
+
website.seo.Suggestion = openerp.Widget.extend({
template: 'website.seo_suggestion',
events: {
'click .js_seo_suggestion': 'select',
},
- init: function (parent, keyword) {
- this.keyword = keyword;
- var keywordRegex = new RegExp(this.keyword, "gi");
- var pageText = $('body').children().not('.js_seo_configuration').text();
- var isKeywordInBody = keywordRegex.test(pageText);
- // cf. http://getbootstrap.com/components/#labels
- // default, primary, success, info, warning, danger
- this.type = isKeywordInBody ? 'info' : 'default';
+ init: function (parent, options) {
+ this.root = options.root;
+ this.keyword = options.keyword;
+ this.htmlPage = options.page;
this._super(parent);
},
+ start: function () {
+ this.htmlPage.on('title-changed', this, this.renderElement);
+ this.htmlPage.on('description-changed', this, this.renderElement);
+ },
+ analyze: function () {
+ return analyzeKeyword(this.htmlPage, this.keyword);
+ },
+ highlight: function () {
+ return this.analyze().title;
+ },
+ tooltip: function () {
+ return this.analyze().description;
+ },
select: function () {
this.trigger('selected', this.keyword);
},
@@ -37,8 +59,9 @@
website.seo.SuggestionList = openerp.Widget.extend({
template: 'website.seo_list',
- init: function (parent, word) {
- this.word = word;
+ init: function (parent, options) {
+ this.root = options.root;
+ this.htmlPage = options.page;
this._super(parent);
},
start: function () {
@@ -50,14 +73,18 @@
function addSuggestions (list) {
self.$el.empty();
// TODO Improve algorithm + Ajust based on custom user keywords
- var nameRegex = new RegExp(self.companyName, "gi");
- var cleanList = _.map(list, function removeCompanyName (word) {
- return word.replace(nameRegex, "").trim();
+ var regex = new RegExp(self.root, "gi");
+ var cleanList = _.map(list, function (word) {
+ return word.replace(regex, "").trim();
});
// TODO Order properly ?
_.each(_.uniq(cleanList), function (keyword) {
if (keyword) {
- var suggestion = new website.seo.Suggestion(self, keyword);
+ var suggestion = new website.seo.Suggestion(self, {
+ root: self.root,
+ keyword: keyword,
+ page: self.htmlPage,
+ });
suggestion.on('selected', self, function (word) {
self.trigger('selected', word);
});
@@ -65,7 +92,7 @@
}
});
}
- $.getJSON("http://seo.eu01.aws.af.cm/suggest/"+encodeURIComponent(this.word + " "), addSuggestions);
+ $.getJSON("http://seo.eu01.aws.af.cm/suggest/"+encodeURIComponent(this.root + " "), addSuggestions);
},
});
@@ -75,21 +102,37 @@
'click a[data-action=remove-keyword]': 'destroy',
},
maxWordsPerKeyword: 4, // TODO Check
- init: function (parent, keyword) {
- this.keyword = keyword;
- // cf. http://getbootstrap.com/components/#labels
- // default, primary, success, info, warning, danger
- this.type = 'warning';
+ init: function (parent, options) {
+ this.keyword = options.word;
+ this.htmlPage = options.page;
this._super(parent);
},
start: function () {
- var self = this;
- self.suggestionList = new website.seo.SuggestionList(self, this.keyword);
- self.suggestionList.on('selected', self, function (word) {
- self.trigger('selected', word);
+ this.htmlPage.on('title-changed', this, this.updateLabel);
+ this.htmlPage.on('description-changed', this, this.updateLabel);
+ this.suggestionList = new website.seo.SuggestionList(this, {
+ root: this.keyword,
+ page: this.htmlPage,
+ });
+ this.suggestionList.on('selected', this, function (word) {
+ this.trigger('selected', word);
});
this.suggestionList.appendTo(this.$('.js_seo_keyword_suggestion'));
},
+ analyze: function () {
+ return analyzeKeyword(this.htmlPage, this.keyword);
+ },
+ highlight: function () {
+ return this.analyze().title;
+ },
+ tooltip: function () {
+ return this.analyze().description;
+ },
+ updateLabel: function () {
+ var cssClass = "oe_seo_keyword js_seo_keyword " + this.highlight();
+ this.$(".js_seo_keyword").attr('class', cssClass);
+ this.$(".js_seo_keyword").attr('title', this.tooltip());
+ },
destroy: function () {
this.trigger('removed');
this._super();
@@ -99,28 +142,44 @@
website.seo.KeywordList = openerp.Widget.extend({
template: 'website.seo_list',
maxKeywords: 10,
- init: function (parent) {
+ init: function (parent, options) {
+ this.htmlPage = options.page;
this._super(parent);
},
+ start: function () {
+ var self = this;
+ var existingKeywords = self.htmlPage.keywords();
+ if (existingKeywords.length > 0) {
+ _.each(existingKeywords, function (word) {
+ self.add.call(self, word);
+ });
+ } else {
+ var companyName = self.htmlPage.company().toLowerCase();
+ self.add(companyName);
+ }
+ },
keywords: function () {
var result = [];
- this.$('span.js_seo_keyword').each(function () {
+ this.$('.js_seo_keyword').each(function () {
result.push($(this).data('keyword'));
});
return result;
},
- isKeywordListFull: function () {
+ isFull: function () {
return this.keywords().length >= this.maxKeywords;
},
- isExistingKeyword: function (word) {
+ exists: function (word) {
return _.contains(this.keywords(), word);
},
add: function (candidate) {
var self = this;
// TODO Refine
- var word = candidate ? candidate.replace(/[,;.:<>]+/g, " ").replace(/ +/g, " ").trim() : "";
- if (word && !self.isKeywordListFull() && !self.isExistingKeyword(word)) {
- var keyword = new website.seo.Keyword(self, word);
+ var word = candidate ? candidate.replace(/[,;.:<>]+/g, " ").replace(/ +/g, " ").trim().toLowerCase() : "";
+ if (word && !self.isFull() && !self.exists(word)) {
+ var keyword = new website.seo.Keyword(self, {
+ word: word,
+ page: this.htmlPage,
+ });
keyword.on('removed', self, function () {
self.trigger('list-not-full');
self.trigger('removed', word);
@@ -130,7 +189,7 @@
});
keyword.appendTo(self.$el);
}
- if (self.isKeywordListFull()) {
+ if (self.isFull()) {
self.trigger('list-full');
}
},
@@ -147,9 +206,13 @@
website.seo.ImageList = openerp.Widget.extend({
+ init: function (parent, options) {
+ this.htmlPage = options.page;
+ this._super(parent);
+ },
start: function () {
var self = this;
- new website.seo.HtmlPage().images().each(function (index, image) {
+ this.htmlPage.images().each(function (index, image) {
new website.seo.Image(self, image).appendTo(self.$el);
});
},
@@ -169,29 +232,33 @@
},
});
- website.seo.HtmlPage = openerp.Class.extend({
+ website.seo.HtmlPage = openerp.Class.extend(openerp.PropertiesMixin, {
url: function () {
var url = window.location.href;
var hashIndex = url.indexOf('#');
return hashIndex >= 0 ? url.substring(0, hashIndex) : url;
},
title: function () {
- return $('title').text();
+ return $('title').text().trim();
},
changeTitle: function (title) {
$('title').text(title);
+ this.trigger('title-changed', title);
},
description: function () {
- return $('meta[name=description]').attr('value');
+ return $('meta[name=description]').attr('value').trim();
},
changeDescription: function (description) {
- return $('meta[name=description]').attr('value', description);
+ $('meta[name=description]').attr('value', description);
+ this.trigger('description-changed', description);
},
keywords: function () {
- return $('meta[name=keywords]').attr('value').split(",");
+ var parsed = $('meta[name=keywords]').attr('value').split(",");
+ return parsed[0] ? parsed: [];
},
changeKeywords: function (keywords) {
- return $('meta[name=keywords]').attr('value', keyword.join(","));
+ $('meta[name=keywords]').attr('value', keywords.join(","));
+ this.trigger('keywords-changed', keywords);
},
headers: function (tag) {
return $('#wrap '+tag).map(function () {
@@ -210,6 +277,18 @@
company: function () {
return $('meta[name="openerp.company"]').attr('value');
},
+ bodyText: function () {
+ return $('body').children().not('.js_seo_configuration').text();
+ },
+ isInBody: function (text) {
+ return new RegExp(text, "gi").test(this.bodyText());
+ },
+ isInTitle: function (text) {
+ return new RegExp(text, "gi").test(this.title());
+ },
+ isInDescription: function (text) {
+ return new RegExp(text, "gi").test(this.description());
+ },
});
website.seo.Tip = openerp.Widget.extend({
@@ -245,10 +324,14 @@
$modal.find('.js_seo_page_url').text(htmlPage.url());
$modal.find('input[name=seo_page_title]').val(htmlPage.title());
$modal.find('textarea[name=seo_page_description]').val(htmlPage.description());
- self.suggestImprovements(htmlPage);
- self.imageList = new website.seo.ImageList(self);
- self.imageList.appendTo($modal.find('.js_seo_image_list'));
- self.keywordList = new website.seo.KeywordList(self);
+ self.suggestImprovements();
+ self.imageList = new website.seo.ImageList(self, { page: htmlPage });
+ if (htmlPage.images().length === 0) {
+ $modal.find('.js_image_section').remove()
+ } else {
+ self.imageList.appendTo($modal.find('.js_seo_image_list'));
+ }
+ self.keywordList = new website.seo.KeywordList(self, { page: htmlPage });
self.keywordList.on('list-full', self, function () {
$modal.find('input[name=seo_page_keywords]')
.attr('readonly', "readonly")
@@ -266,11 +349,9 @@
self.keywordList.add(word);
});
self.keywordList.appendTo($modal.find('.js_seo_keywords_list'));
- var companyName = htmlPage.company().toLowerCase();
- self.addKeyword(companyName);
$modal.modal();
},
- suggestImprovements: function (parser) {
+ suggestImprovements: function () {
var tips = [];
var self = this;
function displayTip(message, type) {
@@ -279,17 +360,17 @@
type: type,
}).appendTo(self.$('.js_seo_tips'));
}
- var htmlPage = parser || new website.seo.HtmlPage();
+ var htmlPage = this.htmlPage;
if (htmlPage.headers('h1').length === 0) {
tips.push({
type: 'warning',
- message: "You don't have an <h1> tag on your page.",
+ message: "This page seems to be missing an <h1> tag.",
});
}
if (htmlPage.headers('h1').length > 1) {
tips.push({
type: 'warning',
- message: "You have more than one <h1> tag on your page.",
+ message: "The page contains more than one <h1> tag.",
});
}
if (tips.length > 0) {
@@ -297,7 +378,7 @@
displayTip(tip.message, tip.type);
});
} else {
- displayTip("Your page makup is appropriate for search engines.", 'success');
+ displayTip("The markup on this page is appropriate for search engines.", 'success');
}
},
confirmKeyword: function (e) {
@@ -327,7 +408,7 @@
setTimeout(function () {
var title = self.$('input[name=seo_page_title]').val();
self.htmlPage.changeTitle(title);
- }, 1);
+ }, 0);
},
descriptionChanged: function () {
var self = this;
@@ -336,5 +417,9 @@
self.htmlPage.changeDescription(description);
}, 1);
},
+ destroy: function () {
+ this.htmlPage.changeKeywords(this.keywordList.keywords());
+ this._super();
+ },
});
})();
diff --git a/addons/website/static/src/js/website.snippets.js b/addons/website/static/src/js/website.snippets.js
index 36e72fcff60..3457fbb66e2 100644
--- a/addons/website/static/src/js/website.snippets.js
+++ b/addons/website/static/src/js/website.snippets.js
@@ -5,54 +5,70 @@
website.templates.push('/website/static/src/xml/website.snippets.xml');
website.EditorBar.include({
- events: _.extend({}, website.EditorBar.prototype.events, {
- 'click button[data-action=snippet]': 'snippet',
- }),
start: function () {
- return this._super().then(function () {
-
- this.$buttons.snippet = this.$('button[data-action=snippet]');
-
- }.bind(this));
+ var self = this;
+ $("[data-oe-model]").on('click', function (event) {
+ var tag = event.srcElement.tagName.toLowerCase();
+ var $this = $(event.srcElement);
+ if (!(tag === 'a' || tag === "button") && !$this.parents("a, button").length) {
+ self.$('[data-action="edit"]').parent().effect('bounce', {distance: 18, times: 5}, 250);
+ }
+ });
+ return this._super();
},
edit: function () {
- window.snippets = this.snippets = new website.snippet.BuildingBlock(this);
- this.snippets.appendTo($(document.body));
+ $("body").off('click');
+ var self = this;
+ self.on('rte:ready', this, function () {
+
+ window.snippets = self.snippets = new website.snippet.BuildingBlock(this);
+ self.snippets.appendTo(self.$el);
+
+ });
return this._super.apply(this, arguments);
},
- snippet: function (ev) {
- this.snippets.toggle();
- },
save: function () {
- $('body').trigger("save");
+ remove_added_snippet_id();
this._super();
},
});
+
+ $(document).ready(function () {
+ hack_to_add_snippet_id();
+ $("[data-snippet-id]").each(function() {
+ var $snipped_id = $(this);
+ if (typeof $snipped_id.data("snippet-view") === 'undefined' &&
+ website.snippet.animationRegistry[$snipped_id.data("snippet-id")]) {
+ $snipped_id.data("snippet-view", new website.snippet.animationRegistry[$snipped_id.data("snippet-id")]($snipped_id));
+ }
+ });
+ });
+
/* ----- SNIPPET SELECTOR ---- */
website.snippet = {};
+
// puts $el at the same absolute position as $target
- website.snippet.cover_target = function ($el, $target){
- $el.css({
- 'position': 'absolute',
- 'width': $target.outerWidth(),
- 'height': $target.outerHeight(),
- });
- $el.css($target.offset());
- };
function hack_to_add_snippet_id () {
_.each(website.snippet.selector, function (val) {
$(val[0]).each(function() {
- if ($(this).is("[data-snippet-id='"+ val[1]+"']"))
- $(this).removeAttr("data-snippet-id");
- if (!$(this).is("[data-snippet-id]") && $(this).parents("[data-oe-model]").length)
+ if (!$(this).is("[data-snippet-id]") && $(this).parents("[data-oe-model]").length) {
$(this).attr("data-snippet-id", val[1]);
+ }
+ });
+ });
+ }
+ function remove_added_snippet_id () {
+ _.each(website.snippet.selector, function (val) {
+ $(val[0]).each(function() {
+ if ($(this).data("snippet-id") === val[1]) {
+ $(this).removeAttr("data-snippet-id");
+ }
});
});
}
-
website.snippet.selector = [];
website.snippet.BuildingBlock = openerp.Widget.extend({
@@ -65,49 +81,134 @@
$("
").appendTo('body');
}
this.$active_snipped_id = false;
- this.active = false;
- this.parent_of_editable_box = "body > :not(:has(#website-top-view)):not(#oe_manipulators):not(#oe_snippets) ";
hack_to_add_snippet_id();
+ $("body").on('DOMNodeInserted', hack_to_add_snippet_id);
+ },
+ dom_filter: function (dom) {
+ if (typeof dom === "string") {
+ var include = "[data-oe-model]";
+ var sdom = dom.split(',');
+ dom = "";
+ _.each(sdom, function (val) {
+ val = val.replace(/^\s+|\s+$/g, '');
+ dom += "body " + include + " " + val + ", ";
+ val = val.split(" ");
+ dom += "body "+ val.shift() + include + val.join(" ") + ", ";
+ });
+ dom = dom.replace(/,\s*$/g, '');
+ return $(dom);
+ } else {
+ return $(dom).is("[data-oe-model]") || $(dom).parents("[data-oe-model]").length ? $(dom) : $("");
+ }
},
start: function() {
var self = this;
- var snippets_template = [];
- _.each(openerp.qweb.compiled_templates, function (val, key) {
- if (key.indexOf('website.snippets.') === 0) {
- var $snippet = $(openerp.qweb.render(key)).addClass("oe_snippet");
- if ($snippet.data("action")) {
- self.$el.find('#snippet_' + $snippet.data('category')).append($snippet);
- self.make_snippet_draggable($snippet);
- }
- }
- });
+ var $ul = this.parent.$("#website-top-edit ul");
+
+ var $button = $(openerp.qweb.render('website.snippets_button'))
+ .click(function () {self.$el.toggleClass("hidden");})
+ .prependTo($ul);
+
+ this.fetch_snippet_templates();
this.bind_selected_manipulator();
this.bind_snippet_click_editor();
+ this.activate_overlay_zones();
+
+ this.scrollspy();
+ this.$el.addClass("hidden");
+
+ this.$modal = $(openerp.qweb.render('website.snippets_modal'));
+ this.$modal.appendTo("body");
+ },
+ fetch_snippet_templates: function () {
+ var self = this;
+ this.style_templates = {};
+
+ _.each(openerp.qweb.compiled_templates, function (val, key) {
+ if (key.indexOf('website.snippets.') === 0) {
+ var $snippet = $(openerp.qweb.render(key)).addClass("oe_snippet");
+ var snipped_id = $snippet.data("snippet-id");
+ if (snipped_id) {
+
+ if ($snippet.data('category') === 'style') {
+ self.style_templates[snipped_id] = {
+ 'snipped-id' : snipped_id,
+ 'selector': $snippet.data('selector'),
+ 'class': $snippet.find(".oe_snippet_class").text(),
+ 'label': $snippet.find(".oe_snippet_label").text(),
+ '$el': $snippet
+ };
+ }
+ if ($snippet.find(".oe_snippet_thumbnail").length) {
+ self.$el.find('#snippet_' + $snippet.data('category')).append($snippet);
+ self.make_snippet_draggable($snippet);
+ }
+ }
+ }
+ });
+ },
+ scrollspy: function (){
+ var self = this;
+ var $ul = this.$("ul");
+ var $pill = self.$(".pill-content");
+ var padding = parseInt($pill.css("padding-left"));
+ var $scroll = this.$(".scroll");
+
+ $scroll.scroll(function () {
+ $pill.find("> div").each(function () {
+ if ($(this).position().left <= padding) {
+ $ul.find("> li").removeClass('active');
+ $ul.find("a[href='#" + $(this).attr("id") + "']").parent("li").addClass('active');
+ }
+ });
+ });
+
+ $ul.find("a").click(function (event) {
+ event.preventDefault();
+ $scroll.scrollLeft( $scroll.scrollLeft() + $($(event.currentTarget).attr("href")).position().left - padding );
+ return false;
+ });
+
+ $pill.css("padding-right", self.$el.outerWidth() - padding + 10 - $pill.find("> div:last").outerWidth());
+ $ul.find("> li:first").addClass('active');
+ },
+ cover_target: function ($el, $target){
+ var pos = $target.offset();
+ var mt = parseInt($target.css("margin-top") || 0);
+ var mb = parseInt($target.css("margin-bottom") || 0);
+ $el.css({
+ 'position': 'absolute',
+ 'width': $target.outerWidth(),
+ 'height': $target.outerHeight() + mt + mb,
+ 'top': pos.top - mt,
+ 'left': pos.left
+ });
+ },
+ show: function () {
+ this.$el.removeClass("hidden");
+ },
+ hide: function () {
+ this.$el.addClass("hidden");
},
bind_snippet_click_editor: function () {
var self = this;
var snipped_event_flag = false;
$("body").on('click', "[data-snippet-id]", function (event) {
- if (!self.active || snipped_event_flag) {
+ if (snipped_event_flag) {
return;
}
- var $target = $(event.currentTarget);
- if (self.$active_snipped_id) {
- if (self.$active_snipped_id[0] === $target[0] || $.contains(self.$active_snipped_id, $target[0])) {
- var $parent = self.$active_snipped_id.parents("[data-snippet-id]:first");
- if ($parent.length) {
- $target = $parent;
- }
- }
- }
snipped_event_flag = true;
setTimeout(function () {snipped_event_flag = false;}, 0);
+ var $target = $(event.currentTarget);
+ if (self.$active_snipped_id && self.$active_snipped_id.is($target)) {
+ return;
+ }
self.make_active($target);
});
- $("body > :not(:has(#website-top-view)):not(#oe_manipulators)").on('click', function (ev) {
+ $("[data-oe-model]").on('click', function (ev) {
if (!snipped_event_flag && self.$active_snipped_id && !self.$active_snipped_id.parents("[data-snippet-id]:first")) {
self.make_active(false);
}
@@ -151,10 +252,10 @@
create_overlay: function ($snipped_id) {
if (typeof $snipped_id.data("snippet-editor") === 'undefined') {
this.activate_overlay_zones($snipped_id);
- var editor = website.snippet.editorRegistry[$snipped_id.data("snippet-id")] || website.snippet.Editor;
+ var editor = website.snippet.editorRegistry[$snipped_id.data("snippet-id")] || website.snippet.editorRegistry.resize;
$snipped_id.data("snippet-editor", new editor(this, $snipped_id));
}
- website.snippet.cover_target($snipped_id.data('overlay'), $snipped_id);
+ this.cover_target($snipped_id.data('overlay'), $snipped_id);
},
path_eval: function(path){
@@ -170,21 +271,19 @@
var self = this;
var $selected_target = null;
$("body").mouseover(function (event){
- if (!self.active) {
- return;
- }
var $target = $(event.srcElement).parents("[data-snippet-id]:first");
+ $target = self.dom_filter($target);
if($target.length && !self.editor_busy) {
if($selected_target != $target){
- if($selected_target){
- $selected_target.data('overlay').removeClass('oe_selected');
+ if($selected_target && $selected_target.data('overlay')){
+ $selected_target.data('overlay').removeClass('oe_hover');
}
$selected_target = $target;
self.create_overlay($target);
- $target.data('overlay').addClass('oe_selected');
+ $target.data('overlay').addClass('oe_hover');
}
- } else if($selected_target) {
- $selected_target.data('overlay').removeClass('oe_selected');
+ } else if($selected_target && $selected_target.data('overlay')) {
+ $selected_target.data('overlay').removeClass('oe_hover');
}
});
},
@@ -192,22 +291,47 @@
// activate drag and drop for the snippets in the snippet toolbar
make_snippet_draggable: function($snippet){
var self = this;
+ var $toInsert = false;
+ var $tumb = $snippet.find(".oe_snippet_thumbnail");
+ var dropped = false;
$snippet.draggable({
+ greedy: true,
helper: 'clone',
zIndex: '1000',
appendTo: 'body',
cursor: "move",
+ handle: ".oe_snippet_thumbnail",
+ cursorAt: {
+ 'left': $tumb.outerWidth()/2,
+ 'top': $tumb.outerHeight()/2
+ },
start: function(){
- var action = $snippet.data('action');
+ self.hide();
+ dropped = false;
+ var snipped_id = $snippet.data('snippet-id');
+ var action = $snippet.find('.oe_snippet_body').size() ? 'insert' : 'mutate';
if( action === 'insert'){
+ if (!$snippet.data('selector-siblings') && !$snippet.data('selector-children') && !$snippet.data('selector-vertical-children')) {
+ console.debug($snippet.data("snippet-id") + " have oe_snippet_body class and have not for insert action"+
+ "data-selector-siblings, data-selector-children or data-selector-vertical-children tag for mutate action");
+ return;
+ }
self.activate_insertion_zones({
siblings: $snippet.data('selector-siblings'),
- childs: $snippet.data('selector-childs'),
- vertical_childs: $snippet.data('selector-vertical-childs')
+ children: $snippet.data('selector-children'),
+ vertical_children: $snippet.data('selector-vertical-children')
});
- } else if( action === 'mutate' ){
+ $toInsert = $snippet.find('.oe_snippet_body').clone();
+ $toInsert.removeClass('oe_snippet_body');
+ $toInsert.attr('data-snippet-id', snipped_id);
+
+ } else if( action === 'mutate' ){
+ if (!$snippet.data('selector')) {
+ console.debug($snippet.data("snippet-id") + " have not oe_snippet_body class and have not data-selector tag");
+ return;
+ }
var $targets = self.activate_overlay_zones($snippet.data('selector'));
$targets.each(function(){
var $clone = $(this).data('overlay').clone();
@@ -219,49 +343,52 @@
$('.oe_drop_zone').droppable({
over: function(){
- // FIXME: stupid hack to prevent multiple droppable to activate at once ...
- // it's not even working properly but it's better than nothing.
- $(".oe_drop_zone.oe_hover").removeClass("oe_hover");
- $(this).addClass("oe_hover");
+ if( action === 'insert'){
+ dropped = true;
+ $(this).first().after($toInsert);
+ }
},
out: function(){
- $(this).removeClass("oe_hover");
+ if( action === 'insert'){
+ dropped = false;
+ $toInsert.detach();
+ }
},
drop: function(){
- var snipped_id = $snippet.data('snippet-id');
-
- if (!$(".oe_drop_zone.oe_hover").length) {
- return false;
- }
+ dropped = true;
var $target = false;
- if($snippet.find('.oe_snippet_body').size()){
- var $toInsert = $snippet.find('.oe_snippet_body').clone();
- $toInsert.removeClass('oe_snippet_body');
- $toInsert.attr('data-snippet-id', snipped_id);
- $(".oe_drop_zone.oe_hover").first().after($toInsert);
+ if(action === 'insert'){
$target = $toInsert;
- hack_to_add_snippet_id();
- } else {
- $target = $(".oe_drop_zone.oe_hover").first().data('target');
- }
-
- $('.oe_drop_zone').droppable('destroy').remove();
- if (website.snippet.animationRegistry[snipped_id]) {
- new website.snippet.animationRegistry[snipped_id]($target);
- }
- if (website.snippet.editorRegistry[snipped_id]) {
+ if (website.snippet.animationRegistry[snipped_id]) {
+ new website.snippet.animationRegistry[snipped_id]($target);
+ }
+
self.create_overlay($target);
$target.data("snippet-editor").build_snippet($target);
- setTimeout(function () {self.make_active($target);},0);
+
+ } else {
+ $target = $(this).data('target');
+
+ self.create_overlay($target);
+ if (website.snippet.editorRegistry[snipped_id]) {
+ var snippet = new website.snippet.editorRegistry[snipped_id](self, $target);
+ snippet.build_snippet($target);
+ }
}
+ $('.oe_drop_zone').remove();
+
+ setTimeout(function () {self.make_active($target);},0);
},
});
},
stop: function(){
$('.oe_drop_zone').droppable('destroy').remove();
+ if (!dropped) {
+ self.$modal.modal('toggle');
+ }
},
});
},
@@ -272,46 +399,22 @@
return $(this).data('snippet-id') === id;
}).first();
},
- // WIP
- make_draggable_instance: function($instance){
- var self = this;
- var $snippet = get_snippet_from_id($instance.data('snippet-id'));
-
- $instance.draggable({
- greedy: true,
- helper: 'clone',
- zIndex: '1000',
- appendTo: 'body',
- start: function(){
- var action = $snippet.data('action');
- if(action === 'insert'){
-
- self.activate_insertion_zones({
- siblings: $snippet.data('selector-siblings'),
- child: $snippet.data('selector-childs'),
- vertical_childs: $snippet.data('selector-vertical-childs')
- });
-
- }
- }
- });
- },
// Create element insertion drop zones. two css selectors can be provided
- // selector.childs -> will insert drop zones as direct child of the selected elements
+ // selector.children -> will insert drop zones as direct child of the selected elements
// in case the selected elements have children themselves, dropzones will be interleaved
// with them.
// selector.siblings -> will insert drop zones after and before selected elements
activate_insertion_zones: function(selector){
var self = this;
- var child_selector = selector.childs ? this.parent_of_editable_box + (selector.childs).split(",").join(this.parent_of_editable_box) : false;
- var sibling_selector = selector.siblings ? this.parent_of_editable_box + (selector.siblings).split(",").join(this.parent_of_editable_box) : false;
- var vertical_child_selector = selector.vertical_childs ? this.parent_of_editable_box + (selector.vertical_childs).split(",").join(this.parent_of_editable_box) : false;
+ var child_selector = selector.children;
+ var sibling_selector = selector.siblings;
+ var vertical_child_selector = selector.vertical_children;
var zone_template = "
";
if(child_selector){
- $(child_selector).each(function (){
+ self.dom_filter(child_selector).each(function (){
var $zone = $(this);
$zone.find('> *:not(.oe_drop_zone):visible').after(zone_template);
$zone.prepend(zone_template);
@@ -319,16 +422,38 @@
}
if(vertical_child_selector){
- $(vertical_child_selector).each(function (){
+ self.dom_filter(vertical_child_selector).each(function (){
var $zone = $(this);
- var $template = $(zone_template).addClass("oe_vertical").css('height', $zone.outerHeight()+'px');
- $zone.find('> *:not(.oe_drop_zone):visible').after($template);
- $zone.prepend($template.clone());
+ var $template = $(zone_template).addClass("oe_vertical");
+ var nb = 0;
+ var $lastinsert = false;
+ var left = 0;
+ var temp_left = 0;
+ $zone.find('> *:not(.oe_drop_zone):visible').each(function () {
+ var $col = $(this);
+ $template.css('height', ($col.outerHeight() + parseInt($col.css("margin-top")) + parseInt($col.css("margin-bottom")))+'px');
+ $lastinsert = $template.clone();
+ $(this).after($lastinsert);
+
+ temp_left = $col.position().left;
+ if (left === temp_left) {
+ $col.prev(".oe_drop_zone.oe_vertical").remove();
+ $col.before($template.clone().css("clear", "left"));
+ }
+ else if (!nb) {
+ $col.before($template.clone());
+ }
+ left = temp_left;
+ nb ++;
+ });
+ if (!nb) {
+ $zone.prepend($template.css('height', $zone.outerHeight()+'px'));
+ }
});
}
if(sibling_selector){
- $(sibling_selector).each(function (){
+ self.dom_filter(sibling_selector).each(function (){
var $zone = $(this);
if($zone.prev('.oe_drop_zone:visible').length === 0){
$zone.before(zone_template);
@@ -342,11 +467,11 @@
var count;
do {
count = 0;
- var $zones = $('.oe_drop_zone + .oe_drop_zone'); // no two consecutive zones
- count += $zones.length;
- $zones.remove();
+ // var $zones = $('.oe_drop_zone + .oe_drop_zone'); // no two consecutive zones
+ // count += $zones.length;
+ // $zones.remove();
- $zones = $('.oe_drop_zone > .oe_drop_zone').remove(); // no recusrive zones
+ $zones = $('.oe_drop_zone > .oe_drop_zone:not(.oe_vertical)').remove(); // no recusrive zones
count += $zones.length;
$zones.remove();
} while (count > 0);
@@ -377,11 +502,8 @@
// generate drop zones covering the elements selected by the selector
// we generate overlay drop zones only to get an idea of where the snippet are, the drop
activate_overlay_zones: function(selector){
- selector = selector || '[data-snippet-id]';
- if (typeof selector === 'string')
- selector = this.parent_of_editable_box + selector.split(",").join(this.parent_of_editable_box);
-
- var $targets = $(selector);
+ var $targets = this.dom_filter(selector || '[data-snippet-id]');
+ var self = this;
function is_visible($el){
return $el.css('display') != 'none'
@@ -407,23 +529,16 @@
$target.data('overlay',$zone);
$target.on("DOMNodeInserted DOMNodeRemoved DOMSubtreeModified", function () {
- website.snippet.cover_target($zone, $target);
+ self.cover_target($zone, $target);
+ });
+ $('body').on("resize", function () {
+ self.cover_target($zone, $target);
});
}
- website.snippet.cover_target($target.data('overlay'), $target);
+ self.cover_target($target.data('overlay'), $target);
});
return $targets;
- },
-
- toggle: function(){
- this.active = !this.active;
- if(this.active){
- this.$el.removeClass('hide');
- this.activate_overlay_zones();
- } else {
- this.$el.addClass('hide');
- }
- },
+ }
});
@@ -434,6 +549,13 @@
},
init: function (dom) {
this.$el = this.$target = $(dom);
+ this.start();
+ },
+ /*
+ * start
+ * This method is called after init
+ */
+ start: function () {
},
/* onFocusEdit
* if they are an editor for this snippet-id
@@ -456,17 +578,6 @@
},
});
- $(document).ready(function () {
- hack_to_add_snippet_id();
- $("[data-snippet-id]").each(function() {
- var $snipped_id = $(this);
- if (typeof $snipped_id.data("snippet-view") === 'undefined' &&
- website.snippet.animationRegistry[$snipped_id.data("snippet-id")]) {
- $snipped_id.data("snippet-view", new website.snippet.animationRegistry[$snipped_id.data("snippet-id")]($snipped_id));
- }
- });
- });
-
website.snippet.editorRegistry = {};
website.snippet.Editor = openerp.Class.extend({
@@ -474,7 +585,10 @@
this.parent = parent;
this.$target = $(dom);
this.$overlay = this.$target.data('overlay');
+ this.snippet_id = this.$target.data("snippet-id");
this._readXMLData();
+ this.load_style_options();
+ this.get_parent_block();
this.start();
},
@@ -496,15 +610,15 @@
* Insert into the view when the thumbnail is drag and droped into a drop zone
*/
_readXMLData: function() {
- if (this.template) {
- this.$el = $(openerp.qweb.render(this.template, {widget: this}).trim());
- this.$editor = this.$el.find(".oe_snippet_options");
- this.$thumbnail = this.$el.find(".oe_snippet_thumbnail");
- this.$body = this.$el.find(".oe_snippet_body");
+ this.$el = $(openerp.qweb.render("website.snippets." + this.snippet_id, {widget: this}).trim());
+ this.$editor = this.$el.find(".oe_snippet_options");
+ this.$thumbnail = this.$el.find(".oe_snippet_thumbnail");
+ this.$body = this.$el.find(".oe_snippet_body");
- var $options = this.$overlay.find(".oe_overlay_options");
- this.$editor.prependTo($options.find(".oe_options ul"));
- $options.find(".oe_label").text(this.$el.find('.oe_snippet_thumbnail.oe_label, .oe_snippet_thumbnail .oe_label').text());
+ var $options = this.$overlay.find(".oe_overlay_options");
+ this.$editor.prependTo($options.find(".oe_options ul"));
+ if ($options.find(".oe_options ul li").length) {
+ $options.find(".oe_options").removeClass("hidden");
}
},
@@ -512,41 +626,127 @@
// activate drag and drop for the snippets in the snippet toolbar
_drag_and_drop: function(){
var self = this;
+ var dropped = false;
+ var $move = this.$overlay.find(".oe_snippet_move");
this.$overlay.draggable({
greedy: true,
appendTo: 'body',
cursor: "move",
+ handle: ".oe_snippet_move",
cursorAt: {
- top: self.$target.outerHeight()/2,
- left: self.$target.outerWidth()/2 },
- distance: 20,
- handle: ".js_box_move",
+ left: 18,
+ top: 14
+ },
+ helper: function() {
+ var $clone = $(this).clone().css({width: "24px", height: "24px", border: 0});
+ $clone.find(".oe_overlay_options >:not(.oe_snippet_move), .oe_handle").remove();
+ $clone.find(":not(.glyphicon)").css({position: 'absolute', top: 0, left: 0});
+ return $clone.appendTo("body").removeClass("hidden");
+ },
start: function(){
+ self.parent.hide();
self.parent.editor_busy = true;
- self.$target.css("display", "none");
+ self.$target.after("
");
+ self.$target.detach();
+ self.$overlay.addClass("hidden");
self.parent.activate_insertion_zones({
siblings: self.$el ? self.$el.data('selector-siblings') : false,
- childs: self.$el ? self.$el.data('selector-childs') : false,
- vertical_childs: self.$el ? self.$el.data('selector-vertical-childs') : false,
+ children: self.$el ? self.$el.data('selector-children') : false,
+ vertical_children: self.$el ? self.$el.data('selector-vertical-children') : false,
});
$("body").addClass('move-important');
$('.oe_drop_zone').droppable({
- hoverClass: "oe_hover",
- drop: function(){
- $(this).after(self.$target);
+ over: function(){
+ $(".oe_drop_zone.hide").removeClass("hide");
+ $(this).addClass("hide").first().after(self.$target);
+ dropped = true;
+ },
+ out: function(){
+ $(this).removeClass("hide");
+ self.$target.detach();
+ dropped = false;
},
});
},
stop: function(){
+ if (!dropped) {
+ $(".oe_drop_clone").after(self.$target);
+ }
+ self.$overlay.removeClass("hidden");
$("body").removeClass('move-important');
$('.oe_drop_zone').droppable('destroy').remove();
- self.$target.css("display", "");
+ $(".oe_drop_clone").remove();
self.parent.editor_busy = false;
+ self.get_parent_block();
setTimeout(function () {self.parent.create_overlay(self.$target);},0);
},
});
},
+ _clone: function () {
+ var self = this;
+ this.$overlay.on('click', '.oe_snippet_clone', function () {
+ var $clone = self.$target.clone(false);
+ self.$target.after($clone);
+ setTimeout(function () {
+ self.parent.create_overlay($clone);
+ self.parent.make_active($clone);
+ },0);
+ });
+ },
+
+ load_style_options: function () {
+ var self = this;
+ var $styles = this.$overlay.find('.oe_options');
+ var $ul = $styles.find('ul');
+ _.each(this.parent.style_templates, function (val, key) {
+ if (!self.parent.dom_filter(val.selector).is(self.$target)) {
+ return;
+ }
+ var $li = $("
").data(val);
+ $li.append($('
').text(val.label));
+ $ul.append($li);
+ if (self.$target.hasClass( "oe_snippet_" + $li.data("snipped-id") )) {
+ $li.addClass("active");
+ }
+ $styles.removeClass("hidden");
+ });
+ $styles.on('click', 'li.oe_style a', _.bind(this.change_style, this));
+ },
+ change_style: function (event) {
+ var $li = $(event.currentTarget).parent();
+ var snipped_id = $li.data("snipped-id");
+ var active = $li.hasClass("active");
+
+ if (website.snippet.editorRegistry[snipped_id]) {
+ var snippet = new website.snippet.editorRegistry[snipped_id](this, this.$target);
+ snippet.build_snippet(this.$target);
+ }
+ var _class = "oe_snippet_" + snipped_id + " " + ($li.data("class") || "");
+ if (active) {
+ this.$target.removeClass(_class);
+ } else {
+ this.$target.addClass(_class);
+ }
+ $li.toggleClass("active");
+ },
+
+ get_parent_block: function () {
+ var self = this;
+ var $button = this.$overlay.find('.oe_snippet_parent');
+ var $parent = this.$target.parents("[data-snippet-id]:first");
+ if ($parent.length) {
+ $button.removeClass("hidden");
+ $button.off("click").on('click', function (event) {
+ event.preventDefault();
+ setTimeout(function () {
+ self.parent.make_active($parent);
+ }, 0);
+ });
+ } else {
+ $button.addClass("hidden");
+ }
+ },
/*
* start
@@ -554,13 +754,14 @@
*/
start: function () {
var self = this;
- this.$overlay.on('click', '.js_box_remove', function () {
+ this.$overlay.on('click', '.oe_snippet_remove', function () {
self.$target.detach();
self.onBlur();
self.$target.remove();
return false;
});
this._drag_and_drop();
+ this._clone();
},
/*
@@ -603,7 +804,6 @@
website.snippet.editorRegistry.resize = website.snippet.Editor.extend({
- template : "website.snippets.resize",
start: function () {
var self = this;
this._super();
@@ -657,11 +857,10 @@
var xy = event['page'+XY];
var begin = current;
var beginClass = self.$target.attr("class");
- var regClass = new RegExp("\\s*" + resize[0][begin].replace(/[-]*[0-9]+/, '[0-9-]+'), 'g');
+ var regClass = new RegExp("\\s*" + resize[0][begin].replace(/[-]*[0-9]+/, '[-]*[0-9]+'), 'g');
var cursor = $handle.css("cursor")+'-important';
$("body").addClass(cursor);
- self.$overlay.addClass('oe_hover');
var body_mousemove = function (event){
event.preventDefault();
@@ -685,7 +884,7 @@
if (change) {
self.on_resize(compass, beginClass, current);
- website.snippet.cover_target(self.$overlay, self.$target);
+ self.parent.cover_target(self.$overlay, self.$target);
}
};
$('body').mousemove(body_mousemove);
@@ -720,7 +919,6 @@
});
website.snippet.editorRegistry.colmd = website.snippet.editorRegistry.resize.extend({
- template : "website.snippets.colmd",
getSize: function () {
this.grid = this._super();
var width = this.$target.parents(".row:first").first().outerWidth();
@@ -729,7 +927,7 @@
this.grid.e = [_.map(grid, function (v) {return 'col-md-'+v;}), _.map(grid, function (v) {return width/12*v;})];
var grid = [-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11];
- this.grid.w = [_.map(grid, function (v) {return 'col-lg-offset-'+v;}), _.map(grid, function (v) {return width/12*v;}), 12];
+ this.grid.w = [_.map(grid, function (v) {return 'col-md-offset-'+v;}), _.map(grid, function (v) {return width/12*v;}), 12];
return this.grid;
},
@@ -739,23 +937,26 @@
// don't change the rigth border position when we change the offset (replace col size)
var beginCol = Number(beginClass.match(/col-md-([0-9]+)|$/)[1] || 0);
- var beginOffset = Number(beginClass.match(/col-lg-offset-([0-9-]+)|$/)[1] || 0);
- var offset = Number(this.grid.w[0][current].match(/col-lg-offset-([0-9-]+)|$/)[1] || 0);
-
- this.$target.attr("class",this.$target.attr("class").replace(/\s*(col-lg-offset-|col-md-)([0-9-]+)/g, ''));
-
+ var beginOffset = Number(beginClass.match(/col-md-offset-([0-9-]+)|$/)[1] || beginClass.match(/col-lg-offset-([0-9-]+)|$/)[1] || 0);
+ var offset = Number(this.grid.w[0][current].match(/col-md-offset-([0-9-]+)|$/)[1] || 0);
+ if (offset < 0) {
+ offset = 0;
+ }
var colSize = beginCol - (offset - beginOffset);
+ if (colSize <= 0) {
+ colSize = 1;
+ offset = beginOffset + beginCol - 1;
+ }
+ this.$target.attr("class",this.$target.attr("class").replace(/\s*(col-lg-offset-|col-md-offset-|col-md-)([0-9-]+)/g, ''));
+
this.$target.addClass('col-md-' + (colSize > 12 ? 12 : colSize));
if (offset > 0) {
- this.$target.addClass('col-lg-offset-' + offset);
+ this.$target.addClass('col-md-offset-' + offset);
}
},
});
- website.snippet.selector.push([ _.map([1,2,3,4,5,6,7,8,9,10,11,12], function (v) {return '.row > .col-md-'+v;}).join(","), 'colmd']);
-
website.snippet.editorRegistry.carousel = website.snippet.editorRegistry.resize.extend({
- template : "website.snippets.carousel",
build_snippet: function($target) {
var id = "myCarousel" + $("body .carousel").size();
$target.attr("id", id);
@@ -763,14 +964,34 @@
},
start : function () {
this._super();
+
+ this.$editor.find(".js_add").on('click', this, this.on_add);
+ this.$editor.find(".js_remove").on('click', this, this.on_remove);
+
+ this.change_background();
+ this.change_style();
+ this.change_size();
+ },
+ on_add: function (e) {
+ e.preventDefault();
+ var $inner = e.data.$target.find('.carousel-inner');
+ var cycle = $inner.find('.item').size();
+ $inner.find('.item.active').clone().removeClass('active').appendTo($inner);
+ e.data.$target.carousel(cycle);
+ },
+ on_remove: function (e) {
+ e.preventDefault();
+ var $inner = e.data.$target.find('.carousel-inner');
+ if ($inner.find('.item').size() > 1) {
+ $inner
+ .find('.item.active').remove().end()
+ .find('.item:first').addClass('active');
+ e.data.$target.carousel(0);
+ }
+ },
+ change_background: function () {
var self = this;
-
- this.$editor.find(".js_add").on('click', this.on_add);
- this.$editor.find(".js_remove").on('click', this.on_remove);
-
-
- //background
- var bg = this.$target.find('.carousel-inner .item.active').css('background-image').replace(/url\((.*)\)/g, '\$1');
+ var bg = this.$target.find('.carousel-inner .item.active').css('background-image').replace(/url\((.*)\)/g, '$1');
var selected = this.$editor.find('select[name="carousel-background"] option[value="'+bg+'"], select[name="carousel-background"] option[value="'+bg.replace(window.location.protocol+'//'+window.location.host, '')+'"]')
.prop('selected', true).length;
if (!selected) {
@@ -783,85 +1004,59 @@
self.$target.find('.carousel-inner .item.active').css('background-image', 'url(' + $(this).val() + ')');
$(this).next().val("");
});
-
-
- //style
+ },
+ change_style: function () {
+ var self = this;
var style = false;
- if (this.$target.find('.carousel-inner .item.active .container .content_image.col-lg-offset-1'))
- style = 'image_right';
- if (this.$target.find('.carousel-inner .item.active .container .content_image'))
- style = 'image_left';
+ var el = this.$target.find('.carousel-inner .item.active');
+ if (el.hasClass('text_only'))
+ style = 'text_only';
+ if (el.hasClass('image_text'))
+ style = 'image_text';
+ if (el.hasClass('text_image'))
+ style = 'text_image';
+
this.$editor.find('select[name="carousel-style"] option[value="'+style+'"]').prop('selected', true);
- this.$editor.find('select[name="carousel-style"]').on('change', this.on_bg_change);
+ this.$editor.find('select[name="carousel-style"]').on('change', function(e) {
+ var $container = self.$target.find('.carousel-inner .item.active');
+ $container.removeClass('image_text text_image text_only');
+ $container.addClass($(e.currentTarget).val());
+ });
},
- on_add: function (e) {
- e.preventDefault();
- var $inner = this.$target.find('.carousel-inner');
- var cycle = $inner.find('.item').size();
- $inner.append(this.$('> .item'));
- this.$target.carousel(cycle);
- },
- on_remove: function (e) {
- e.preventDefault();
- var $inner = this.$target.find('.carousel-inner');
- if ($inner.find('.item').size() > 1) {
- $inner
- .find('.item.active').remove().end()
- .find('.item:first').addClass('active');
- this.$target.carousel(0);
- }
- },
- on_bg_change: function (e) {
- var $container = this.$target.find('.carousel-inner .item.active .container');
- var img_url = $('.content_image img', $container).attr("src");
- if (!img_url) {
- img_url = this.img_url || "/website/static/src/img/china.jpg";
- } else {
- this.img_url = img_url;
- }
+ change_size: function () {
+ var self = this;
- $('.content_image', $container).remove();
- switch ($(e.currentTarget).val()) {
- case 'no_image':
- $('.content', $container).attr("class", "content");
- break;
- case 'image_left':
- $('.content', $container).attr("class", "content col-md-6")
- .before('
');
- break;
- case 'image_right':
- $('.content', $container).attr("class", "content col-md-6")
- .after('
');
- break;
- }
- },
- });
+ var size = 'big';
+ if (this.$target.hasClass('oe_small'))
+ size = 'small';
+ else if (this.$target.hasClass('oe_medium'))
+ size = 'medium';
- website.snippet.editorRegistry.darken = website.snippet.Editor.extend({
- build_snippet: function($target) {
- $target.toggleClass('dark');
- var $parent = $target.parent();
- if($parent.hasClass('dark')){
- $parent.replaceWith($target);
- }else{
- $parent = $("
");
- $target.after($parent);
- $parent.append($target);
- }
- this._super();
+ this.$editor.find('select[name="carousel-size"] option[value="'+size+'"]').prop('selected', true);
+
+ this.$editor.find('select[name="carousel-size"]').on('change', function(e) {
+ self.$target
+ .removeClass('oe_big oe_small oe_medium')
+ .addClass("oe_" + $(e.currentTarget).val());
+ });
}
});
website.snippet.animationRegistry.vomify = website.snippet.Animation.extend({
- init: function() {
+ start: function() {
this._super();
var hue=0;
var beat = false;
var self = this;
+ self.$target.append('
VIDEO ');
+
var a = setInterval(function(){
- self.$target.css({'-webkit-filter':'hue-rotate('+hue+'deg)'}); hue += 5;
+ self.$target.next().css({'-webkit-filter':'hue-rotate('+hue+'deg)'});
+ self.$target.prev().css({'-webkit-filter':'hue-rotate('+(-hue)+'deg)'});
+ hue -= 5;
}, 10);
+
setTimeout(function(){
clearInterval(a);
setInterval(function(){
@@ -872,8 +1067,10 @@
}
}, 10);
},5000);
- $('
VIDEO ').appendTo(self.$target);
}
});
-})();
\ No newline at end of file
+ website.snippet.selector.push([ _.map([1,2,3,4,5,6,7,8,9,10,11,12], function (v) {return '.row > .col-md-'+v;}).join(","), 'colmd']);
+ website.snippet.selector.push(['hr', 'hr']);
+
+})();
diff --git a/addons/website/static/src/xml/website.editor.xml b/addons/website/static/src/xml/website.editor.xml
index 6422830ebf5..f3ddfc4f112 100644
--- a/addons/website/static/src/xml/website.editor.xml
+++ b/addons/website/static/src/xml/website.editor.xml
@@ -9,7 +9,6 @@
class="btn">Cancel
@@ -32,7 +31,7 @@