253 lines
8.8 KiB
Plaintext
253 lines
8.8 KiB
Plaintext
-if @annonce
|
|
.annonce_header_container
|
|
.annonce_header.center
|
|
|
|
|
|
|
|
.price
|
|
=number_to_currency(@annonce.price, :unit => @annonce.devise.icon) if @annonce.price
|
|
|
|
.localisation
|
|
-if @annonce.g_city?
|
|
=@annonce.g_postal_code
|
|
=@annonce.g_city
|
|
="-"
|
|
=@annonce.g_country
|
|
-else
|
|
Internet
|
|
|
|
%h1
|
|
=@annonce.title
|
|
|
|
=render :partial => "public/annonce_account_favs/link", :locals => {:annonce => @annonce}
|
|
|
|
.clear{:style => "height:1px;"}
|
|
|
|
:coffeescript
|
|
$(window).load ->
|
|
|
|
|
|
$(document).on "scroll", ->
|
|
scroll_ajust()
|
|
|
|
$(document).on "touchmove", ->
|
|
scroll_ajust()
|
|
|
|
scroll_ajust = () ->
|
|
var_scroll = $(window).scrollTop()
|
|
if var_scroll > ($(".annonce_header_container").offset().top + 5)
|
|
$(".annonce_header").addClass("move_top")
|
|
else
|
|
$(".annonce_header").removeClass("move_top")
|
|
|
|
|
|
|
|
|
|
- if @annonce.annonce_style_id == 2 and @annonce.default_photo and @annonce.annonce_photos.visibles.where(:id => @annonce.default_photo_id).first
|
|
#default_image_container
|
|
=#default_image_blur{:style => "background-image:url('#{(@annonce.default_photo.file.url)}')"}
|
|
#default_image{:style => "background-image:url('#{(@annonce.default_photo.file.url)}')", :onclick => "$('#annonce .rea-gal a:first').click();"}
|
|
-else
|
|
=#%div{:style => "height:50px"}
|
|
#annonce
|
|
#corps
|
|
-if @annonce.refused
|
|
.alert.alert-warning
|
|
%p Votre annonce n'est pas encore visiblement publiquement.
|
|
|
|
|
|
|
|
|
|
=raw '<img id="img-def2" src="'+@annonce.default_photo.file.url.to_s+'" style="display:none;" >' if @annonce.default_photo
|
|
|
|
|
|
|
|
|
|
:javascript
|
|
$("#img-def2").one("load", function() {
|
|
var el = document.getElementById("img-def2");
|
|
var colorThief = new ColorThief();
|
|
var dominantColor = colorThief.getColor(el);
|
|
//$("#default_image_container").css("background", "rgb("+dominantColor[0]+","+dominantColor[1]+","+dominantColor[2]+")")
|
|
}).each(function() {
|
|
if(this.complete) $(this).load();
|
|
});
|
|
|
|
|
|
-if @annonce.annonce_style_id == 1 and @annonce.default_photo and @annonce.annonce_photos.visibles.where(:id => @annonce.default_photo_id).first
|
|
#photo_preview{ :onclick => "$('#annonce .rea-gal a:first').click();"}
|
|
.default_image_blur{:style => "background-image:url('#{(@annonce.default_photo.file.url)}')"}
|
|
=image_tag(@annonce.default_photo.file.url.to_s, :id => "photo_preview_image")
|
|
-if false
|
|
:javascript
|
|
$("#photo_preview_image").one("load", function() {
|
|
var el = document.getElementById("photo_preview_image");
|
|
var colorThief = new ColorThief();
|
|
var dominantColor = colorThief.getColor(el);
|
|
//$("#photo_preview").css("background", "rgb("+dominantColor[0]+","+dominantColor[1]+","+dominantColor[2]+")")
|
|
}).each(function() {
|
|
if(this.complete) $(this).load();
|
|
});
|
|
|
|
|
|
.annonce_photos
|
|
.rea-gal
|
|
-@annonce.annonce_photos.visibles.each do |annonce_photo|
|
|
|
|
=link_to image_tag(annonce_photo.file.square.url), annonce_photo.file.url
|
|
.clear
|
|
|
|
=simple_format(strip_tags(@annonce.content))
|
|
|
|
-if @annonce.link and @annonce.link_url?
|
|
|
|
=link_to i(:globe)+" "+@annonce.link_url, @annonce.link_url, :target => "_blank", :class => "annonce_link btn btn-primary"
|
|
|
|
|
|
-if @annonce.video and @annonce.video_url?
|
|
%hr
|
|
.video-container
|
|
=raw ('<iframe width="560" height="315" src="https://www.youtube.com/embed/'+@annonce.video_url+'?rel=0" frameborder="0" allowfullscreen></iframe>')
|
|
|
|
%hr
|
|
-if @annonce.g_latitude? and @annonce.g_longitude?
|
|
|
|
#annonce_map{:style => "height:400px;"}
|
|
%hr
|
|
-if @annonce.g_latitude? and @annonce.g_longitude?
|
|
%script
|
|
=raw "var center = new google.maps.LatLng(#{@annonce.g_latitude}, #{@annonce.g_longitude});"
|
|
=raw "var map_center = {lat: #{@annonce.g_latitude}, lng: #{@annonce.g_longitude}}"
|
|
|
|
:javascript
|
|
var map;
|
|
function initMap() {
|
|
map = new google.maps.Map(document.getElementById('annonce_map'), {
|
|
center: map_center,
|
|
zoom: 10,
|
|
scrollwheel: false,
|
|
draggable: true,
|
|
navigationControl: true,
|
|
mapTypeControl: true,
|
|
streetViewControl: true
|
|
});
|
|
}
|
|
initMap();
|
|
|
|
var marker = new google.maps.Marker({
|
|
position: center,
|
|
map: map
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
-if current_admin
|
|
#annonce_admin=render :partial => "public/annonces/admin"
|
|
|
|
|
|
.share
|
|
#likebox-wrapper
|
|
%div
|
|
.fb-like{}
|
|
%div
|
|
=raw '<div class="fb-share-button" data-href="'+request.url+'" data-layout="button_count"></div>'
|
|
|
|
|
|
#infos
|
|
-@annonce_account = @annonce.annonce_account
|
|
|
|
|
|
.annonce_owner
|
|
.head
|
|
|
|
|
|
|
|
|
|
=link_to public_annonce_account_path(@annonce.annonce_account) do
|
|
=image_tag(@annonce.annonce_account.avatar_url)
|
|
=link_to public_annonce_account_path(@annonce.annonce_account) do
|
|
=@annonce.annonce_account.pseudo
|
|
|
|
-if @annonce.annonce_account.pro
|
|
Professionnel
|
|
%br
|
|
|
|
|
|
=render :partial => "public/annonce_accounts/security_panel"
|
|
|
|
-if @annonce.published_date?
|
|
Déposée le
|
|
=l @annonce.published_date, :format => :date
|
|
|
|
|
|
-if @annonce.link and @annonce.link_url?
|
|
%hr
|
|
%p
|
|
=i :globe
|
|
=link_to "Site internet", @annonce.link_url, :target => "_blank"
|
|
%hr
|
|
%p=link_to ic(:"envelope-o")+" Contacter par message privé", mail_public_annonce_account_path( @annonce.annonce_account.id, :annonce_id => @annonce.id)
|
|
-if @annonce.tel?
|
|
%p
|
|
=ic :phone
|
|
=@annonce.tel_number
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%hr
|
|
%p
|
|
=link_to @annonce.annonce_cat.name, search_public_annonces_path(:annonce_cat_id => @annonce.annonce_cat.id) if @annonce.annonce_cat
|
|
|
|
-if @annonce.specific_annonce
|
|
%hr
|
|
=render @annonce.specific_annonce
|
|
-if current_annonce_account and current_annonce_account == @annonce.annonce_account
|
|
%hr
|
|
#my_annonce.alert.alert-info
|
|
%h3 Gérer mon annonce
|
|
=link_to i(:pencil)+" modifier mon annonce", edit_public_annonce_path(@annonce)
|
|
%br
|
|
=link_to i(:plus)+" mettre en valeur mon annonce", options_public_annonce_path(@annonce)
|
|
%br
|
|
=link_to i(:"trash-o")+" désactiver mon annonce", [:public, @annonce], :data => {:confirm => "Voulez-vous vraiment désactiver votre annonce ? Elle ne sera plus visible sur Sideplace"}, :method => :delete
|
|
-if !@annonce.published
|
|
#annonce_publish.alert.alert-warning
|
|
%h3 Votre annonce n'est pas publiée
|
|
%p Une fois que vous avez vérifié le contenu de votre annonce vous devez la publier pour qu'elle soit visible de tous :
|
|
=link_to "Publier maintenant", publish_public_annonce_path(@annonce), :remote => true, :class => "btn btn-warning btn-lg"
|
|
|
|
.panel.panel-default
|
|
.panel-heading
|
|
Vous aussi déposez vos annonces !
|
|
|
|
.panel-body
|
|
%p Sur Sideplace, déposer et modifier une annonce c'est gratuit.
|
|
%p Seules les options facultatives sont payantes.
|
|
|
|
-if cookies[:mlm_token]
|
|
=link_to "Je m'inscris gratuitement", new_public_annonce_account_path(), :class => "btn btn-primary"
|
|
%br
|
|
%br
|
|
%p En plus, avec le lien ci-dessus je profite de 10 crédits offerts grâce à celui où celle qui m'a fait connaître le site !
|
|
-elsif @annonce.annonce_account.credits_boughts(Date.today) > 0
|
|
=link_to "Je m'inscris gratuitement", new_public_annonce_account_path(:p => @annonce.annonce_account.mlm_token), :class => "btn btn-primary"
|
|
%br
|
|
%br
|
|
%p En plus, avec le lien ci-dessus je profite de 10 crédits offerts en utilisant le lien de recommandation de cet annonceur !
|
|
-else
|
|
=link_to "Je m'inscris gratuitement !", new_public_annonce_account_path(), :class => "btn btn-primary"
|
|
-else
|
|
.center.padding
|
|
%h1=qit "titre annonce plus dispo", "Cette annonce n'est plus disponible"
|
|
|
|
|
|
|
|
|
|
|