Move splashpage logdgings descriptions to a modal
This commit is contained in:
parent
c29cb144bf
commit
22e16ba775
2 changed files with 27 additions and 29 deletions
|
|
@ -18,24 +18,19 @@
|
|||
.row.row-centered
|
||||
- lodgings.each do |lodging|
|
||||
.col-md-4.col-sm-4.col-centered.col-top
|
||||
.thumbnail
|
||||
- if lodging.picture?
|
||||
- if lodging.website_link.present?
|
||||
= link_to(lodging.website_link, class: 'thumbnail') do
|
||||
= image_tag lodging.picture.large.url,
|
||||
class: 'img-responsive img-lodging'
|
||||
- else
|
||||
%a{ href: '#', data: { toggle: 'modal',
|
||||
target: "#modal-lodging-#{lodging.id}" } }
|
||||
.thumbnail
|
||||
- if lodging.picture?
|
||||
= image_tag lodging.picture.large.url,
|
||||
class: 'img-responsive img-lodging'
|
||||
- else
|
||||
%p.text-center
|
||||
- if lodging.website_link.present?
|
||||
= link_to(lodging.website_link, class: 'thumbnail') do
|
||||
%i.fa.fa-home.fa-5x
|
||||
- else
|
||||
- else
|
||||
%p.text-center
|
||||
%i.fa.fa-home.fa-5x
|
||||
.caption
|
||||
%h3.text-center
|
||||
= lodging.name
|
||||
- if lodging.description.present?
|
||||
= markdown(lodging.description)
|
||||
.caption
|
||||
%h3.text-center
|
||||
= lodging.name
|
||||
|
||||
- lodgings.each do |lodging|
|
||||
- content_for :modals do
|
||||
= render 'modal_description', object: lodging
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
- content_for :modals do
|
||||
- cache [object, '#modal'] do
|
||||
:ruby
|
||||
title = object.try(:title) || object.try(:name)
|
||||
link = object.try(:website_url) || object.try(:website_link)
|
||||
.modal.fade{ id: "modal-#{object.class.name.downcase}-#{object.id}" }
|
||||
.modal-dialog
|
||||
.modal-content
|
||||
|
|
@ -7,17 +10,17 @@
|
|||
%button.close{ data: { dismiss: 'modal' } }
|
||||
%i.fa.fa-close
|
||||
%h3.modal-title
|
||||
= object.try(:title) || object.try(:name)
|
||||
= title
|
||||
.modal-body
|
||||
%p.logo
|
||||
= link_to object.website_url || '#', target: '_blank' do
|
||||
- img_classes = ['img-responsive center-block']
|
||||
- if object.is_a? Sponsor
|
||||
- img_classes << ['img-sponsor',
|
||||
"img-sponsor-#{object.sponsorship_level.position}"]
|
||||
- if object.picture?
|
||||
= image_tag get_logo(object), class: img_classes
|
||||
- img_classes = ['img-responsive center-block']
|
||||
- if object.is_a? Sponsor
|
||||
- img_classes << ['img-sponsor',
|
||||
"img-sponsor-#{object.sponsorship_level.position}"]
|
||||
- if object.picture?
|
||||
= image_tag get_logo(object), class: img_classes
|
||||
%p.description
|
||||
= object.description
|
||||
.modal-footer
|
||||
= link_to nil, object.website_url, target: '_blank'
|
||||
= markdown(object.description)
|
||||
- if link
|
||||
.modal-footer
|
||||
= link_to nil, link, target: '_blank'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue