images
This commit is contained in:
parent
387c5f1fa7
commit
fdadb33a65
@ -394,6 +394,9 @@ background:rgba(176,201,49,1);
|
||||
.rose_background{
|
||||
background:rgba(230,0,125,1);
|
||||
}
|
||||
.content_center{
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.beton{
|
||||
|
||||
|
@ -5,7 +5,7 @@ class BlockContent < ActiveRecord::Base
|
||||
|
||||
validates :nbr_columns, :presence => true
|
||||
|
||||
STYLES = [["normal",1],["fond gris foncé",2],["fond gris clair",3],["fond bleu",4],["fond jaune",5],["fond vert",6],["fond béton",7]]
|
||||
STYLES = [["normal",1],["fond gris foncé",2],["fond gris clair",3],["fond bleu",4],["fond jaune",5],["fond vert",6],["fond béton",7],["Contenu centré",8]]
|
||||
|
||||
|
||||
|
||||
|
@ -3,8 +3,8 @@ class ImageContent < ActiveRecord::Base
|
||||
belongs_to :image_file
|
||||
|
||||
has_one :portlet, :as => :content, :dependent => :destroy
|
||||
STYLES = [["Grande","5"],["Taille moyenne","1"], ["Petite taille","2"], ["Petit carré","3"], ["Miniature","4"]]
|
||||
ALIGNS = [["centré","center"], ["gauche","left"],["droite","right"]]
|
||||
STYLES = [["Grande","5"],["Taille moyenne","1"], ["Petite taille","2"], ["Petit carré","3"], ["Miniature","4"],["Orginale","6"]]
|
||||
ALIGNS = [["centré","center"], ["gauche","left"],["droite","right"],["Aucun","none"]]
|
||||
|
||||
belongs_to :cible, :polymorphic => true
|
||||
accepts_nested_attributes_for :cible
|
||||
|
@ -15,6 +15,7 @@
|
||||
- css_class = "yellow_background" if input.style == 5
|
||||
- css_class = "green_background" if input.style == 6
|
||||
- css_class = "beton" if input.style == 7
|
||||
- css_class = "content_center" if input.style == 8
|
||||
|
||||
=raw "<div class='#{css_class}'>" if !admin
|
||||
|
||||
|
@ -15,6 +15,8 @@
|
||||
|
||||
-elsif input.style== "5"
|
||||
-url =input.image_file.file.large.url
|
||||
-elsif input.style== "6"
|
||||
-url =input.image_file.file.url
|
||||
|
||||
|
||||
|
||||
@ -31,6 +33,8 @@
|
||||
|
||||
-style = "float:left;" if input.alignement == "left"
|
||||
|
||||
-style = false if input.alignement == "none"
|
||||
|
||||
- if input.cible
|
||||
-link = input.cible.cible_url
|
||||
|
||||
@ -38,18 +42,21 @@
|
||||
-styleimg += "width:"+input.width.to_s+"px;" if input.width?
|
||||
-styleimg += "height:"+input.height.to_s+"px;" if input.height?
|
||||
|
||||
.img{:style =>style}
|
||||
-if admin
|
||||
= image_tag(url, :alt => input.alt.to_s, :style => styleimg )
|
||||
-else
|
||||
=raw '<div class="img" style="'+style+'">' if style
|
||||
|
||||
-if admin
|
||||
= image_tag(url, :alt => input.alt.to_s, :style => styleimg )
|
||||
-else
|
||||
|
||||
-if link
|
||||
|
||||
-if link
|
||||
=link_to image_tag(url, :alt => input.alt.to_s, :style => styleimg ), link, :title => input.alt.to_s, :target => (input.popup ? "_blank" : "")
|
||||
|
||||
|
||||
=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"
|
||||
|
||||
|
||||
-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 )
|
||||
|
||||
-else
|
||||
=image_tag(url, :alt => input.alt.to_s, :style => styleimg )
|
||||
=raw '</div>' if style
|
Loading…
x
Reference in New Issue
Block a user