Skip to content

Commit

Permalink
Display license on album page
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislo committed Feb 7, 2025
1 parent 7811b39 commit 5f7a3f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions app/views/albums/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,25 @@
</section>
<% end %>

<% if @album.released_on %>
<section class="mb-6">
<p>released <%= @album.released_on.strftime('%B %-d, %Y') %></p>
</section>
<% end %>

<% if @album.credits %>
<section>
<%= format_metadata(@album.credits) %>
</section>
<% end %>
</div>

<section class="mt-6">
<% if @album.released_on %>
<p><strong>Released:</strong> <%= @album.released_on.strftime('%B %-d, %Y') %></p>
<% end %>

<% if @album.license.source %>
<p><strong>License:</strong> <%= link_to @album.license.label, @album.license.source, class: 'underline' %></p>
<% else %>
<p><strong>License:</strong> <%= @album.license.label %></p>
<% end %>
</section>

<% content_for :admin do %>
<div>
<h2 class="text-2xl my-3">Transcodes</h2>
Expand Down
2 changes: 1 addition & 1 deletion test/controllers/albums_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def setup

get artist_album_url(@album.artist, @album)

assert_select 'p', 'released June 20, 2023'
assert_select 'p', 'Released: June 20, 2023'
end

test '#new' do
Expand Down

0 comments on commit 5f7a3f6

Please sign in to comment.