Skip to content

Commit

Permalink
Merge pull request #378 from cs169/187391225_Add_committees_info
Browse files Browse the repository at this point in the history
187391225 add committees info
  • Loading branch information
cycomachead authored Aug 1, 2024
2 parents 9b25dc9 + 69832b3 commit 39fff29
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/admin/splashpages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def splashpage_params
:include_venue, :include_registrations,
:include_tickets, :include_lodgings,
:include_sponsors, :include_social_media,
:include_booths, :include_happening_now)
:include_booths, :include_happening_now,
:include_committee)
end
end
end
5 changes: 5 additions & 0 deletions app/controllers/conferences_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def index
end

# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
def show
# load conference with header content
@conference = Conference.unscoped.eager_load(
Expand Down Expand Up @@ -65,8 +66,12 @@ def show
).order('sponsorship_levels.position ASC', 'sponsors.name')
@sponsors = @conference.sponsors
end
if @splashpage.include_committee?
@organizers = User.with_role(:organizer, @conference)
end
end
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity

def calendar
respond_to do |format|
Expand Down
1 change: 1 addition & 0 deletions app/models/splashpage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# banner_photo_updated_at :datetime
# include_booths :boolean
# include_cfp :boolean default(FALSE)
# include_committee :boolean
# include_happening_now :boolean
# include_lodgings :boolean
# include_program :boolean
Expand Down
4 changes: 4 additions & 0 deletions app/views/admin/splashpages/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
%label
= f.check_box :include_social_media
Display the social media links?
.checkbox
%label
= f.check_box :include_committee
Display the committee?
%h4
Access
%hr
Expand Down
18 changes: 18 additions & 0 deletions app/views/conferences/_committee.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-# _committee.haml
.row
.col-md-12
%h3.text-center
Committee
.row
.col-sd-6
.row.row-centered
- organizers.shuffle.each do |organizer|
.col-sd-3.col-sm-1.col-xs-3.col-centered
= link_to user_path(organizer), class: 'thumbnail',
style: 'border: none; background: none; padding: 20px;' do
- if organizer.profile_picture.present?
= image_tag organizer.profile_picture(size: 150),
class: ['img-responsive', 'img-circle'],
title: organizer.name
.caption
%h4.text-center= organizer.name
4 changes: 4 additions & 0 deletions app/views/conferences/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@
sponsorship_levels: @sponsorship_levels,
sponsors: @sponsors
-# committee
- if @conference.splashpage.include_committee?
= render 'committee', organizers: @organizers
-# footer
- if @conference.splashpage.include_social_media? && @conference.contact.has_social_media?
= render 'social_media', contact: @conference.contact, cached: true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddIncludeCommitteeToSplashpage < ActiveRecord::Migration[7.0]
def change
add_column :splashpages, :include_committee, :boolean
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class SetCurrencyForNullTicketPurchaseCurrency < ActiveRecord::Migration[7.0]
def up
TicketPurchase.where(currency: nil).update_all(currency: 'USD')
end
end
1 change: 1 addition & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@
t.boolean "include_booths"
t.boolean "shuffle_highlights", default: false, null: false
t.boolean "include_happening_now"
t.boolean "include_committee"
end

create_table "sponsors", force: :cascade do |t|
Expand Down
1 change: 1 addition & 0 deletions spec/factories/splashpages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# banner_photo_updated_at :datetime
# include_booths :boolean
# include_cfp :boolean default(FALSE)
# include_committee :boolean
# include_happening_now :boolean
# include_lodgings :boolean
# include_program :boolean
Expand Down

0 comments on commit 39fff29

Please sign in to comment.