From e9867fe1c0f6df140f59a36996f48fde6a6ac87a Mon Sep 17 00:00:00 2001 From: Daniela Soares Feitosa Date: Sun, 24 Nov 2013 05:22:47 +0000 Subject: [PATCH] Replaced link_to_remote by link_to --- app/views/profile/_more_comments.rhtml | 2 +- app/views/profile/_more_replies.rhtml | 2 +- app/views/profile/_profile_comments.rhtml | 2 +- app/views/profile/_profile_scraps.rhtml | 14 +++++++------- public/javascripts/application.js | 23 +++++++++++++++++++---- 5 files changed, 29 insertions(+), 14 deletions(-) diff --git a/app/views/profile/_more_comments.rhtml b/app/views/profile/_more_comments.rhtml index 875c1e9..b24637a 100644 --- a/app/views/profile/_more_comments.rhtml +++ b/app/views/profile/_more_comments.rhtml @@ -1,3 +1,3 @@
- <%= link_to_remote(_('More'), :url => { :profile => @profile.identifier, :controller => 'profile', :action => 'more_comments', :activity => activity, :comment_page => (comment_page + 1)}) %> + <%= link_to(_('More'), :profile => @profile.identifier, :controller => 'profile', :action => 'more_comments', :activity => activity, :comment_page => (comment_page + 1)) %>
diff --git a/app/views/profile/_more_replies.rhtml b/app/views/profile/_more_replies.rhtml index 800b608..1043046 100644 --- a/app/views/profile/_more_replies.rhtml +++ b/app/views/profile/_more_replies.rhtml @@ -1,3 +1,3 @@
- <%= link_to_remote(_('More'), :url => { :profile => @profile.identifier, :controller => 'profile', :action => 'more_replies', :activity => activity, :comment_page => (comment_page + 1)}) %> + <%= link_to(_('More'), :profile => @profile.identifier, :controller => 'profile', :action => 'more_replies', :activity => activity, :comment_page => (comment_page + 1)) %>
diff --git a/app/views/profile/_profile_comments.rhtml b/app/views/profile/_profile_comments.rhtml index c4a4db1..e010237 100644 --- a/app/views/profile/_profile_comments.rhtml +++ b/app/views/profile/_profile_comments.rhtml @@ -5,7 +5,7 @@ <% if activity.comments_count > 0 %>
- <%= link_to_remote(_("View all %s comments") % activity.comments_count, :url => { :profile => profile.identifier, :controller => 'profile', :action => 'more_comments', :activity => activity, :comment_page => (1)}) %> + <%= link_to(n_('View comment', "View all %s comments", activity.comments_count) % activity.comments_count, :profile => profile.identifier, :controller => 'profile', :action => 'more_comments', :activity => activity, :comment_page => (1)) %>
<% end %> diff --git a/app/views/profile/_profile_scraps.rhtml b/app/views/profile/_profile_scraps.rhtml index 2f9564f..aab0f70 100644 --- a/app/views/profile/_profile_scraps.rhtml +++ b/app/views/profile/_profile_scraps.rhtml @@ -21,12 +21,12 @@ <% if scrap.replies.count > 0 %> -
-
- <%= link_to_remote(_("View all %s comments") % scrap.replies.count, :url => { :profile => profile.identifier, :controller => 'profile', :action => 'more_replies', :activity => activity, :comment_page => (1)}) %> -
-
+
+
+ <%= link_to(n_('View comment', "View all %s comments", scrap.replies.count) % scrap.replies.count, :profile => profile.identifier, :controller => 'profile', :action => 'more_replies', :activity => activity, :comment_page => (1)) %> +
+
<% end %> <%= render :partial => 'profile_scrap_reply_form', :locals => { :scrap => scrap } %> -
- \ No newline at end of file +
+ diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 2379353..1b448de 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -853,6 +853,12 @@ Array.min = function(array) { return Math.min.apply(Math, array); }; +function hideAndGetUrl(link) { + link.hide(); + url = jQuery(link).attr('href'); + jQuery.get(url); +} + jQuery(function($){ $('.submit-with-keypress').live('keydown', function(e) { field = this; @@ -875,12 +881,21 @@ jQuery(function($){ } }); - $('.view-all-comments').live('click', function(e) { - var link = this; - $(link).parent().find('.profile-wall-activities-comments').show(); - $(link).hide(); + $('#content').delegate( '.view-all-comments a', 'click', function(e) { + hideAndGetUrl(this); return false; + }); + + $('#content').delegate('.view-more-replies a', 'click', function(e) { + hideAndGetUrl(this); + return false; }); + + $('#content').delegate('.view-more-comments a', 'click', function(e) { + hideAndGetUrl(this); + return false; + }); + $('.focus-on-comment').live('click', function(e) { var link = this; $(link).parents('.profile-activity-item').find('textarea').focus(); -- libgit2 0.21.2