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
AO3-5763 AO3-5348 Add more info to gift notification email and internationalize it #4137
Changes from all commits
2781e4f
55277c6
bf72efb
89d0280
4ba98a9
90301b9
bd1bd21
11b0c3b
d76cfb3
870baa2
5a317ad
0a99542
c9c0eba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,4 +60,10 @@ def time_ago_in_words(from_time, include_seconds = false) | |
|
||
alias distance_of_time_in_words_to_now time_ago_in_words | ||
|
||
# Take some text and add whatever punctuation, symbols, and/or spacing | ||
# we use to separate a metadata property from its value, e.g., "Property: ", | ||
# "Propriété : ". | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/AsciiComments: Use only ascii symbols in comments. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Va te faire enculer, Hound. It's French. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duo serait très fier de toi :P There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah we don't have to do anything here. This check will eventually be phased out (rubocop/rubocop#9674). |
||
def metadata_property(text) | ||
text.html_safe + t("mailer.general.metadata_label_indicator") | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<% # expects work %> | ||
<p> | ||
<%= style_work_metadata_label(Work.human_attribute_name("chapter_total_display")) %><%= work.chapter_total_display %> | ||
<br><%= style_work_tag_metadata(work.fandoms) %> | ||
<br><%= style_work_tag_metadata(work.ratings) %> | ||
<br><%= style_work_tag_metadata(work.archive_warnings) %> | ||
<% unless work.relationship_string.blank? %> | ||
<br><%= style_work_tag_metadata(work.relationships) %> | ||
<% end %> | ||
<% unless work.character_string.blank? %> | ||
<br><%= style_work_tag_metadata(work.characters) %> | ||
<% end %> | ||
<% unless work.freeform_string.blank? %> | ||
<br><%= style_work_tag_metadata(work.freeforms) %> | ||
<% end %> | ||
<% unless work.series.count.zero? %> | ||
<br><%= style_work_metadata_label(Series.model_name.human(count: work.series.count)) %><%= series_list_for_feeds(work).html_safe %> | ||
<% end %> | ||
</p> | ||
|
||
<% unless work.summary.blank? %> | ||
<p><%= style_work_metadata_label(Work.human_attribute_name("summary")) %></p> | ||
<%= style_quote(raw sanitize_field(work, :summary)) %> | ||
<% end %> |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,22 @@ | ||||||
<% # expects work %> | ||||||
<%= work_metadata_label(Work.human_attribute_name("chapter_total_display"))%><%= work.chapter_total_display %> | ||||||
<%= work_tag_metadata(work.fandoms) %> | ||||||
<%= work_tag_metadata(work.ratings) %> | ||||||
<%= work_tag_metadata(work.archive_warnings) %> | ||||||
<% unless work.relationship_string.blank? %> | ||||||
<%= work_tag_metadata(work.relationships) %> | ||||||
<% end %> | ||||||
<% unless work.character_string.blank? %> | ||||||
<%= work_tag_metadata(work.characters) %> | ||||||
<% end %> | ||||||
<% unless work.freeform_string.blank? %> | ||||||
<%= work_tag_metadata(work.freeforms) %> | ||||||
<% end %> | ||||||
<% unless work.series.count.zero? %> | ||||||
<%= Series.model_name.human(count: work.series.count) %><%= raw to_plain_text(series_list_for_feeds(work)) %> | ||||||
<% end %> | ||||||
<% unless work.summary.blank? %> | ||||||
|
||||||
<%= work_metadata_label(Work.human_attribute_name("summary")) %> | ||||||
<%= raw to_plain_text(sanitize_field(work, :summary)) %> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be indented 2 spaces? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope, I wanted to match the indenting from the subscription emails (I assume we went with four spaces because it's more obviously done for a pretty formatting effect than two -- two just looks kinda like we misaligned the text):
|
||||||
<% end %> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,23 +7,13 @@ | |
</p> | ||
|
||
<p> | ||
<% if @collection.nil? %> | ||
<%= style_creation_link(@work.title, work_url(@work)) %> <%= "(#{@work.word_count} words)" %> | ||
<% else %> | ||
<%= style_creation_link(@work.title, collection_work_url(@collection, @work)) %> <%= "(#{@work.word_count} words)" %> | ||
<% end %> | ||
<% url = @collection ? collection_work_url(@collection, @work) : work_url(@work) %> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (The work title/byline is separate from the other metadata because subscription emails display this info differently.) |
||
<%= style_creation_link(@work.title, url) %> <%= "(#{@work.word_count} words)" %> | ||
<br> | ||
by <%= @work.anonymous? ? "an anonymous responder" : (@work.pseuds.map{|p| style_pseud_link(p)}.to_sentence.html_safe) %> | ||
<br> | ||
<% unless @work.fandom_string.blank? %> | ||
<%= style_bold("Fandom:") %> <%= @work.fandom_string %> | ||
<% end %> | ||
by <%= creator_links(@work) %> | ||
</p> | ||
|
||
<% unless @work.summary.blank? %> | ||
<%= style_bold("Summary:") %> | ||
<%= style_quote(raw sanitize_field(@work, :summary)) %> | ||
<% end %> | ||
<%= render "work_info", work: @work %> | ||
|
||
<% if @collection && !@collection.gift_notification.blank? %> | ||
<p><%= @collection.gift_notification %></p> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used directly in a view? If so, we should make it private and keep the list of available helpers shorter.
Then we can have specs just for the public ones as well.