]> cat aescling's git repositories - mastodon.git/commitdiff
Simplify renders in views (#2084)
authorMatt Jankowski <mjankowski@thoughtbot.com>
Tue, 18 Apr 2017 15:15:30 +0000 (11:15 -0400)
committerEugen <eugen@zeonfederated.com>
Tue, 18 Apr 2017 15:15:30 +0000 (17:15 +0200)
* Simplify render in mailer views

* Simplify render in about/more view

* Simplify render in accounts follow views

* Simplify render in recovery code views

* Simplify render in stream entry embed

* Simplify render in stream entries status partial

* Simplify render in authorize follow new view

12 files changed:
app/views/about/more.html.haml
app/views/accounts/followers.html.haml
app/views/accounts/following.html.haml
app/views/accounts/show.html.haml
app/views/authorize_follow/new.html.haml
app/views/notification_mailer/favourite.text.erb
app/views/notification_mailer/mention.text.erb
app/views/notification_mailer/reblog.text.erb
app/views/settings/two_factor_auths/create.html.haml
app/views/settings/two_factor_auths/recovery_codes.html.haml
app/views/stream_entries/_status.html.haml
app/views/stream_entries/embed.html.haml

index 84b29912cf6cbec8586597fcd11f474482982b9e..8f9cd2f6a0f075091d3c6102f543696e9eec9b28 100644 (file)
@@ -28,5 +28,5 @@
         .panel= @instance_presenter.site_extended_description.html_safe
 
     .sidebar
-      = render partial: 'contact', object: @instance_presenter
+      = render 'contact', contact: @instance_presenter
       = render 'links'
index 4b53aef0ccf33f50afb197e0e88ed372504a407b..9e1643b2388d7ea3f7e9956bfcf62ae154400cfe 100644 (file)
@@ -5,7 +5,7 @@
 
 .accounts-grid
   - if @followers.empty?
-    = render partial: 'nothing_here'
+    = render 'nothing_here'
   - else
     = render partial: 'grid_card', collection: @followers, as: :account, cached: true
 
index 4711997d9d43ec56d70013954efff0304e7624a1..19138b0a4e3e891db419301b4828001e868d7bcd 100644 (file)
@@ -5,7 +5,7 @@
 
 .accounts-grid
   - if @following.empty?
-    = render partial: 'nothing_here'
+    = render 'nothing_here'
   - else
     = render partial: 'grid_card', collection: @following, as: :account, cached: true
 
index b01f3c4e3e5842c5cb94fbae1bc3e362dc950176..44d66d4716a75bf12493352739b1e061bc4b8a34 100644 (file)
@@ -24,7 +24,7 @@
 
   - if @statuses.empty?
     .accounts-grid
-      = render partial: 'nothing_here'
+      = render 'nothing_here'
   - else
     .activity-stream
       = render partial: 'stream_entries/status', collection: @statuses, as: :status
index 95601253e60a03a1080d06b9b2154cd516343218..3b60df0580b9084bf89e8dcc2ed20a08411949ed 100644 (file)
@@ -5,7 +5,7 @@
   .follow-prompt
     %h2= t('authorize_follow.prompt_html', self: current_account.username)
 
-    = render partial: 'card', locals: { account: @account }
+    = render 'card', account: @account
 
   = form_tag authorize_follow_path, method: :post, class: 'simple_form' do
     = hidden_field_tag :acct, @account.acct
index 99852592f6a6d985a961c8886a340169875e3b9a..795045307fdb2cd3a456a780ca3ebcbdec7c060d 100644 (file)
@@ -2,4 +2,4 @@
 
 <%= raw t('notification_mailer.favourite.body', name: @account.acct) %>
 
-<%= render partial: 'status', locals: { status: @status } %>
+<%= render 'status', status: @status %>
index c0d4be1d86457a8758508b83e27487cdd2abbc52..b38c5a4d06ed28bdcba7b5a9f01e852084b17f24 100644 (file)
@@ -2,4 +2,4 @@
 
 <%= raw t('notification_mailer.mention.body', name: @status.account.acct) %>
 
-<%= render partial: 'status', locals: { status: @status } %>
+<%= render 'status', status: @status %>
index c32b4865008ba234812d1ff90f67da4102c33925..fd85437a7def99be57f5cc124bc9638c11d8676e 100644 (file)
@@ -2,4 +2,4 @@
 
 <%= raw t('notification_mailer.reblog.body', name: @account.acct) %>
 
-<%= render partial: 'status', locals: { status: @status } %>
+<%= render 'status', status: @status %>
index 138a930fd61b8da16965e089500e269d6d897902..aaeebaf2e0baf1a5148b6119ec5acf4d73325ce7 100644 (file)
@@ -1,4 +1,4 @@
 - content_for :page_title do
   = t('settings.two_factor_auth')
 
-= render partial: 'recovery_codes', object: @codes
+= render 'recovery_codes', recovery_codes: @codes
index 138a930fd61b8da16965e089500e269d6d897902..aaeebaf2e0baf1a5148b6119ec5acf4d73325ce7 100644 (file)
@@ -1,4 +1,4 @@
 - content_for :page_title do
   = t('settings.two_factor_auth')
 
-= render partial: 'recovery_codes', object: @codes
+= render 'recovery_codes', recovery_codes: @codes
index f389a8dfe71ef9d4f3ddab42c745e0de86605d36..6c763bde26914fec206443d10e88eb95e2ee9cee 100644 (file)
@@ -26,7 +26,7 @@
           %strong.emojify= display_name(status.account)
         = t('stream_entries.reblogged')
 
-  = render partial: centered ? 'stream_entries/detailed_status' : 'stream_entries/simple_status', locals: { status: status.proper }
+  = render (centered ? 'stream_entries/detailed_status' : 'stream_entries/simple_status'), status: status.proper
 
 - if include_threads
   = render partial: 'stream_entries/status', collection: @descendants, as: :status, locals: { is_successor: true, parent_id: status.id}
index fd07fdd9156d206c6a17618d03fd4f7da029165b..5df82528bdf239067635bdf02ed8a59f60c98149 100644 (file)
@@ -1,2 +1,2 @@
 .activity-stream.activity-stream-headless
-  = render partial: @type, locals: { @type.to_sym => @stream_entry.activity, centered: true }
+  = render @type, @type.to_sym => @stream_entry.activity, centered: true