Add venue_photos model and venue_photos admin controller in order to add more images to Venues and allow to delete it.
Show the additional photos in splash. Added fancybox gem for zoom when click on the additional photo. fix #777
This commit is contained in:
parent
2034c0f965
commit
7c0cd30dda
13 changed files with 85 additions and 7 deletions
|
|
@ -11,4 +11,15 @@
|
|||
- unless @venue.photo.blank?
|
||||
= image_tag @venue.photo(:thumb)
|
||||
= f.input :photo
|
||||
%label
|
||||
Additional photos
|
||||
- @venue.venue_photos.in_groups_of(4, false).each do |photo_group|
|
||||
.row
|
||||
- photo_group.each do |photo|
|
||||
.col-md-3
|
||||
= image_tag photo.photo(:thumb)
|
||||
= link_to "Delete", admin_conference_venue_photo_path(@conference.short_title, photo), method: :delete, class: 'btn btn-default', data: { confirm: 'really delete this photo ?' }
|
||||
%br
|
||||
= file_field_tag "venue_photos[]", type: :file, multiple: true
|
||||
%br
|
||||
= f.action :submit, as: :button, button_html: { class: 'btn btn-primary' }
|
||||
|
|
|
|||
|
|
@ -60,3 +60,8 @@
|
|||
- if @conference.venue.website
|
||||
%br
|
||||
=link_to @conference.venue.website, @conference.venue.website
|
||||
- @conference.venue.venue_photos.in_groups_of(4, false).each do |photo_group|
|
||||
.row
|
||||
- photo_group.each do |photo|
|
||||
.col-md-3
|
||||
= link_to image_tag(photo.photo(:thumb), class: 'img-rounded'), photo.photo(:large), class: 'fancybox'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue