summaryrefslogtreecommitdiff
path: root/addons/website/static/src
diff options
context:
space:
mode:
authorFabien Meghazi <fme@openerp.com>2014-07-10 14:01:03 +0200
committerFabien Meghazi <fme@openerp.com>2014-07-10 14:01:03 +0200
commitd137b0aec0ca34d152e3d81dffe2c30bc891119a (patch)
tree2660cabf628eac6f57350630c296a3ceff4d8921 /addons/website/static/src
parentc2868af0ad60bed71a3440bb4540cbdc61897a29 (diff)
[ADD] Option to list asset bundles in templates editor
Diffstat (limited to 'addons/website/static/src')
-rw-r--r--addons/website/static/src/css/editor.css30
-rw-r--r--addons/website/static/src/css/editor.sass4
-rw-r--r--addons/website/static/src/js/website.ace.js50
-rw-r--r--addons/website/static/src/xml/website.ace.xml3
4 files changed, 51 insertions, 36 deletions
diff --git a/addons/website/static/src/css/editor.css b/addons/website/static/src/css/editor.css
index d38f26fd332..ac7ddbbccb5 100644
--- a/addons/website/static/src/css/editor.css
+++ b/addons/website/static/src/css/editor.css
@@ -23,8 +23,8 @@
.navbar.navbar-inverse .cke_top {
background: transparent;
border: none;
- -webkit-box-shadow: none;
-moz-box-shadow: none;
+ -webkit-box-shadow: none;
box-shadow: none;
-ms-filter: "alpha(opacity=50)";
}
@@ -57,13 +57,11 @@
padding: 2px;
margin: 0;
z-index: 20000;
- background: #414141, -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #646060), color-stop(100%, #262626));
- background: #414141, -webkit-linear-gradient(#646060, #262626);
background: #414141, -moz-linear-gradient(#646060, #262626);
- background: #414141, -o-linear-gradient(#646060, #262626);
+ background: #414141, -webkit-linear-gradient(#646060, #262626);
background: #414141, linear-gradient(#646060, #262626);
- -webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
box-sizing: border-box;
}
.oe_website_editorbar li {
@@ -225,8 +223,9 @@ ul.oe_menu_editor .disclose {
/* ---- RTE ---- {{{ */
.oe_editable .btn, .btn.oe_editable {
- -webkit-user-select: auto;
-moz-user-select: auto;
+ -ms-user-select: auto;
+ -webkit-user-select: auto;
user-select: auto;
cursor: text !important;
}
@@ -384,10 +383,8 @@ ul.oe_menu_editor .disclose {
height: 660px;
background-color: black;
border: 2px solid #1c1f1f;
- -webkit-border-radius: 10px;
-moz-border-radius: 10px;
- -ms-border-radius: 10px;
- -o-border-radius: 10px;
+ -webkit-border-radius: 10px;
border-radius: 10px;
margin: auto;
top: 0;
@@ -410,13 +407,13 @@ ul.oe_menu_editor .disclose {
color: #1c1f1f;
}
.oe_mobile_preview.modal .modal-content .modal-header .close {
- color: lightgrey;
- filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
+ color: lightgray;
+ filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false);
opacity: 1;
}
.oe_mobile_preview.modal .modal-content .modal-header .close:hover {
color: #e00101;
- filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
+ filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false);
opacity: 1;
}
.oe_mobile_preview.modal .modal-content .modal-body {
@@ -447,10 +444,8 @@ ul.oe_menu_editor .disclose {
}
.oe_seo_configuration .oe_seo_keyword {
padding: 0.2em 0.4em 0.2em 0.5em;
- -webkit-border-radius: 0.4em;
-moz-border-radius: 0.4em;
- -ms-border-radius: 0.4em;
- -o-border-radius: 0.4em;
+ -webkit-border-radius: 0.4em;
border-radius: 0.4em;
}
.oe_seo_configuration li.oe_seo_preview_g {
@@ -554,3 +549,8 @@ ul.oe_menu_editor .disclose {
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
}
+
+.oe_include_bundles {
+ font-weight: normal;
+ padding: 0 8px;
+}
diff --git a/addons/website/static/src/css/editor.sass b/addons/website/static/src/css/editor.sass
index b40907bc66c..802b6299545 100644
--- a/addons/website/static/src/css/editor.sass
+++ b/addons/website/static/src/css/editor.sass
@@ -477,6 +477,10 @@ $infobar_height: 20px
z-index: -1000
+opacity(0)
+.oe_include_bundles
+ font-weight: normal
+ padding: 0 8px
+
// }}}
// vim:tabstop=4:shiftwidth=4:softtabstop=4:fdm=marker:
diff --git a/addons/website/static/src/js/website.ace.js b/addons/website/static/src/js/website.ace.js
index 1fb0b93c830..03c6747ddd1 100644
--- a/addons/website/static/src/js/website.ace.js
+++ b/addons/website/static/src/js/website.ace.js
@@ -70,6 +70,7 @@
template: 'website.ace_view_editor',
events: {
'change #ace-view-list': 'displaySelectedView',
+ 'click .js_include_bundles': 'loadTemplates',
'click button[data-action=save]': 'saveViews',
'click button[data-action=format]': 'formatXml',
'click button[data-action=close]': 'close',
@@ -83,26 +84,7 @@
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,
- 'full': true,
- }).then(function (views) {
- self.loadViews.call(self, views);
- self.open.call(self);
- var curentHash = window.location.hash;
- var indexOfView = curentHash.indexOf("?view=");
- if (indexOfView >= 0) {
- var viewId = parseInt(curentHash.substring(indexOfView + 6, curentHash.length), 10);
- self.$('#ace-view-list').val(viewId).change();
- } else {
- if (views.length >= 2) {
- var mainTemplate = views[1];
- self.$('#ace-view-list').val(mainTemplate.id).trigger('change');
- }
- window.location.hash = hash;
- }
- });
+ self.loadTemplates();
var $editor = self.$('.ace_editor');
function resizeEditor (target) {
@@ -150,8 +132,34 @@
resizeEditor(readEditorWidth());
resizeEditorHeight(this.getParent().$el.outerHeight()+2);
},
+ loadTemplates: function () {
+ var self = this;
+ var args = {
+ xml_id: $(document.documentElement).data('view-xmlid'),
+ full: true,
+ bundles: this.$('.js_include_bundles')[0].checked
+ };
+ return openerp
+ .jsonRpc('/website/customize_template_get', 'call', args)
+ .then(function (views) {
+ self.loadViews.call(self, views);
+ self.open.call(self);
+ var curentHash = window.location.hash;
+ var indexOfView = curentHash.indexOf("?view=");
+ if (indexOfView >= 0) {
+ var viewId = parseInt(curentHash.substring(indexOfView + 6, curentHash.length), 10);
+ self.$('#ace-view-list').val(viewId).change();
+ } else {
+ if (views.length >= 2) {
+ var mainTemplate = views[1];
+ self.$('#ace-view-list').val(mainTemplate.id).trigger('change');
+ }
+ window.location.hash = hash;
+ }
+ });
+ },
loadViews: function (views) {
- var $viewList = this.$('#ace-view-list');
+ var $viewList = this.$('#ace-view-list').empty();
_(this.buildViewGraph(views)).each(function (view) {
if (!view.id) { return; }
diff --git a/addons/website/static/src/xml/website.ace.xml b/addons/website/static/src/xml/website.ace.xml
index 23f3ca0c2e4..28b9dd83192 100644
--- a/addons/website/static/src/xml/website.ace.xml
+++ b/addons/website/static/src/xml/website.ace.xml
@@ -6,6 +6,9 @@
<select id="ace-view-list" class="form-control oe_view_list">
<!-- filled in JS -->
</select>
+ <label class="oe_include_bundles">
+ <input type="checkbox" class="js_include_bundles"/> Include Asset Bundles
+ </label>
<button data-action="save" type="submit" class="btn btn-success">Save</button>
<button data-action="format" type="button" class="btn btn-warning">Format</button>
<button data-action="close" type="button" class="btn btn-info">Close</button>