php_app/app/views/portlets/render_public/_eventcontent.html.haml
Nicolas Bally 5cf3a3e83d initial
2014-11-25 22:56:20 +01:00

106 lines
1.7 KiB
Plaintext

.event{:class => input.event_type.to_i}
%a{:id => "event_#{input.id}"}
-if input.image_file
%p.img{:style =>"float:left;"}
=image_tag(input.image_file.file.large.medium.small.thumb)
%h2=input.title
%h3= input.artist
%h4
="Rencontre avec l'artiste" if input.event_type.to_i == 1
= l input.start_at, :format => :human
%p{:style => "clear:both;margin-top:20px;"}
#map.map{:id => input.id, :style => "width:400px; height:200px;"}
<script type="text/javascript">
="var address ='#{escape_javascript(input.address.to_s)}';"
var geocoder;
geocoder = new google.maps.Geocoder();
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var myLatlng = results[0].geometry.location;
var myOptions = {
="zoom:#{escape_javascript(12.to_s)},"
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
="var map = new google.maps.Map(document.getElementById('map_#{input.id}'),"
myOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map : map,
="title:'=#{escape_javascript(input.title)}',"
});
var infowindow = new google.maps.InfoWindow({
="content:'#{escape_javascript(input.title)}',"
});
}
});
</script>
%p
%strong=input.place
%br
=simple_format input.address
=simple_format input.description
%p=link_to "voir la carte en grand", "http://maps.google.com/maps?q="+u(input.address), :target => "blank"
-if input.with_cible?
- if input.cible
=link_to "site de l'artiste", input.cible.cible_url, :target => ("_blank" if input.popup).to_s
%p{:style => "clear:both;margin-top:10px;"}