about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-04-18 11:15:30 -0400
committerEugen <eugen@zeonfederated.com>2017-04-18 17:15:30 +0200
commit84b5fae8e37b9c1b3766efc047993c69ea046ae3 (patch)
tree13451fed7e9d82750cfce45b269a06d81fc637e9
parentd90b1650d805f4cede5cff255530aa3fb4429864 (diff)
Simplify renders in views (#2084)
* 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
-rw-r--r--app/views/about/more.html.haml2
-rw-r--r--app/views/accounts/followers.html.haml2
-rw-r--r--app/views/accounts/following.html.haml2
-rw-r--r--app/views/accounts/show.html.haml2
-rw-r--r--app/views/authorize_follow/new.html.haml2
-rw-r--r--app/views/notification_mailer/favourite.text.erb2
-rw-r--r--app/views/notification_mailer/mention.text.erb2
-rw-r--r--app/views/notification_mailer/reblog.text.erb2
-rw-r--r--app/views/settings/two_factor_auths/create.html.haml2
-rw-r--r--app/views/settings/two_factor_auths/recovery_codes.html.haml2
-rw-r--r--app/views/stream_entries/_status.html.haml2
-rw-r--r--app/views/stream_entries/embed.html.haml2
12 files changed, 12 insertions, 12 deletions
diff --git a/app/views/about/more.html.haml b/app/views/about/more.html.haml
index 84b29912c..8f9cd2f6a 100644
--- a/app/views/about/more.html.haml
+++ b/app/views/about/more.html.haml
@@ -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'
diff --git a/app/views/accounts/followers.html.haml b/app/views/accounts/followers.html.haml
index 4b53aef0c..9e1643b23 100644
--- a/app/views/accounts/followers.html.haml
+++ b/app/views/accounts/followers.html.haml
@@ -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
 
diff --git a/app/views/accounts/following.html.haml b/app/views/accounts/following.html.haml
index 4711997d9..19138b0a4 100644
--- a/app/views/accounts/following.html.haml
+++ b/app/views/accounts/following.html.haml
@@ -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
 
diff --git a/app/views/accounts/show.html.haml b/app/views/accounts/show.html.haml
index b01f3c4e3..44d66d471 100644
--- a/app/views/accounts/show.html.haml
+++ b/app/views/accounts/show.html.haml
@@ -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
diff --git a/app/views/authorize_follow/new.html.haml b/app/views/authorize_follow/new.html.haml
index 95601253e..3b60df058 100644
--- a/app/views/authorize_follow/new.html.haml
+++ b/app/views/authorize_follow/new.html.haml
@@ -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
diff --git a/app/views/notification_mailer/favourite.text.erb b/app/views/notification_mailer/favourite.text.erb
index 99852592f..795045307 100644
--- a/app/views/notification_mailer/favourite.text.erb
+++ b/app/views/notification_mailer/favourite.text.erb
@@ -2,4 +2,4 @@
 
 <%= raw t('notification_mailer.favourite.body', name: @account.acct) %>
 
-<%= render partial: 'status', locals: { status: @status } %>
+<%= render 'status', status: @status %>
diff --git a/app/views/notification_mailer/mention.text.erb b/app/views/notification_mailer/mention.text.erb
index c0d4be1d8..b38c5a4d0 100644
--- a/app/views/notification_mailer/mention.text.erb
+++ b/app/views/notification_mailer/mention.text.erb
@@ -2,4 +2,4 @@
 
 <%= raw t('notification_mailer.mention.body', name: @status.account.acct) %>
 
-<%= render partial: 'status', locals: { status: @status } %>
+<%= render 'status', status: @status %>
diff --git a/app/views/notification_mailer/reblog.text.erb b/app/views/notification_mailer/reblog.text.erb
index c32b48650..fd85437a7 100644
--- a/app/views/notification_mailer/reblog.text.erb
+++ b/app/views/notification_mailer/reblog.text.erb
@@ -2,4 +2,4 @@
 
 <%= raw t('notification_mailer.reblog.body', name: @account.acct) %>
 
-<%= render partial: 'status', locals: { status: @status } %>
+<%= render 'status', status: @status %>
diff --git a/app/views/settings/two_factor_auths/create.html.haml b/app/views/settings/two_factor_auths/create.html.haml
index 138a930fd..aaeebaf2e 100644
--- a/app/views/settings/two_factor_auths/create.html.haml
+++ b/app/views/settings/two_factor_auths/create.html.haml
@@ -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
diff --git a/app/views/settings/two_factor_auths/recovery_codes.html.haml b/app/views/settings/two_factor_auths/recovery_codes.html.haml
index 138a930fd..aaeebaf2e 100644
--- a/app/views/settings/two_factor_auths/recovery_codes.html.haml
+++ b/app/views/settings/two_factor_auths/recovery_codes.html.haml
@@ -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
diff --git a/app/views/stream_entries/_status.html.haml b/app/views/stream_entries/_status.html.haml
index f389a8dfe..6c763bde2 100644
--- a/app/views/stream_entries/_status.html.haml
+++ b/app/views/stream_entries/_status.html.haml
@@ -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}
diff --git a/app/views/stream_entries/embed.html.haml b/app/views/stream_entries/embed.html.haml
index fd07fdd91..5df82528b 100644
--- a/app/views/stream_entries/embed.html.haml
+++ b/app/views/stream_entries/embed.html.haml
@@ -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