Simplified the partial layout

Rather than wrap the body in a :body block, just make it the default, unnamed block, which keeps the markup more lightweight.
This commit is contained in:
Herve Saint-Amand 2017-01-13 22:43:23 +00:00
parent 75f96fcc9a
commit c94213847b
11 changed files with 92 additions and 112 deletions

View file

@ -25,7 +25,7 @@
<table style="background-color: #fff; color: #222; border: solid 1px #ccc; border-collapse: separate">
<tr>
<td style="text-align: left; padding: 15px 15px 5px 15px">
<%= yield :body %>
<%= yield %>
</td>
</tr>
</table>

View file

@ -1,29 +1,27 @@
<% content_for :body do %>
<p style="margin: 0">
<%= t'notifier.changeset_comment_notification.hi', :to_user => @to_user %>
</p>
<p style="margin: 0">
<%= t'notifier.changeset_comment_notification.hi', :to_user => @to_user %>
</p>
<p>
<% if @owner %>
<%= raw t "notifier.changeset_comment_notification.commented.your_changeset", :commenter => link_to_user(@commenter), :time => @time %>
<% else %>
<%= raw t "notifier.changeset_comment_notification.commented.commented_changeset", :commenter => link_to_user(@commenter), :time => @time, :changeset_author => @changeset_author %>
<% end %>
<% if @changeset_comment %>
<%= raw t "notifier.changeset_comment_notification.commented.partial_changeset_with_comment", :changeset_comment => content_tag("em", @changeset_comment) %>
<% else %>
<%= t "notifier.changeset_comment_notification.commented.partial_changeset_without_comment" %>
<% end %>
</p>
<p>
<% if @owner %>
<%= raw t "notifier.changeset_comment_notification.commented.your_changeset", :commenter => link_to_user(@commenter), :time => @time %>
<% else %>
<%= raw t "notifier.changeset_comment_notification.commented.commented_changeset", :commenter => link_to_user(@commenter), :time => @time, :changeset_author => @changeset_author %>
<% end %>
<% if @changeset_comment %>
<%= raw t "notifier.changeset_comment_notification.commented.partial_changeset_with_comment", :changeset_comment => content_tag("em", @changeset_comment) %>
<% else %>
<%= t "notifier.changeset_comment_notification.commented.partial_changeset_without_comment" %>
<% end %>
</p>
<%= render "notifier/user_message_table", :captured => capture { %>
<%= @comment.to_html %>
<% } %>
<%= render "notifier/user_message_table", :captured => capture { %>
<%= @comment.to_html %>
<% } %>
<p>
<%= raw t 'notifier.changeset_comment_notification.details', :url => content_tag("nobr", link_to(@changeset_url, @changeset_url)) %>
</p>
<% end %>
<p>
<%= raw t 'notifier.changeset_comment_notification.details', :url => content_tag("nobr", link_to(@changeset_url, @changeset_url)) %>
</p>
<% content_for :footer do %>
<p>

View file

@ -1,15 +1,13 @@
<% content_for :body do %>
<p style="margin: 0">
<%= t'notifier.diary_comment_notification.hi', :to_user => @to_user %>
</p>
<p>
<%= raw t'notifier.diary_comment_notification.header', :from_user => link_to_user(@from_user), :subject => content_tag("em", @title) %>
</p>
<p style="margin: 0">
<%= t'notifier.diary_comment_notification.hi', :to_user => @to_user %>
</p>
<p>
<%= raw t'notifier.diary_comment_notification.header', :from_user => link_to_user(@from_user), :subject => content_tag("em", @title) %>
</p>
<%= render "notifier/user_message_table", :captured => capture { %>
<%= @text.to_html %>
<% } %>
<% end %>
<%= render "notifier/user_message_table", :captured => capture { %>
<%= @text.to_html %>
<% } %>
<% content_for :footer do %>
<p><%= raw t'notifier.diary_comment_notification.footer',

View file

@ -1,9 +1,7 @@
<% content_for :body do %>
<p style="margin: 0"><%= t 'notifier.email_confirm_html.greeting' %></p>
<p style="margin: 0"><%= t 'notifier.email_confirm_html.greeting' %></p>
<p><%= t 'notifier.email_confirm_html.hopefully_you', :server_url => SERVER_URL, :new_address => @address %></p>
<p><%= t 'notifier.email_confirm_html.hopefully_you', :server_url => SERVER_URL, :new_address => @address %></p>
<p><%= t 'notifier.email_confirm_html.click_the_link' %></p>
<p><%= t 'notifier.email_confirm_html.click_the_link' %></p>
<p><a href="<%= @url %>" style="white-space: nowrap"><%= @url %></a></p>
<% end %>
<p><a href="<%= @url %>" style="white-space: nowrap"><%= @url %></a></p>

View file

@ -1,11 +1,9 @@
<% content_for :body do %>
<p style="margin: 0"><%= t 'notifier.friend_notification.had_added_you', :user => @friend.befriender.display_name %></p>
<p style="margin: 0"><%= t 'notifier.friend_notification.had_added_you', :user => @friend.befriender.display_name %></p>
<%= render "notifier/user_message_table", :captured => capture { %>
<p><%= raw t 'notifier.friend_notification.see_their_profile', :userurl => link_to(@viewurl, @viewurl) %></p>
<%= render "notifier/user_message_table", :captured => capture { %>
<p><%= raw t 'notifier.friend_notification.see_their_profile', :userurl => link_to(@viewurl, @viewurl) %></p>
<% unless @friend.befriendee.is_friends_with?(@friend.befriender) -%>
<p><%= raw t 'notifier.friend_notification.befriend_them', :befriendurl => link_to(@friendurl, @friendurl) %></p>
<% end -%>
<% } %>
<% end %>
<% unless @friend.befriendee.is_friends_with?(@friend.befriender) -%>
<p><%= raw t 'notifier.friend_notification.befriend_them', :befriendurl => link_to(@friendurl, @friendurl) %></p>
<% end -%>
<% } %>

View file

@ -1,18 +1,16 @@
<% content_for :body do %>
<p style="margin: 0"><%= t'notifier.gpx_notification.greeting' %></p>
<p style="margin: 0"><%= t'notifier.gpx_notification.greeting' %></p>
<p>
<%= render :partial => "gpx_description" %>
<%= t'notifier.gpx_notification.failure.failed_to_import' %>
</p>
<p>
<%= render :partial => "gpx_description" %>
<%= t'notifier.gpx_notification.failure.failed_to_import' %>
</p>
<blockquote>
<%= @error %>
</blockquote>
<blockquote>
<%= @error %>
</blockquote>
<p>
<%= t'notifier.gpx_notification.failure.more_info_1' %>
<%= t'notifier.gpx_notification.failure.more_info_2' %>
<%= t'notifier.gpx_notification.failure.import_failures_url' %>
</p>
<% end %>
<p>
<%= t'notifier.gpx_notification.failure.more_info_1' %>
<%= t'notifier.gpx_notification.failure.more_info_2' %>
<%= t'notifier.gpx_notification.failure.import_failures_url' %>
</p>

View file

@ -1,8 +1,6 @@
<% content_for :body do %>
<p style="margin: 0"><%= t'notifier.gpx_notification.greeting' %></p>
<p style="margin: 0"><%= t'notifier.gpx_notification.greeting' %></p>
<p>
<%= render :partial => "gpx_description" %>
<%= t'notifier.gpx_notification.success.loaded_successfully', :trace_points => @trace_points, :possible_points => @possible_points %>
</p>
<% end %>
<p>
<%= render :partial => "gpx_description" %>
<%= t'notifier.gpx_notification.success.loaded_successfully', :trace_points => @trace_points, :possible_points => @possible_points %>
</p>

