commit
0c1ed4408f
8 changed files with 77 additions and 2 deletions
|
|
@ -144,3 +144,24 @@ a:after {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#gallery{
|
||||||
|
min-height: 600px;
|
||||||
|
.item{
|
||||||
|
img {
|
||||||
|
height: 600px;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center center;
|
||||||
|
width: 100%;
|
||||||
|
background-size: cover;
|
||||||
|
-webkit-background-size:cover;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.modal-body{
|
||||||
|
i{
|
||||||
|
margin-top: 35%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#carousel-example-generic{
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,9 @@ class ConferenceController < ApplicationController
|
||||||
@conference = Conference.find_by_short_title(params[:id])
|
@conference = Conference.find_by_short_title(params[:id])
|
||||||
not_found unless @conference.make_conference_public?
|
not_found unless @conference.make_conference_public?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def gallery_photos
|
||||||
|
@photos = Conference.find_by_short_title(params[:id]).photos
|
||||||
|
render "photos", formats: [:js]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ class Photo < ActiveRecord::Base
|
||||||
belongs_to :conference
|
belongs_to :conference
|
||||||
validates_presence_of :picture
|
validates_presence_of :picture
|
||||||
has_attached_file :picture,
|
has_attached_file :picture,
|
||||||
styles: { thumb: '100x100>', large: '300x300>' }
|
styles: { thumb: "100x100>", large: "300x300>", banner: "600x300>" }
|
||||||
|
|
||||||
validates_attachment_content_type :picture,
|
validates_attachment_content_type :picture,
|
||||||
content_type: [/jpg/, /jpeg/, /png/, /gif/],
|
content_type: [/jpg/, /jpeg/, /png/, /gif/],
|
||||||
|
|
|
||||||
35
app/views/conference/_gallery.html.haml
Normal file
35
app/views/conference/_gallery.html.haml
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
<!-- Modal -->
|
||||||
|
%div{ class: "modal fade", id: "gallery", tabindex: "-1", role: "dialog", "aria-labelledby" => "myLargeModalLabel", "aria-hidden"=> "true" }
|
||||||
|
%div{ class: "modal-dialog modal-lg" }
|
||||||
|
%div{ class: "modal-content" }
|
||||||
|
%div{ class: "modal-body" }
|
||||||
|
%div{ id: "carousel-example-generic", class: "carousel slide", "data-ride" => "carousel" }
|
||||||
|
<!-- Wrapper for slides -->
|
||||||
|
%div{ class: "carousel-inner" }
|
||||||
|
|
||||||
|
<!-- Controls -->
|
||||||
|
%a{ class: "left carousel-control", href: "#carousel-example-generic", role: "button", "data-slide" => "prev" }
|
||||||
|
%span{ class: "glyphicon glyphicon-chevron-left" }
|
||||||
|
%a{ class: "right carousel-control", href: "#carousel-example-generic", role: "button", "data-slide" => "next" }
|
||||||
|
%span{ class: "glyphicon glyphicon-chevron-right" }
|
||||||
|
|
||||||
|
|
||||||
|
:javascript
|
||||||
|
$(document).ready(function(){
|
||||||
|
var count = 0;
|
||||||
|
$('#gallery-btn').click(function(){
|
||||||
|
if(count == 0){
|
||||||
|
$('#gallery').modal('show');
|
||||||
|
$('#gallery .modal-body').append('<i class="fa fa-spinner fa-spin fa-4x"></i>');
|
||||||
|
count +=1;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#gallery').modal('show');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
7
app/views/conference/_gallery_photo.html.haml
Normal file
7
app/views/conference/_gallery_photo.html.haml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
- photos.each_with_index do |photo,index|
|
||||||
|
%div.item{ class: (index==0? 'active' : '') }
|
||||||
|
= image_tag(photo.picture(:banner))
|
||||||
|
- unless photo.description.blank?
|
||||||
|
%div.carousel-caption
|
||||||
|
%p.lead
|
||||||
|
= photo.description
|
||||||
4
app/views/conference/photos.js.haml
Normal file
4
app/views/conference/photos.js.haml
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
$('#gallery .carousel-inner').append("#{escape_javascript(render('gallery_photo', photos: @photos)) }");
|
||||||
|
$('#gallery .modal-body').children('.fa').remove();
|
||||||
|
$('#gallery #carousel-example-generic').css('visibility','visible');
|
||||||
|
|
||||||
|
|
@ -17,7 +17,9 @@
|
||||||
.row-fluid
|
.row-fluid
|
||||||
.col-md-12.lead
|
.col-md-12.lead
|
||||||
%p= @conference.description
|
%p= @conference.description
|
||||||
|
-unless @conference.photos.blank?
|
||||||
|
= link_to 'Gallery', gallery_photos_conference_path(@conference.short_title), class: 'btn btn-primary btn-lg', id: 'gallery-btn', remote: true
|
||||||
|
= render 'gallery'
|
||||||
- if @conference.include_program_in_splash?
|
- if @conference.include_program_in_splash?
|
||||||
%section{ id: 'program' }
|
%section{ id: 'program' }
|
||||||
.pad
|
.pad
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@ Osem::Application.routes.draw do
|
||||||
get "/register" => "conference_registration#register"
|
get "/register" => "conference_registration#register"
|
||||||
patch "/register" => "conference_registration#update"
|
patch "/register" => "conference_registration#update"
|
||||||
delete "/register" => "conference_registration#unregister"
|
delete "/register" => "conference_registration#unregister"
|
||||||
|
get "gallery_photos"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue