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 all 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
7 changes: 7 additions & 0 deletions app/assets/stylesheets/globals/exhibits.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,13 @@ a.exhibit-color:hover {
min-height: 3.1em;
}

div.gallery-thumbnail a {
span:hover {
color: #fff;
text-decoration: underline;
}
}

.exhibit-header {
background-size: cover;
background-image: url("https://s3.amazonaws.com/americanarchive.org/exhibits/assets/exhibits_red_bar.png");
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", new_tab: true)
@top_level_exhibits = Exhibit.all_top_level + [story_map_exhibit]
@page_title = 'Exhibits'
end

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

def full_path
"/exhibits/" + path
end

def new_tab
false
end

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

def initialize(title:, external_url:, thumbnail_url:, new_tab: false)
@title = title
@external_url = external_url
@thumbnail_url = thumbnail_url
@new_tab = new_tab
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 <%= ex.new_tab ? %(target=_blank) : "" %> 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 <%= ex.new_tab ? %(target=_blank) : "" %> href="<%= ex.full_path %>"><%= ex.title %></a>
</h2>
</div>

Expand Down
4 changes: 2 additions & 2 deletions app/views/home/_exhibits_carousel.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
render layout: 'home/carousel',
locals: {
id: 'exhibits-carousel',
items: Exhibit.all_top_level,
items: Exhibit.all_top_level + [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", new_tab: true)],
view_all: 'View All Exhibits',
view_all_href: '/exhibits'
} do |item| %>
<a href="<%= "/exhibits/#{item.path}" %>" class="list-group-item" >
<a <%= item.new_tab ? %(target=_blank) : "" %> href="<%= item.full_path %>" class="list-group-item" >
<img src="<%= item.thumbnail_url %>" title="<%= item.title %>" alt="<%= item.title %>" aria-hidden="true" />
<span class="carousel-caption">
<h3 class="list-group-item-heading"><%= item.title %></h3>
Expand Down