diff --git a/app/assets/javascripts/popover.coffee b/app/assets/javascripts/popover.coffee index ae503f4..067e6ed 100644 --- a/app/assets/javascripts/popover.coffee +++ b/app/assets/javascripts/popover.coffee @@ -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" diff --git a/app/assets/stylesheets/popover.scss b/app/assets/stylesheets/popover.scss index 89390f2..50dfebe 100644 --- a/app/assets/stylesheets/popover.scss +++ b/app/assets/stylesheets/popover.scss @@ -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%; +} \ No newline at end of file diff --git a/app/views/portlet/gallery_contents/_form.html.haml b/app/views/portlet/gallery_contents/_form.html.haml index 149cd36..86dd4b9 100644 --- a/app/views/portlet/gallery_contents/_form.html.haml +++ b/app/views/portlet/gallery_contents/_form.html.haml @@ -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 ?" diff --git a/app/views/portlets/render_public/_gallerycontent.html.haml b/app/views/portlets/render_public/_gallerycontent.html.haml index d51e549..b27b01e 100644 --- a/app/views/portlets/render_public/_gallerycontent.html.haml +++ b/app/views/portlets/render_public/_gallerycontent.html.haml @@ -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 diff --git a/app/views/public/realisations/show.html.haml b/app/views/public/realisations/show.html.haml index 0a6c5dd..b448e73 100644 --- a/app/views/public/realisations/show.html.haml +++ b/app/views/public/realisations/show.html.haml @@ -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 diff --git a/db/migrate/20160217161702_add_show_title_to_gallery_contents.rb b/db/migrate/20160217161702_add_show_title_to_gallery_contents.rb new file mode 100644 index 0000000..97162fc --- /dev/null +++ b/db/migrate/20160217161702_add_show_title_to_gallery_contents.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 0d54632..a8c9884 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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|