Use local variables in user profile partials
This way we'll be able to render the partials from places like a component.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<%= render "following" if @follows.present? %>
|
||||
<%= render "proposals" if @proposals.present? && feature?(:proposals) %>
|
||||
<%= render "debates" if @debates.present? && feature?(:debates) %>
|
||||
<%= render "budget_investments" if @budget_investments.present? && feature?(:budgets) %>
|
||||
<%= render "comments" if @comments.present? %>
|
||||
<%= render "following", user: @user, follows: @follows if @follows.present? %>
|
||||
<%= render "proposals", proposals: @proposals if @proposals.present? && feature?(:proposals) %>
|
||||
<%= render "debates", debates: @debates if @debates.present? && feature?(:debates) %>
|
||||
<%= render "budget_investments", budge_investments: @budge_investments if @budge_investments.present? && feature?(:budgets) %>
|
||||
<%= render "comments", comments: @comments if @comments.present? %>
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @budget_investments.each do |budget_investment| %>
|
||||
<% budget_investments.each do |budget_investment| %>
|
||||
<%= render "budget_investment", budget_investment: budget_investment %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @budget_investments %>
|
||||
<%= paginate budget_investments %>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @comments.each do |comment| %>
|
||||
<% comments.each do |comment| %>
|
||||
<tr id="comment_<%= comment.id %>">
|
||||
<td>
|
||||
<%= comment_commentable_title(comment) %>
|
||||
@@ -17,4 +17,4 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @comments %>
|
||||
<%= paginate comments %>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @debates.each do |debate| %>
|
||||
<% debates.each do |debate| %>
|
||||
<tr id="debate_<%= debate.id %>">
|
||||
<td>
|
||||
<%= link_to debate.title, debate %>
|
||||
@@ -15,4 +15,4 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @debates %>
|
||||
<%= paginate debates %>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<div class="row following margin-top" data-equalizer data-equalize-on="medium">
|
||||
<div class="small-12 medium-8 column" data-equalizer-watch>
|
||||
<ul class="menu simple clear">
|
||||
<% @follows.each do |followable_type, follows| %>
|
||||
<% follows.each do |followable_type, follows| %>
|
||||
<li><%= link_to followable_type_title(followable_type), "##{followable_type_title(followable_type).parameterize.underscore}" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<% @follows.each do |followable_type, follows| %>
|
||||
<% follows.each do |followable_type, follows| %>
|
||||
|
||||
<h3 id="<%= followable_type_title(followable_type).parameterize.underscore %>">
|
||||
<span class="icon-<%= followable_icon(followable_type) %>"></span>
|
||||
@@ -22,6 +22,6 @@
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-4 column interests" data-equalizer-watch>
|
||||
<%= render "interests", user: @user if valid_interests_access? %>
|
||||
<%= render "interests", user: user if valid_interests_access? %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @proposals.each do |proposal| %>
|
||||
<% proposals.each do |proposal| %>
|
||||
<%= render "proposal", proposal: proposal %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @proposals %>
|
||||
<%= paginate proposals %>
|
||||
|
||||
Reference in New Issue
Block a user