diff options
| author | Fabien Pinckaers <fp@tinyerp.com> | 2012-05-25 09:21:14 +0200 |
|---|---|---|
| committer | Fabien Pinckaers <fp@tinyerp.com> | 2012-05-25 09:21:14 +0200 |
| commit | 3f31dd0d0c8fe3863ecfa399cf605b09f24034a7 (patch) | |
| tree | d3900f115dbb5351c3925ddd97f643f4de3a21aa /addons/event/static/src | |
| parent | c78ca8dd35271227b6c82fe79dc3be15baae8a7a (diff) | |
| parent | 1439905b7bce525e6d5b5ef1c133a68b65d1ac98 (diff) | |
[merge] events
bzr revid: fp@tinyerp.com-20120525072114-x1ylvnbw2k3twbhy
Diffstat (limited to 'addons/event/static/src')
| -rw-r--r-- | addons/event/static/src/css/event.css | 123 | ||||
| -rw-r--r-- | addons/event/static/src/js/google_map.js | 68 |
2 files changed, 131 insertions, 60 deletions
diff --git a/addons/event/static/src/css/event.css b/addons/event/static/src/css/event.css index a0f738e6323..e637bc56c65 100644 --- a/addons/event/static/src/css/event.css +++ b/addons/event/static/src/css/event.css @@ -33,68 +33,25 @@ div.oe_fold_column{ padding:0px !important; } .oe_event_button_subscribe { - display: inline-block; - border: 1px solid #ababab; - color: #404040; - font-size: 12px; - padding: 3px 10px; - text-align: center; - -o-background-size: 100% 100%; - -moz-background-size: 100% 100%; - -webkit-background-size: auto auto !important; - background-size: 100% 100%; - background: #d8d8d8 none; - background: none, -webkit-gradient(linear, left top, left bottom, from(#efefef), to(#d8d8d8)); - background: none, -webkit-linear-gradient(#efefef, #d8d8d8); - background: none, -moz-linear-gradient(#efefef, #d8d8d8); - background: none, -o-linear-gradient(top, #efefef, #d8d8d8); - background: none, -khtml-gradient(linear, left top, left bottom, from(#efefef), to(#d8d8d8)); - background: -ms-linear-gradient(top, #efefef, #d8d8d8); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#efefef', endColorstr='#d8d8d8',GradientType=0 ); - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - -o-border-radius: 3px; - -ms-border-radius: 3px; - border-radius: 3px; - -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; - -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; - -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; - text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5); - -webkit-font-smoothing: antialiased; - outline: none; + color: white; + background-color: #8a89ba; + background-image: -webkit-gradient(linear, left top, left bottom, from(#8a89ba), to(#807fb4)); + background-image: -webkit-linear-gradient(top, #8a89ba, #807fb4); + background-image: -moz-linear-gradient(top, #8a89ba, #807fb4); + background-image: -ms-linear-gradient(top, #8a89ba, #807fb4); + background-image: -o-linear-gradient(top, #8a89ba, #807fb4); + background-image: linear-gradient(to bottom, #8a89ba, #807fb4); } + .oe_event_button_unsubscribe { - display: inline-block; - border: 1px solid #AAA; - color: #404040; - font-size: 12px; - padding: 3px 10px; - text-align: center; - -o-background-size: 100% 100%; - -moz-background-size: 100% 100%; - -webkit-background-size: auto auto !important; - background-size: 100% 100%; - background: #AAA none; - background: none, -webkit-gradient(linear, left top, left bottom, from(#AAA), to(#AAA)); - background: none, -webkit-linear-gradient(#AAA, #AAA); - background: none, -moz-linear-gradient(#AAA, #AAA); - background: none, -o-linear-gradient(top, #AAA, #AAA); - background: none, -khtml-gradient(linear, left top, left bottom, from(#AAA), to(#AAA)); - background: -ms-linear-gradient(top, #AAA, #AAA); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#AAA, endColorstr='#AAA',GradientType=0 ); - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - -o-border-radius: 3px; - -ms-border-radius: 3px; - border-radius: 3px; - -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; - -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; - -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.8) inset; - text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5); - -webkit-font-smoothing: antialiased; - outline: none; + color: white; + background-color: #8a89ba; + background-image: -webkit-gradient(linear, left top, left bottom, from(#8a89ba), to(#807fb4)); + background-image: -webkit-linear-gradient(top, #8a89ba, #807fb4); + background-image: -moz-linear-gradient(top, #8a89ba, #807fb4); + background-image: -ms-linear-gradient(top, #8a89ba, #807fb4); + background-image: -o-linear-gradient(top, #8a89ba, #807fb4); + background-image: linear-gradient(to bottom, #8a89ba, #807fb4);; } .oe_event_button_subscribe:hover { cursor: pointer; @@ -115,4 +72,50 @@ div.oe_fold_column{ display: inline; background-color: #DC5F59; } + .no_of_seats{ + width:35px; + + } + .oe_event_title{ + font-size: 25px; +} +.oe_sub1 +{ + float:left; + height:50px; + border-right: 1px solid black; + border-color: #DCDCDC; +} +.oe_mapbox +{ + position: relative; + float: right; + height:200px; + width:256px; + border: 1px solid #eeeeee; +} +.oe_td_border +{ + width: 7em; + padding: 5px; + border-right: 1px solid black; + text-align: right; + border-color: #DCDCDC; + border-spacing:5em +} +.oe_td_date_border +{ + border-right:1px solid black; + border-color: #DCDCDC; +} + +textarea.field_text +{ + width: 765px; + height: 318px; +} +td.oe_form_group_nested +{ + padding: 5px; +} diff --git a/addons/event/static/src/js/google_map.js b/addons/event/static/src/js/google_map.js new file mode 100644 index 00000000000..7d2681a7369 --- /dev/null +++ b/addons/event/static/src/js/google_map.js @@ -0,0 +1,68 @@ +openerp.event = function(instance){ + instance.web.form.widgets.add('many2one_Geo_address', 'instance.event.Many2OneAddress'); + + instance.web.GoogleMapConnector = instance.web.Class.extend({ + init: function(){ + this.googleMapsLoaded = $.Deferred(); + this.map_load(); + }, + map_load: function() { + var self = this; + if(this.googleMapsLoaded.state() != "pending"){return this.googleMapsLoaded.promise();} + googleMapsCallback = function () { + self.googleMapsLoaded.resolve(); + }; + $.ajax({ + url: "https://maps.googleapis.com/maps/api/js?v=3&callback=googleMapsCallback&sensor=false", + dataType: "script" + }).fail(self.googleMapsLoaded.reject); + return this.googleMapsLoaded.promise(); + }, + render_map: function(address,$element){ + var geocoder = new google.maps.Geocoder(); + geocoder.geocode( { 'address': address}, function(results, status){ + if (status == google.maps.GeocoderStatus.OK){ + var lat = results[0].geometry.location.lat(),lng =results[0].geometry.location.lng(); + var myOptions = { + zoom: 17, + center: new google.maps.LatLng(lat,lng), + mapTypeId: google.maps.MapTypeId.ROADMAP + } + return new google.maps.Marker({ + map : new google.maps.Map($element,myOptions), + position: new google.maps.LatLng(lat,lng) + }); + } + }); + }, + }); + instance.event.Many2OneAddress = instance.web.form.FieldMany2One.extend({ + init: function(field_manager, node){ + this._super(field_manager, node); + this.map = new instance.web.GoogleMapConnector(); + }, + get_address:function(value){ + var self = this; + if (!value || value.length == 0){ + return $.Deferred().reject(); + } + (value instanceof Array)?value = parseInt(value[0]):false; + var data = new instance.web.DataSet(this,this.field.relation, this.build_context()); + data.read_ids(value,["street","city","country_id"]).done(function(value){ + var address = _.str.sprintf(' %(street)s, %(city)s, %(country_id[1])s', value); + self.map.googleMapsLoaded.done(function(){ + self.map.render_map(address,document.getElementById("oe_mapbox")); + }) + }); + }, + set_value:function(value){ + this._super(value); + this.get_address(value); + }, + + render_value:function(no_recurse){ + this.get_address(this.get("value")); + this._super(no_recurse); + } + }); +};
\ No newline at end of file |