View file

@ -1,9 +1,7 @@
<% content_for :body do %>
<p style="margin: 0"><%= t 'notifier.lost_password_html.greeting' %></p>
<p style="margin: 0"><%= t 'notifier.lost_password_html.greeting' %></p>
<p><%= t 'notifier.lost_password_html.hopefully_you' %></p>
<p><%= t 'notifier.lost_password_html.hopefully_you' %></p>
<p><%= t 'notifier.lost_password_html.click_the_link' %></p>
<p><%= t 'notifier.lost_password_html.click_the_link' %></p>
<p><a href="<%= @url %>"><%= @url %></a></p>
<% end %>
<p><a href="<%= @url %>"><%= @url %></a></p>

View file

@ -1,18 +1,16 @@
<% content_for :body do %>
<p style="margin: 0">
<%= t'notifier.message_notification.hi', :to_user => @to_user %>
</p>
<p>
<%= raw t'notifier.message_notification.header',
:from_user => link_to_user(@from_user),
:subject => content_tag("em", @title)
%>
</p>
<p style="margin: 0">
<%= t'notifier.message_notification.hi', :to_user => @to_user %>
</p>
<p>
<%= raw t'notifier.message_notification.header',
:from_user => link_to_user(@from_user),
:subject => content_tag("em", @title)
%>
</p>
<%= render "notifier/user_message_table", :captured => capture { %>
<%= @text.to_html %>
<% } %>
<% end %>
<%= render "notifier/user_message_table", :captured => capture { %>
<%= @text.to_html %>
<% } %>
<% content_for :footer do %>
<p>

View file

@ -1,15 +1,13 @@
<% content_for :body do %>
<p style="margin: 0"><%= t 'notifier.note_comment_notification.greeting' %></p>
<p style="margin: 0"><%= t 'notifier.note_comment_notification.greeting' %></p>
<% if @owner %>
<p><%= raw t "notifier.note_comment_notification.#{@event}.your_note", :commenter => link_to_user(@commenter), :place => @place %></p>
<% else %>
<p><%= raw t "notifier.note_comment_notification.#{@event}.commented_note", :commenter => link_to_user(@commenter), :place => @place %></p>
<% end %>
<%= render "notifier/user_message_table", :captured => capture { %>
<%= @comment.to_html %>
<% } %>
<p><%= raw t 'notifier.note_comment_notification.details', :url => link_to(@noteurl, @noteurl) %></p>
<% if @owner %>
<p><%= raw t "notifier.note_comment_notification.#{@event}.your_note", :commenter => link_to_user(@commenter), :place => @place %></p>
<% else %>
<p><%= raw t "notifier.note_comment_notification.#{@event}.commented_note", :commenter => link_to_user(@commenter), :place => @place %></p>
<% end %>
<%= render "notifier/user_message_table", :captured => capture { %>
<%= @comment.to_html %>
<% } %>
<p><%= raw t 'notifier.note_comment_notification.details', :url => link_to(@noteurl, @noteurl) %></p>

View file

@ -1,11 +1,9 @@
<% content_for :body do %>
<p style="margin: 0"><%= t("notifier.signup_confirm.greeting") %></p>
<p style="margin: 0"><%= t("notifier.signup_confirm.greeting") %></p>
<p><%= t("notifier.signup_confirm.created", :site_url => SERVER_URL) %></p>
<p><%= t("notifier.signup_confirm.created", :site_url => SERVER_URL) %></p>
<p><%= t("notifier.signup_confirm.confirm") %></p>
<p><%= t("notifier.signup_confirm.confirm") %></p>
<p><%= link_to @url, @url, :style => "white-space: nowrap" %></p>
<p><%= link_to @url, @url, :style => "white-space: nowrap" %></p>
<p><%= t("notifier.signup_confirm.welcome") %></p>
<% end %>
<p><%= t("notifier.signup_confirm.welcome") %></p>