diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-09-24 13:40:42 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-09-24 13:40:42 +0200 |
commit | 57583f3fb8a609dab90b2c35f569d8feee655bd7 (patch) | |
tree | 4018f72c22ec862c7566d587f326506fc60f3521 /app/views/accounts | |
parent | 95d72b2249e1313182d4ee8b3dbf62666d716585 (diff) |
Improve partial rendering and Haml performance (Haml->Hamlit)
Diffstat (limited to 'app/views/accounts')
-rw-r--r-- | app/views/accounts/followers.html.haml | 5 | ||||
-rw-r--r-- | app/views/accounts/following.html.haml | 5 | ||||
-rw-r--r-- | app/views/accounts/show.html.haml | 3 |
3 files changed, 5 insertions, 8 deletions
diff --git a/app/views/accounts/followers.html.haml b/app/views/accounts/followers.html.haml index 75e464957..5bd3d0809 100644 --- a/app/views/accounts/followers.html.haml +++ b/app/views/accounts/followers.html.haml @@ -5,10 +5,9 @@ = render partial: 'header' .accounts-grid - - @followers.each do |f| - = render partial: 'grid_card', locals: { account: f } - - if @followers.empty? = render partial: 'nothing_here' + - else + = render partial: 'grid_card', collection: @followers, as: :account = will_paginate @followers, pagination_options diff --git a/app/views/accounts/following.html.haml b/app/views/accounts/following.html.haml index 6e1ba583c..b20ee5318 100644 --- a/app/views/accounts/following.html.haml +++ b/app/views/accounts/following.html.haml @@ -6,10 +6,9 @@ = render partial: 'header' .accounts-grid - - @following.each do |f| - = render partial: 'grid_card', locals: { account: f } - - if @following.empty? = render partial: 'nothing_here' + - else + = render partial: 'grid_card', collection: @following, as: :account = will_paginate @following, pagination_options diff --git a/app/views/accounts/show.html.haml b/app/views/accounts/show.html.haml index 815d05f0c..563b43849 100644 --- a/app/views/accounts/show.html.haml +++ b/app/views/accounts/show.html.haml @@ -12,7 +12,6 @@ = render partial: 'nothing_here' - else .activity-stream - - @statuses.each do |status| - = render partial: 'stream_entries/status', locals: { status: status } + = render partial: 'stream_entries/status', collection: @statuses, as: :status = will_paginate @statuses, pagination_options |