[IMP] replaced calendar icon with map and cloud, top and bottom margin added, domain added for confirmed events, used font-awesome instead of block-country_event.png

bzr revid: pga@tinyerp.com-20140304070104-3pb9hpnkgke6peu9
This commit is contained in:
Parth Gajjar (Open ERP) 2014-03-04 12:31:04 +05:30
parent 35cdbec3d1
commit cc70d1d22e
3 changed files with 27 additions and 19 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 790 B

View File

@ -221,15 +221,15 @@ class website_event(http.Controller):
event_obj = request.registry['event.event']
cr, uid, context,event_ids = request.cr, request.uid, request.context,[]
country_code = self.get_visitors_country()['country_code']
result = {'events':[]}
result = {'events':[],'country':False}
if country_code:
country_ids = country_obj.search(request.cr, request.uid, [('code', '=', country_code)], context=request.context)
result['country'] = country_obj.browse(request.cr, request.uid, country_ids[0], context=request.context)
event_ids = event_obj.search(request.cr, request.uid, ['|', ('address_id', '=', None),('country_id.code', '=', country_code),('date_begin','>=', time.strftime('%Y-%m-%d 00:00:00'))], order="date_begin", context=request.context)
event_ids = event_obj.search(request.cr, request.uid, ['|', ('address_id', '=', None),('country_id.code', '=', country_code),('date_begin','>=', time.strftime('%Y-%m-%d 00:00:00')),('state', '=', 'confirm')], order="date_begin", context=request.context)
if not event_ids:
event_ids = event_obj.search(request.cr, request.uid, [('date_begin','>=', time.strftime('%Y-%m-%d 00:00:00'))], order="date_begin", context=request.context)
result['country'] = False
for event in event_obj.browse(request.cr, request.uid, event_ids, context=request.context):
event_ids = event_obj.search(request.cr, request.uid, [('date_begin','>=', time.strftime('%Y-%m-%d 00:00:00')),('state', '=', 'confirm')], order="date_begin", context=request.context)
for event in event_obj.browse(request.cr, request.uid, event_ids, context=request.context)[:6]:
if country_code and event.country_id.code == country_code:
result['country'] = country_obj.browse(request.cr, request.uid, country_ids[0], context=request.context)
result['events'].append({
"date": self.get_formated_date(event),
"event": event,

View File

@ -120,7 +120,7 @@
<template id="event_right_country_event" inherit_option_id="website_event.index" name="Country Events">
<xpath expr="//div[@id='right_column']" position="inside">
<div class="row">
<div class="col-md-12 mb16 country_events">
<div class="col-md-12 mb16 mt16 country_events">
<div class="country_events_list">
<div class="text-muted text-center">
<h1>
@ -358,16 +358,18 @@
<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 class="oe_snippet_thumbnail">
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block-country_events.png" />
<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">
<div class="oe_snippet_body country_events mb16 mt16">
<div class="country_events_list">
<div class="text-muted text-center">
<h1>
<div>
<i class="fa fa-flag fa-5x"></i>
</h1>
<h1>Events from Your Country</h1>
</div>
<div>Events of to visitor's country</div>
</div>
</div>
</div>
@ -379,7 +381,7 @@
<t t-ignore="true">
<t t-if="events">
<div class="country_events_list">
<div class="mb16 css_editable_mode_hidden">
<div class="css_editable_mode_hidden">
<t t-if="country">
<img 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>
@ -387,11 +389,17 @@
<t t-if="not country">
<h4><b>Upcoming Events</b></h4>
</t>
<div t-foreach="events[:5]" t-as="country_event" class="oe_website_overflow_ellipsis mb8">
<t t-if="not country_event['event'].website_published">
<div t-foreach="events[:5]" t-as="event_dict" class="oe_website_overflow_ellipsis mb8">
<t t-if="not event_dict['event'].website_published">
<span class="label label-danger"><i class="fa fa-ban"></i></span>
</t>
<i class="fa fa-calendar"></i> <b><span t-esc="country_event['date']"/>: <span><a t-att-href="country_event['url']"><t t-esc="country_event['event'].name"/></a></span></b>
<t t-if="event_dict['event'].address_id">
<i class="fa fa-map-marker"></i>
</t>
<t t-if="not event_dict['event'].address_id">
<i class="fa fa-cloud"></i>
</t>
<b><span t-esc="event_dict['date']"/>: <span><a t-att-href="event_dict['url']"><t t-esc="event_dict['event'].name"/></a></span></b>
</div>
<t t-if="len(events) > 5">
<div t-if="country">
@ -404,10 +412,10 @@
</div>
<div class="css_non_editable_mode_hidden">
<div class="text-muted text-center">
<h1>
<div>
<i class="fa fa-flag fa-5x"></i>
</h1>
<h1>Events from Your Country</h1>
</div>
<div>Events of to visitor's country</div>
</div>
</div>
</div>