From 403a3ab3f92f80e61cbb9bed78875d5db8cbdb06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?= Date: Sun, 14 Feb 2016 13:27:13 +0100 Subject: [PATCH] adds caching to proposals info fragment in index --- app/views/proposals/_proposal.html.erb | 70 +++++++++++++------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/app/views/proposals/_proposal.html.erb b/app/views/proposals/_proposal.html.erb index 89e1b3b0e..b8699348c 100644 --- a/app/views/proposals/_proposal.html.erb +++ b/app/views/proposals/_proposal.html.erb @@ -4,44 +4,46 @@
- <%= t("proposals.proposal.proposal") %> - -

<%= link_to proposal.title, namespaced_proposal_path(proposal) %>

-

-   - <%= link_to t("proposals.proposal.comments", count: proposal.comments_count), namespaced_proposal_path(proposal, anchor: "comments") %> -  •  - <%= l proposal.created_at.to_date %> + <% cache [locale_and_user_status(proposal), 'index', proposal, proposal.author] do %> + <%= t("proposals.proposal.proposal") %> + +

<%= link_to proposal.title, namespaced_proposal_path(proposal) %>

+

+   + <%= link_to t("proposals.proposal.comments", count: proposal.comments_count), namespaced_proposal_path(proposal, anchor: "comments") %> +  •  + <%= l proposal.created_at.to_date %> - <% if proposal.author.hidden? || proposal.author.erased? %> -  •  - - <%= t("proposals.show.author_deleted") %> - - <% else %> -  •  - - <%= proposal.author.name %> - - <% if proposal.author.official? %> + <% if proposal.author.hidden? || proposal.author.erased? %>  •  - - <%= proposal.author.official_position %> + + <%= t("proposals.show.author_deleted") %> + + <% else %> +  •  + + <%= proposal.author.name %> + + <% if proposal.author.official? %> +  •  + + <%= proposal.author.official_position %> + + <% end %> + <% end %> + + <% if proposal.author.verified_organization? %> +  •  + + <%= t("shared.collective") %> <% end %> - <% end %> - - <% if proposal.author.verified_organization? %> -  •  - - <%= t("shared.collective") %> - - <% end %> -

-
-

<%= link_to proposal.summary, namespaced_proposal_path(proposal) %>

-
-
+

+
+

<%= link_to proposal.summary, namespaced_proposal_path(proposal) %>

+
+
+ <% end %> <%= render "shared/tags", taggable: proposal, limit: 5 %>