79 lines
2.2 KiB
Plaintext
79 lines
2.2 KiB
Plaintext
|
|
-if input.image_file
|
|
|
|
-if input.style== "1"
|
|
-url =input.image_file.file.large.medium.url
|
|
|
|
-elsif input.style== "2"
|
|
-url =input.image_file.file.large.medium.small.url
|
|
|
|
-elsif input.style== "3"
|
|
-url =input.image_file.file.square.url
|
|
|
|
-elsif input.style== "4"
|
|
-url =input.image_file.file.large.medium.small.thumb.url
|
|
|
|
-elsif input.style== "5"
|
|
-url =input.image_file.file.large.url
|
|
-elsif input.style== "6"
|
|
-url =input.image_file.file.url
|
|
-elsif input.style== "7"
|
|
-url =input.image_file.file.square.url
|
|
|
|
|
|
|
|
-else
|
|
-url =""
|
|
|
|
-url = "http#{("" if Rails.env.production?)}://"+HOSTNAME+url
|
|
-style = ""
|
|
-style = "text-align:center;width:100%;" if input.alignement == "center"
|
|
|
|
|
|
-style = "float:right;" if input.alignement == "right"
|
|
|
|
|
|
-style = "float:left;" if input.alignement == "left"
|
|
|
|
|
|
-style = false if input.alignement == "none"
|
|
|
|
- if input.cible
|
|
-link = input.cible.cible_url(@lang.slug)
|
|
|
|
-styleimg=""
|
|
-styleimg += "border-radius:50%;max-width:100%;" if input.style== "7"
|
|
-styleimg += "width:"+input.width.to_s+"px;" if input.width?
|
|
-styleimg += "height:"+input.height.to_s+"px;" if input.height?
|
|
|
|
-styleimg += "margin-top:#{input.margin_top}px;" if input.margin_top?
|
|
-styleimg += "margin-bottom:#{input.margin_bottom}px;" if input.margin_bottom?
|
|
-styleimg += "margin-left:#{input.margin_left}px;" if input.margin_left?
|
|
-styleimg += "margin-right:#{input.margin_right}px;" if input.margin_right?
|
|
|
|
|
|
=raw '<div class="img image_content" style="'+style+'">' if style
|
|
|
|
-if admin
|
|
= image_tag(url, :alt => input.alt.to_s, :style => styleimg )
|
|
-else
|
|
|
|
-if link
|
|
|
|
=link_to image_tag(url, :alt => input.alt.to_s, :style => styleimg ), link, :title => input.alt.to_s, :target => (input.popup ? "_blank" : "")
|
|
|
|
|
|
-elsif input.expandable
|
|
=link_to image_tag(url, :alt => input.alt.to_s, :style => styleimg ), (input.image_file ? input.image_file.file.large.url : ""), :title => input.alt.to_s, :class => "expandable_image"
|
|
|
|
-else
|
|
=image_tag(url, :alt => input.alt.to_s, :style => styleimg )
|
|
|
|
-if input.with_legend
|
|
.legend
|
|
=input.alt
|
|
|
|
=raw '</div>' if style
|
|
|
|
-if input.image_file and input.image_file.photograph
|
|
-@page_images_credits << input.image_file.photograph |