Move sponsor modal to a generic partial & redesign.

... use for booths also.
This commit is contained in:
James Mason 2017-11-26 20:37:02 -08:00
parent b2e1eb5fa9
commit 20e2b4b76b
5 changed files with 58 additions and 52 deletions

View file

@ -6,21 +6,15 @@
%h2 Booths
.row.row-centered
- @conference.confirmed_booths.each do |booth|
.col-md-4.col-sm-4.col-centered.col-top
.thumbnail.text-center
.col-md-2.col-sm-2.col-centered.col-top
%a.thumbnail{ href: '#',
data: { toggle: 'modal', target: "#modal-booth-#{booth.id}" } }
- if booth.picture?
= link_to booth.website_url,
class: 'thumbnail', target: '_blank' do
= image_tag booth.picture.large.url, alt: booth.title,
class: 'img-rounded'
.caption
%h3.text-center
- if booth.logo_link
= link_to booth.title, booth.website_url, target: '_blank'
-else
= booth.title
= link_to '', "#booth-detail-#{booth.id}",
data: {toggle: 'collapse'}, class: 'caret',
title: 'more info'
.collapse{ id: "booth-detail-#{booth.id}" }
= markdown(booth.description)
= image_tag get_logo(booth),
class: ['img-responsive', 'img-rounded'],
title: booth.title
- else
.caption
%h3.text-center= booth.title
- content_for :modals do
= render 'modal_description', object: booth

View file

@ -0,0 +1,21 @@
- content_for :modals do
.modal.fade{ id: "modal-#{object.class.name.downcase}-#{object.id}" }
.modal-dialog
.modal-content
.modal-header
%button.close{ data: { dismiss: 'modal' } }
%i.fa.fa-close
%h3.modal-title
= object.try(:title) || object.try(:name)
.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}"]
= image_tag get_logo(object), class: img_classes
%p.description
= object.description
.modal-footer
= link_to nil, object.website_url, target: '_blank'

View file

@ -6,34 +6,24 @@
@conference.try(:call_for_sponsors), '#splash#sponsors'] do
%section#sponsors
.container
.row
.col-md-12.text-center
%h2 Sponsors
- @conference.sponsorship_levels.each do |sponsorship_level|
-if sponsorship_level.sponsors.any?
- sponsorship_level.sponsors.each_slice(3) do |slice|
.row.row-centered
- slice.each do |sponsor|
.col-md-4.col-sm-4.col-centered.col-top
%a{ href: '#', data: { toggle: 'modal', target: "#modal_#{sponsor.id}" } }
= image_tag get_logo(sponsor), class: "img-responsive img-sponsor img-sponsor-#{sponsorship_level.position}"
.row.text-center
%h3
= sponsorship_level.title
= 'Sponsor'.pluralize(sponsorship_level.sponsors.length)
.row.row-centered
- sponsorship_level.sponsors.each do |sponsor|
.col-md-4.col-sm-4.col-centered.col-top
%a{ href: '#',
data: { toggle: 'modal', target: "#modal-sponsor-#{sponsor.id}" } }
= image_tag get_logo(sponsor),
class: ['img-responsive', 'img-sponsor',
"img-sponsor-#{sponsorship_level.position}"],
title: sponsor.name
- content_for :modals do
= render 'modal_description', object: sponsor
.modal.fade{ id: "modal_#{sponsor.id}" }
.modal-dialog
.modal-content
.modal-header
%button.close{ data: { dismiss: 'modal' } }
x
.modal-title
= sponsor.name
.modal-body.text-center
.logo
= link_to sponsor.website_url, target: '_blank' do
= image_tag get_logo(sponsor), class: "img-responsive img-sponsor img-sponsor-#{sponsorship_level.position}"
.description
= sponsor.description
.modal-footer
= link_to nil, "#{sponsor.website_url}", target: '_blank'
- if @conference.call_for_sponsors.try(:open?)
.row
.col-md-12

View file

@ -13,13 +13,12 @@
.row.row-centered
- @conference.tickets.each do |ticket|
.col-md-3.col-sm-3.col-centered.col-top
%h3.text-center
= ticket.title
%h3.text-center
%i.fa.fa-ticket.fa-3x
= markdown(ticket.description)
%p.text-center
= link_to conference_tickets_path(@conference.short_title),
class: 'btn btn-success' do
Get Ticket
= humanized_money_with_symbol ticket.price
= link_to(conference_tickets_path(@conference.short_title),
class: 'thumbnail') do
.caption
%h3.text-center
= ticket.title
= markdown(ticket.description)
%button.btn-block.btn.btn-lg.btn-success
%i.fa.fa-ticket.fa-fw
= humanized_money_with_symbol(ticket.price)

View file

@ -41,6 +41,8 @@
= render 'social_media'
= render 'footer'
= yield :modals
- cache [@conference.color, '#splash#inlinejs'] do
- content_for :script_head do
:javascript