   title: 'Artists' unless partner.get('profile_artists_layout') is 'Grid'
   viewAll: "#{partner.href()}/artists" unless partner.get('profile_artists_layout') is 'Grid'
 
-galleryTwoArticles = (partner, profile) ->
+
+#
+# Locations Section
+#
+locationsSection = (partner, profile) ->
+  name: 'locations'
+  title: 'Locations'
+  component: (
+    LocationsView unless partner.claimed()
+  )
+  options: partner: partner
+
+
+#
+# Articles Section
+#
+articlesSection = (partner, profile) ->
   name: 'articles'
   component: FixedCellsCountCarousel
   options:

    template: articlesTemplate
  title: 'Articles'
  viewAll: "#{partner.href()}/articles"

#
# Sections for gallery_three layout.
#
galleryThreeAbout = galleryTwoAbout
galleryThreeNews = galleryTwoNews
galleryThreeShows = galleryTwoShows
galleryThreeFairBooths = galleryTwoFairBooths
galleryThreeArtists = galleryTwoArtists
galleryThreeArticles = galleryTwoArticles
galleryThreeHero = (partner, profile) ->
  name: 'hero'
  component:
    switch partner.get('profile_banner_display')
      when 'Artworks' then HeroArtworksCarousel
      else HeroShowsCarousel
  options: (
    options =
      partner: partner
      maxNumberOfShows: 10
    switch partner.get('profile_banner_display')
      when 'Artworks' then _.pick options, 'partner'
      else _.pick options, 'partner', 'maxNumberOfShows'
  )

#
# Sections for gallery_four layout.
#
galleryFourHero = galleryThreeHero
galleryFourAbout = galleryTwoAbout
galleryFourNews = galleryTwoNews
galleryFourShows = galleryTwoShows
galleryFourFairBooths = galleryTwoFairBooths
galleryFourArtists = galleryTwoArtists
galleryFourArticles = galleryTwoArticles

#
# Sections for gallery_five layout.
#
galleryFiveHero = galleryThreeHero
galleryFiveAbout = galleryThreeAbout
galleryFiveNews = galleryThreeNews
galleryFiveShows = galleryThreeShows
galleryFiveFairBooths = galleryThreeFairBooths
galleryFiveArtists = galleryThreeArtists
galleryFiveArticles = galleryThreeArticles

#
# Sections for gallery_six layout.
#
gallerySixHero = galleryOneHero
gallerySixAbout = galleryOneAbout
gallerySixShows = galleryOneShows
gallerySixFairBooths = galleryOneFairBooths
gallerySixArtists = galleryOneArtists

#
# Sections for gallery_seven layout.
#
gallerySevenHero = galleryOneHero
gallerySevenAbout = galleryOneAbout
gallerySevenShows = galleryOneShows
gallerySevenFairBooths = galleryOneFairBooths
gallerySevenArtists = galleryOneArtists

module.exports = (partner, profile) ->
  contract =
    institution: [
      configurable2ShowsHero partner, profile
      aboutSection partner, profile
      newsSection partner, profile
      showsCarousel partner, profile
      fairBoothsSection partner, profile
      configurableArtists partner, profile
      articlesSection partner, profile
    ]
    gallery_default: [
      showsGrid partner, profile
      possiblyUnclaimedPartnerArtists partner, profile
      locationsSection partner, profile
    ]
    gallery_one: [
      oneShowOnlyHero partner, profile
      aboutSection partner, profile
      showsCarousel partner, profile
      fairBoothsSection partner, profile
      artistsGrid partner, profile
    ]
    gallery_two: [
      configurable2ShowsHero partner, profile
      aboutSection partner, profile
      newsSection partner, profile
      showsCarousel partner, profile
      fairBoothsSection partner, profile
      configurableArtists partner, profile
      articlesSection partner, profile
    ]
    gallery_three: [
      configurable10ShowsHero partner, profile
      aboutSection partner, profile
      newsSection partner, profile
      showsCarousel partner, profile
      fairBoothsSection partner, profile
      configurableArtists partner, profile
      articlesSection partner, profile
    ]
    gallery_four: [
      configurable10ShowsHero partner, profile
      aboutSection partner, profile
      newsSection partner, profile
      showsCarousel partner, profile
      fairBoothsSection partner, profile
      configurableArtists partner, profile
      articlesSection partner, profile
    ]
    gallery_five: [
      configurable10ShowsHero partner, profile
      aboutSection partner, profile
      newsSection partner, profile
      showsCarousel partner, profile
      fairBoothsSection partner, profile
      configurableArtists partner, profile
      articlesSection partner, profile
    ]
    gallery_six: [
      oneShowOnlyHero partner, profile
      aboutSection partner, profile
      showsCarousel partner, profile
      fairBoothsSection partner, profile
      artistsGrid partner, profile
    ]
    gallery_seven: [
      oneShowOnlyHero partner, profile
      aboutSection partner, profile
      showsCarousel partner, profile
      fairBoothsSection partner, profile
      artistsGrid partner, profile
    ]
    gallery_eight: [
      configurable10ShowsHero partner, profile
      aboutSection partner, profile
      newsSection partner, profile
      showsCarousel partner, profile
      fairBoothsSection partner, profile
      configurableArtists partner, profile
      articlesSection partner, profile
    ]

  contract[partner.get('profile_layout')] or []

#
# Hero Section
#
oneShowOnlyHero = (partner, profile) ->
  name: 'hero'
  component: HeroShowsCarousel
  options: partner: partner, maxNumberOfShows: 1

configurable2ShowsHero = (partner, profile) ->
  name: 'hero'
  component:
    switch partner.get('profile_banner_display')
