Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2445 Exhibit as external link #2449

Merged
merged 7 commits into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ AllCops:
- 'app/models/exhibit.rb'
- 'app/helpers/snippet_helper.rb'
- 'app/controllers/snippets_controller.rb'
- 'app/models/link_exhibit.rb'

Metrics/ClassLength:
Enabled: false
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/exhibits_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

class ExhibitsController < OverrideController
def index
@top_level_exhibits = Exhibit.all_top_level
story_map_exhibit = LinkExhibit.new(title: "Witnessing New Mexico: The New Mexico Public Media Digitization Project", external_url: "https://storymaps.arcgis.com/stories/39eecf9cbc484f36802799c4046ebd61", thumbnail_url: "https://s3.amazonaws.com/americanarchive.org/exhibits/nm_storymap_cover.png")
@top_level_exhibits = Exhibit.all_top_level + [story_map_exhibit]
@page_title = 'Exhibits'
end

Expand Down
4 changes: 4 additions & 0 deletions app/models/exhibit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ def config
end
end

def full_path
"/exhibits/" + path
end

def meta_tags
%(
<meta property="og:title" content="#{config[:preview][:title]} | American Archive of Public Broadcasting" />
Expand Down
15 changes: 15 additions & 0 deletions app/models/link_exhibit.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class LinkExhibit
attr_reader :title
attr_reader :thumbnail_url
attr_reader :external_url

def initialize(title:, external_url:, thumbnail_url:)
@title = title
@external_url = external_url
@thumbnail_url = thumbnail_url
end

def full_path
@external_url
end
end
6 changes: 3 additions & 3 deletions app/views/exhibits/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<% content_for :main do %>
<div class="row">
<div class="col-md-12 gallery-intro">
<p>American Archive of Public Broadcasting staff and guest curators create exhibits of selected recordings that focus on themes, topics, and events of cultural and historical significance. In the exhibits, curators contextualize digitized primary and secondary source public television and radio materials. Each curated set of selected recordings present a diversity of perspectives concerning the exhibit's focus. As a result, AAPB exhibits often illuminate how public broadcasting stations and producers have covered the exhibit's theme.</p>
<p>American Archive of Public Broadcasting staff and guest curators create exhibits of selected recordings that focus on themes, topics, and events of cultural and historical significance. In the exhibits, curators contextualize digitized primary and secondary source public television and radio materials. Each curated set of selected recordings present a diversity of perspectives concerning the exhibit's focus. As a result, AAPB exhibits often illuminate how public broadcasting stations and producers have covered the exhibit's theme.</p>
</div>
</div>
<div class="row gallery-index" id="documents">
<% @top_level_exhibits.each do |ex| %>
<div class="gallery col-xs-12 col-sm-6 col-md-4">
<div class="gallery-thumbnail">
<a href="/exhibits/<%= ex.path %>">
<a href="<%= ex.full_path %>">
<img src="<%= ex.thumbnail_url %>" alt="<%= ex.title %>" aria-hidden="true">
<div class="exhibit-index-title-container">
<h2 class="exhibit-index-title bg-color-<%= ['purple','pink','red'].sample %>">
<a href="/exhibits/<%= ex.path %>"><%= ex.title %></a>
<a href="<%= ex.full_path %>"><%= ex.title %></a>
</h2>
</div>

Expand Down