This commit is contained in:
Nicolas Bally 2016-02-17 17:48:17 +01:00
parent cdd5a4cb1d
commit 6a93b336e3
7 changed files with 49 additions and 16 deletions

View File

@ -236,10 +236,7 @@ $("document").ready ->
$(".rea-gal").each ->
$(this).find("img").css "width", Math.floor(((100) )/ 5)+"%"
$("#large").css "min-height", ($(window).height()-30)+"px"

View File

@ -61,21 +61,40 @@
.rea-gal{
.gallery{
padding-left:0px;
margin-right:-25px;
margin-bottom:-25px;
img{
a{
text-align:center;
padding-right:25px;
display:block;
padding-bottom:25px;
width:200px;
border-radius:50%;
text-decoration:none;
float:left;
box-sizing: border-box;
&:hover{
.title{
color:#9d9d9d;
}
.desc{
color:#E5E5E5;
}
img{
border-radius:50%;
}
img:hover{
opacity:0.8;
}
}
}
img{
max-width:100%;
}

View File

@ -5,6 +5,9 @@
Style :
= form.select :style, GalleryContent::STYLES
=form.input :show_title, :label => "Afficher les titres sous les vignettes ?"
=form.input :show_description, :label => "Afficher les descriptions sous les vignettes ?"

View File

@ -70,9 +70,15 @@
.rea-gal
.rea-gal.gallery
-input.gallery_images.each do |gallery_images|
=link_to image_tag(gallery_images.image_file.file.square.url, :alt => "#{gallery_images.title}"), gallery_images.image_file.file.large.url, :title => gallery_images.title
=link_to gallery_images.image_file.file.large.url, :title => gallery_images.title do
=image_tag(gallery_images.image_file.file.square.url, :alt => "#{gallery_images.title}")
-if input.show_title
.title=gallery_images.title
-if input.show_description
.desc=gallery_images.description
.clear
-if input.style == 4
.portlet.input

View File

@ -2,7 +2,7 @@
%h1=@realisation.title
=simple_format @realisation.description
.rea-gal
.rea-gal.gallery
-@realisation.realisation_images.each do |realisation_images|
=link_to image_tag(realisation_images.image_file.file.square.url, :alt => "#{realisation_images.title}"), realisation_images.image_file.file.large.url, :title => realisation_images.title
.clear

View File

@ -0,0 +1,6 @@
class AddShowTitleToGalleryContents < ActiveRecord::Migration
def change
add_column :gallery_contents, :show_title, :boolean
add_column :gallery_contents, :show_description, :boolean
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160216085123) do
ActiveRecord::Schema.define(version: 20160217161702) do
create_table "admins", force: :cascade do |t|
t.string "name", limit: 255
@ -223,12 +223,14 @@ ActiveRecord::Schema.define(version: 20160216085123) do
end
create_table "gallery_contents", force: :cascade do |t|
t.string "name", limit: 255
t.text "description", limit: 65535
t.integer "style", limit: 4
t.integer "nbr_img", limit: 4
t.string "name", limit: 255
t.text "description", limit: 65535
t.integer "style", limit: 4
t.integer "nbr_img", limit: 4
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "show_title", limit: 1
t.boolean "show_description", limit: 1
end
create_table "gallery_images", force: :cascade do |t|