Skip to content

Commit

Permalink
added advertisement to the recording
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlagace committed Jul 11, 2016
1 parent bcd5ec3 commit 36271fc
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 159 deletions.
4 changes: 0 additions & 4 deletions app/models/artist.rb
Expand Up @@ -167,10 +167,6 @@ def add_supplementary_section
current_query
}

def grouped_work_wiki_links
GroupedWikiLink.new(ArtistWorkWikiLink, self.work_wiki_links).groups
end

def normalized_name
self.name.to_s.
mb_chars.
Expand Down
66 changes: 0 additions & 66 deletions app/models/grouped_wiki_link.rb

This file was deleted.

1 change: 0 additions & 1 deletion app/views/artists/show.haml
Expand Up @@ -36,7 +36,6 @@
%th= Work.human_attribute_name("date_written")
%th= WorkWikiLink.human_attribute_name("role")
%tbody
-# @artist.grouped_work_wiki_links.sort{|a,b| ((a.date_written <=> b.date_written) || 1) }.each do |wwl|
- @artist.work_wiki_links.sort_by{|a| [a.date_written, a.title]}.each do |wwl|

%tr
Expand Down
79 changes: 0 additions & 79 deletions app/views/recordings/_info.haml

This file was deleted.

94 changes: 91 additions & 3 deletions app/views/recordings/show.haml
@@ -1,8 +1,96 @@
= title(@recording.title)

.row
= render partial: 'links'
.span12
= render partial: 'info'
= render partial: 'links'
.row
.span9
.section.summary
%p
= Recording.human_attribute_name("work_wiki_link")
\: #{work_wiki_link_path(@recording.work_wiki_link)}
%p
- unless @recording.recording_date.blank?
= Recording.human_attribute_name("recording_date")
\: #{@recording.recording_date}
%p
- unless @recording.recording_location.blank?
= Recording.human_attribute_name("recording_location")
\: #{@recording.recording_location}
%p
- unless @recording.category_wiki_links.first.blank?
= Recording.human_attribute_name("category")
\:
#{@recording.category_wiki_links.collect{|v| v.category_name}.join(', ').html_safe}
%p
- unless @recording.duration.to_s.blank?
= Recording.human_attribute_name("duration")
\: #{@recording.duration}
%p
- unless @recording.bpm.blank?
= Recording.human_attribute_name("bpm")
\: #{@recording.bpm}bpm

%h2 #{t('credits')}
- if @recording.artist_wiki_links == 0
%p #{t('messages.recording_without_artist')}.
- else
%table.table.table-striped
%thead
%tr
%th= Artist.model_name.human.pluralize
%th= Artist.human_attribute_name :role
%tbody
- @recording.artist_wiki_links.each do |awl|
%tr
%td= artist_wiki_link_path(awl)
%td= awl.role

%h2= Release.model_name.human.pluralize
- if @recording.release_wiki_links.length == 0
%p #{t('messages.recording_without_release')}.
- else
.right-size
%table.table.table-striped
%thead
%tr
%th= Release.human_attribute_name("title")
%th= Release.human_attribute_name("date_released")
%th= Release.human_attribute_name("label")
%th= Release.human_attribute_name("media_type")
%th= Recording.human_attribute_name("itemId")
%th= Recording.human_attribute_name("itemSection")
%th= Recording.human_attribute_name("trackNb")
%th= Release.human_attribute_name("reference_code")
%tbody
- @recording.release_wiki_links.sort{|a,b| ((a.date_released <=> b.date_released) || 1)}.each do |awl|
%tr
%td= release_wiki_link_path(awl)
%td= awl.date_released
%td= awl.label
%td= awl.media_type
- unless awl.itemId.blank?
%td= awl.itemId
- else
%td= "1"
%td= awl.itemSection
%td= awl.trackNb
%td= awl.reference_code

- @recording.supplementary_sections.each do |ss|
%h2= ss.title
= RedCloth.new(ss.content).to_html.html_safe

- unless @recording.new_record?
.well
= content_tag(:small, updated_at(@recording))

- if @recording.supplementary_sections.size > 0
= link_to t('report_content'), report_recording_path(@recording)
= link_to t('report_content'), report_recording_path(@recording)

.span3
= render partial: "common/adsense_side"

.row
.span12
= link_to t('report_content'), report_recording_path(@recording)

0 comments on commit 36271fc

Please sign in to comment.