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