[IMP] improved code as suggested

bzr revid: dizzy.zala@gmail.com-20140318130903-6u2t94bfvh98jby7
This commit is contained in:
Dharmraj Jhala (OpenERP) 2014-03-18 18:39:03 +05:30
parent 3566b69374
commit ac8b0fcfc5
2 changed files with 21 additions and 21 deletions

View File

@ -1,16 +1,16 @@
(function() {
"use strict";
function getLocation(){
$.post( "/event/get_country_event_list/", function( data ) {
if(data){
$( ".country_events_list" ).replaceWith( data );
}
});
}
var website = openerp.website;
$(document).ready(function () {
if($('.country_events').length){
getLocation();
website.snippet.animationRegistry.visitor = website.snippet.Animation.extend({
selector: ".oe_country_events",
start: function () {
var self = this;
$.post( "/event/get_country_event_list/", function( data ) {
if(data){
$( ".country_events_list" ).replaceWith( data );
}
});
}
});
})();

View File

@ -361,14 +361,14 @@
<template id="country_events" name="Country Events" inherit_id="website.snippets">
<xpath expr="//div[@id='snippet_content']" position="inside">
<div data-snippet-id="country_events" data-selector-siblings="p, h2, h3, blockquote" data-selector-children=".content">
<div>
<div class="oe_snippet_thumbnail">
<div style="background: white;box-shadow:none;-webkit-box-shadow:none;" class="oe_snippet_thumbnail_img" >
<i class="fa fa-flag fa-5x text-muted"></i>
</div>
<span class="oe_snippet_thumbnail_title">Country Events</span>
</div>
<div class="oe_snippet_body country_events mb16 mt16">
<div class="oe_snippet_body oe_country_events mb16 mt16">
<div class="country_events_list">
<div class="text-muted text-center">
<div>
@ -380,13 +380,21 @@
</div>
</div>
</xpath>
<xpath expr="//div[@id='snippet_options']" position="inside">
<div data-snippet-option-id='content'
data-selector=".oe_country_events"
data-selector-siblings="p, h1, h2, h3, blockquote, .well, .panel"
data-selector-children=".content"
>
</div>
</xpath>
</template>
<template id="country_events_list" name="Country">
<t t-ignore="true">
<t t-if="events">
<div class="country_events_list">
<div class="css_editable_mode_hidden">
<div>
<t t-if="country">
<img style="max-height:10em;" class="img-rounded img-responsive" t-att-src="'/website/image?model=res.country&amp;field=image&amp;id='+str(country.id)"></img>
<h4><b>Events In <span t-esc="country.name"></span></b></h4>
@ -416,14 +424,6 @@
</div>
</t>
</div>
<div class="css_non_editable_mode_hidden">
<div class="text-muted text-center">
<div>
<i class="fa fa-flag fa-5x"></i>
</div>
<div>Events of to visitor's country</div>
</div>
</div>
</div>
</t>
</t>