Skip to content

Commit

Permalink
Taking into account no series
Browse files Browse the repository at this point in the history
  • Loading branch information
scottsds committed Aug 26, 2012
1 parent c813efe commit dca069e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 1 addition & 2 deletions app/helpers/series_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ def series_list_for_feeds(work)
else
list = []
for s in series
list << "Part #{s.serial_works.where(:work_id => work.id).select(:position).first.position} of
#{link_to(s.title, s)}"
list << "Part #{s.serial_works.where(:work_id => work.id).select(:position).first.position} of #{link_to(s.title, s)}"
end
return list.join(', ')
end
Expand Down
10 changes: 8 additions & 2 deletions app/helpers/works_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,17 @@ def get_embed_link(work)
warning_text = add_label_for_embed(ts("Warning: "), work.warnings.map {|warning| warning_display_name(warning.name)}.join(', '))
relationship_text = add_label_for_embed(ts("Relationships: "), work.relationships.map {|rel| rel.name}.join(', '))
char_text = add_label_for_embed(ts("Characters: "), work.characters.map {|char| char.name}.join(', '))
series_text = add_label_for_embed(ts("Series: "), series_list_for_feeds(work))
if work.series.count != 0
series_text = add_label_for_embed(ts("Series: "), series_list_for_feeds(work))
end
summary_text = add_label_for_embed(ts("Summary: "), sanitize_field(work, :summary))

# we deliberately don't html_safe this because we want it escaped
[title_link + ts(" by ") + profile_link, chapters_text, fandom_text, rating_text, warning_text, relationship_text, char_text, series_text, summary_text].compact.join("\n")
if work.series.count != 0
[title_link + ts(" by ") + profile_link, chapters_text, fandom_text, rating_text, warning_text, relationship_text, char_text, series_text, summary_text].compact.join("\n")
else
[title_link + ts(" by ") + profile_link, chapters_text, fandom_text, rating_text, warning_text, relationship_text, char_text, summary_text].compact.join("\n")
end
end

# convert a bookmark into a nicely formatted chunk of text
Expand Down

0 comments on commit dca069e

Please sign in to comment.