]> git.openstreetmap.org Git - rails.git/commitdiff
Simplified the partial layout
authorHerve Saint-Amand <git@saintamh.org>
Fri, 13 Jan 2017 22:43:23 +0000 (22:43 +0000)
committerHerve Saint-Amand <git@saintamh.org>
Fri, 13 Jan 2017 22:43:23 +0000 (22:43 +0000)
Rather than wrap the body in a :body block, just make it the default, unnamed block, which keeps the markup more lightweight.

app/views/layouts/notifier.html.erb
app/views/notifier/changeset_comment_notification.html.erb
app/views/notifier/diary_comment_notification.html.erb
app/views/notifier/email_confirm.html.erb
app/views/notifier/friend_notification.html.erb
app/views/notifier/gpx_failure.html.erb
app/views/notifier/gpx_success.html.erb
app/views/notifier/lost_password.html.erb
app/views/notifier/message_notification.html.erb
app/views/notifier/note_comment_notification.html.erb
app/views/notifier/signup_confirm.html.erb

index fb001d7c15ac9e32e83aef1874f8a8cb5c0b21c1..3b8ce6657b43ef6a806b7a52f5652d3f3783ee9d 100644 (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">
                 <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>
                     </td>
                   </tr>
                 </table>
index 0ebacf40e3833cf2454e42e412740c88fd422952..0d97b402a5e4f9403cde3c4bbf18d5d3dcfcff6c 100644 (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>
 
 <% content_for :footer do %>
   <p>
index ea9a655910173e969121d5ac3c1061076cb89c2d..e37f682a33287ea5bf837a4871a70f3837b4673b 100644 (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',
 
 <% content_for :footer do %>
   <p><%= raw t'notifier.diary_comment_notification.footer',
index 5c639d57fdf42a2222c00fc7aaebe28fdc96af8d..2afbfcbf62595cc03554d245b6a6c0298c13df31 100644 (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>
index 3f260dc9280fe12ba69922e6c383feb1343835c7..91de4b732000ba31dd479007fd6dd2a704a78893 100644 (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 -%>
+<% } %>
index d1319acbd1286bff9e0f106aee025481c3747a50..cc43905b2ac62f42b617ef4649848a99dfbe8d95 100644 (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>
index 97267944e8776515923840ab705235774f992084..8e240884560169671a2f9903e844db8ddaf9d370 100644 (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>
index 17862df673045a5456954d7b6195a7b420ce5dc3..520d1097a26e5c9b6223f1d737eb77819ab828e7 100644 (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>
index 823f1487aa86f442c68a40640ceb23fb6643fa00..7a4ac66a5a79757ea751e7b4d5ffd6831ced091f 100644 (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>
 
 <% content_for :footer do %>
   <p>
index ab4378fa275f00067570c4a235a7002f90ee683f..88b8f9603d4a517509dafce7675fac6cc73271f6 100644 (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 %>
+<% 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 %>
-  <% } %>
+<%= render "notifier/user_message_table", :captured => capture { %>
+  <%= @comment.to_html %>
+<% } %>
 
 
-  <p><%= raw t 'notifier.note_comment_notification.details', :url => link_to(@noteurl, @noteurl) %></p>
-<% end %>
+<p><%= raw t 'notifier.note_comment_notification.details', :url => link_to(@noteurl, @noteurl) %></p>
index 6e7f7280e25e993b1f63e32b3340f04d017b300c..557fef8303cb16cb34b6c5af1562bd72efd0066f 100644 (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>