diff --git a/app/sweepers/kudos_sweeper.rb b/app/sweepers/kudos_sweeper.rb index 8ba76b3f40b..597b0b66d59 100644 --- a/app/sweepers/kudos_sweeper.rb +++ b/app/sweepers/kudos_sweeper.rb @@ -11,7 +11,7 @@ def after_create(kudo) # expire the cache for the kudos section in the view # and for the full-page, expanded list - expire_fragment "#{kudo.commentable.cache_key}/kudos" + expire_fragment "#{kudo.commentable.cache_key}/kudos-v1" expire_fragment "#{kudo.commentable.cache_key}/kudos/full" end end diff --git a/app/views/kudos/_kudos.html.erb b/app/views/kudos/_kudos.html.erb index 44579192ccf..10a32a5df6c 100644 --- a/app/views/kudos/_kudos.html.erb +++ b/app/views/kudos/_kudos.html.erb @@ -1,7 +1,7 @@ <% # expects local variables kudos, guest_kudos_count, commentable %>
<% if kudos.length > 0 || guest_kudos_count > 0 %> - <% cache "#{commentable.cache_key}/kudos" do %> + <% cache "#{commentable.cache_key}/kudos-v1" do %>

<% if kudos.length <= ArchiveConfig.MAX_KUDOS_TO_SHOW %> <%= kudos.map {|kudo| link_to kudo.pseud.byline, kudo.pseud.user}. @@ -9,19 +9,19 @@ html_safe %> <% else %> <%= kudos[0,ArchiveConfig.MAX_KUDOS_TO_SHOW].map {|kudo| link_to kudo.pseud.byline, kudo.pseud.user}. - to_sentence(:last_word_connector => ', '). - html_safe + ', ' %> - <%= link_to work_kudos_path(commentable), :id => "kudos_summary" do %> + to_sentence(last_word_connector: ", "). + html_safe + ", " %> + <%= link_to work_kudos_path(commentable), id: "kudos_summary" do %> <% collapsed_count = kudos.length - ArchiveConfig.MAX_KUDOS_TO_SHOW %> <% if collapsed_count == 1 %> - <%= ts(' and 1 more user') %> + <%= ts(" and 1 more user") %> <% else %> - <%= ts(' and %{collapsed_count} more users', collapsed_count: collapsed_count) %> + <%= ts(" and %{collapsed_count} more users", collapsed_count: collapsed_count) %> <% end %> <% end %> <% end %> @@ -29,11 +29,11 @@ <% if kudos.length > 0 %> <%= ts(" as well as ") %> <% end %> - <%= ts(pluralize(guest_kudos_count, 'guest')) %> + <%= ts(pluralize(guest_kudos_count, "guest")) %> <% end %> <%= ts(" left kudos on this work!") %> -

<% end %> diff --git a/public/javascripts/application.js b/public/javascripts/application.js index b2553c8b25e..81b1e8e17b7 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -408,15 +408,15 @@ function prepareDeleteLinks() { /// Kudos $j(document).ready(function() { - $j('a#kudos_summary').click(function(e) { + $j('#kudos_summary').click(function(e) { e.preventDefault(); - $j('a#kudos_summary').hide(); + $j(this).hide(); $j('.kudos_expanded').show(); }); - $j('.kudos_expanded a').click(function(e) { + $j('#kudos_collapser').click(function(e) { e.preventDefault(); - $j('a#kudos_summary').show(); + $j('#kudos_summary').show(); $j('.kudos_expanded').hide(); });