diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb
index 443ef1c99..3a22c8738 100644
--- a/app/helpers/notifications_helper.rb
+++ b/app/helpers/notifications_helper.rb
@@ -44,10 +44,18 @@ module NotificationsHelper
end
def notification_people_link(note)
- note.actors.collect{ |person| link_to("#{h(person.name.titlecase)}", person_path(person))}.join(", ").html_safe
+ actors = note.actors
+ number_of_actors = actors.count
+ actor_links = actors.collect{ |person| link_to("#{h(person.name.titlecase)}", person_path(person))}
+ if number_of_actors < 4
+ message = actor_links.join(',')
+ else
+ message = actor_links[0..2].join(', ') << " #{t('.and_others', :number =>(number_of_actors - 3))}, " << actor_links[3..(number_of_actors-2)].join(', ')<< " #{t('.and')} "<< actor_links.last << ''
+ end
+ message.html_safe
end
def peoples_names(note)
- note.actors.map{|p| p.name}.join(",")
+ note.actors.map{|p| p.name}.join(", ")
end
end
diff --git a/app/views/notifications/index.html.haml b/app/views/notifications/index.html.haml
index 8412a92b5..02f189bb3 100644
--- a/app/views/notifications/index.html.haml
+++ b/app/views/notifications/index.html.haml
@@ -11,14 +11,21 @@
type: 'PUT'
});
}
-
- nBadge.html().replace(/\d+/, function(num){
- num = parseInt(num);
- nBadge.html(parseInt(num)-1);
- if(num == 1) {
- nBadge.addClass("hidden");
- }
+ if(nBadge.html() != null) {
+ nBadge.html().replace(/\d+/, function(num){
+ num = parseInt(num);
+ nBadge.html(parseInt(num)-1);
+ if(num == 1) {
+ nBadge.addClass("hidden");
+ }
});
+
+ }
+ });
+
+ $('a.more').live('click', function(){
+ $(this).hide();
+ $(this).next('span').removeClass('hidden');
});
.span-1
diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml
index 839d587ea..e80e9904c 100644
--- a/config/locales/diaspora/en.yml
+++ b/config/locales/diaspora/en.yml
@@ -274,6 +274,8 @@ en:
index:
notifications: "Notifications"
mark_all_as_read: "Mark All as Read"
+ and_others: "and %{number} others"
+ and: 'and'
helper:
new_notifications:
zero: "no new notifications"