social_stream-base 0.9.27 → 0.9.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. data/app/assets/stylesheets/base.css.scss +2 -1
  2. data/app/assets/stylesheets/footer.css.scss +1 -1
  3. data/app/assets/stylesheets/header.css.scss +3 -3
  4. data/app/assets/stylesheets/messages.css.scss +1 -0
  5. data/app/helpers/subjects_helper.rb +1 -1
  6. data/app/models/activity.rb +1 -4
  7. data/app/views/message_mailer/new_message_email.html.erb +1 -1
  8. data/app/views/message_mailer/new_message_email.text.erb +1 -1
  9. data/app/views/message_mailer/reply_message_email.html.erb +1 -1
  10. data/app/views/message_mailer/reply_message_email.text.erb +1 -1
  11. data/app/views/notification_mailer/new_notification_email.html.erb +5 -11
  12. data/app/views/notification_mailer/new_notification_email.text.erb +3 -2
  13. data/app/views/notifications/_notification.html.erb +2 -4
  14. data/app/views/notifications/activities/_follow.html.erb +10 -0
  15. data/app/views/notifications/activities/_follow.text.erb +8 -0
  16. data/app/views/notifications/activities/_like.html.erb +30 -0
  17. data/app/views/notifications/activities/_like.text.erb +23 -0
  18. data/app/views/notifications/activities/_make-friend.html.erb +10 -0
  19. data/app/views/notifications/activities/_make-friend.text.erb +7 -0
  20. data/app/views/notifications/activities/_post.html.erb +22 -0
  21. data/app/views/notifications/activities/_post.text.erb +17 -0
  22. data/app/views/notifications/activities/_update.html.erb +18 -0
  23. data/app/views/notifications/activities/_update.text.erb +15 -0
  24. data/app/views/notifications/index.js.erb +1 -1
  25. data/config/locales/en.yml +29 -13
  26. data/config/locales/es.yml +29 -13
  27. data/lib/mailboxer/notification_decoder.rb +11 -9
  28. data/lib/social_stream/base/version.rb +1 -1
  29. data/spec/factories/activity.rb +25 -0
  30. metadata +14 -19
  31. data/app/assets/images/boxy/boxy-ne.png +0 -0
  32. data/app/assets/images/boxy/boxy-nw.png +0 -0
  33. data/app/assets/images/boxy/boxy-se.png +0 -0
  34. data/app/assets/images/boxy/boxy-sw.png +0 -0
  35. data/app/mailers/notification_mailer.rb +0 -34
  36. data/app/views/notifications/activities/_follow_body.html.erb +0 -2
  37. data/app/views/notifications/activities/_follow_subject.html.erb +0 -5
  38. data/app/views/notifications/activities/_like_body.html.erb +0 -5
  39. data/app/views/notifications/activities/_like_subject.html.erb +0 -9
  40. data/app/views/notifications/activities/_make-friend_body.html.erb +0 -2
  41. data/app/views/notifications/activities/_make-friend_subject.html.erb +0 -5
  42. data/app/views/notifications/activities/_post_body.html.erb +0 -6
  43. data/app/views/notifications/activities/_post_subject.html.erb +0 -6
  44. data/app/views/notifications/activities/_update_body.html.erb +0 -5
  45. data/app/views/notifications/activities/_update_subject.html.erb +0 -5
@@ -10,7 +10,7 @@ img { border: 0px;}
10
10
  div { margin: 0px; padding: 0px; font-family: Helvetica; font-size: 11px;}
11
11
  .AbsWrap { width: 100%; position: relative;}
12
12
  .rowWrap { width: 100%;}
13
- a:link,a:visited { color: $main-color; text-decoration: inherit;}
13
+ a:link,a:visited { color: $main-color; font-size: inherit; text-decoration: inherit;}
14
14
  a:hover { text-decoration: underline;}
15
15
  .clearfloat { clear: both; height: 0px;}
16
16
  h2{padding-left:10px;}
@@ -48,6 +48,7 @@ label.validation_error{color: $error-color;background-color: $error-background;b
48
48
  background-image: url('btn/warning.png');}
49
49
  .error, #error_explanation {border-color: $error-color; color: $error-color;background-color: $error-background;
50
50
  background-image: url('btn/error.png');}
51
+ .error h2, #error_explanation h2{ color: $error-color;}
51
52
 
52
53
  /************Forms SECTION **************/
53
54
  input.other_blue{ background-color:$auxiliar-color !important; border:0px; cursor:pointer; line-height:135%;
@@ -4,7 +4,7 @@
4
4
  #sponsor{width:960px;margin:0 auto;color:$details-color; }
5
5
 
6
6
  #footer{width: 960px;margin-left: auto;margin-right: auto;padding: 0;position: relative; text-align:center;
7
- clear:left;font-size:0.9166em;line-height:1.6363;color:$details-color;padding:0.75em 0;}
7
+ clear:left;font-size:0.9166em;line-height:1.6363;color:$details-color;padding:0.75em 0; background: $secondary-color}
8
8
  #footer ul, #sponsor ul{list-style-type:none;margin:0 0.5em; }
9
9
  #footer ul li,#sponsor ul li{display:inline-block;margin-right:0.25em;position:relative;}
10
10
  #footer ul li#trade_mark,#sponsor ul li#trademark{font-weight:bold;color:$sentence-color;}
@@ -1,11 +1,11 @@
1
1
  @import "colors";
2
2
 
3
3
  /****************** HEADER STRUCTURE ******/
4
- #headerFront { width: 100%; padding: 0; background: $header-color; padding: 2px 0px 0px 0px;}
4
+ #headerFront { width: 100%; padding: 0; background: $header-color; padding: 0px 0px 0px 0px;}
5
5
  #header_left { left: 0px; float: left; padding-left: 15px; padding-right: 5px; width:155px;}
6
6
  #header_right { right: 0px; float: right; padding-right: 10px; }
7
- .banner_top{ width: 960px; margin-left: auto; margin-right: auto; margin-top: 3px; padding-bottom: 3px;
8
- position: relative; }
7
+ .banner_top{ width: 960px; margin-left: auto; margin-right: auto; margin-top: 0px; padding-bottom: 0px;
8
+ position: relative; background: $header-color; }
9
9
  .banner_top_height{ height:23px;}
10
10
 
11
11
  /********** CONTENT ************/
@@ -120,6 +120,7 @@
120
120
  }
121
121
  .conversations .unread .subject {
122
122
  font-weight: bold;
123
+ font-size: 12px;
123
124
  }
124
125
  .conversations .conversation .date {
125
126
  color: $details-color;
@@ -10,6 +10,6 @@ module SubjectsHelper
10
10
  # Return the truncated name
11
11
  def truncate_name(name, options={})
12
12
  options = {:length => NAME_MAX_LENGTH, :separator => ' '}.merge options
13
- truncate(name,options)
13
+ h truncate(name,options)
14
14
  end
15
15
  end
@@ -204,12 +204,9 @@ class Activity < ActiveRecord::Base
204
204
  def notify
205
205
  return true if !notificable?
206
206
  #Avaible verbs: follow, like, make-friend, post, update
207
- actionview = ActivitiesController.new.view_context
208
207
 
209
208
  if ['like','follow','make-friend','post','update'].include? verb and !contact.reflexive?
210
- notification_subject = actionview.render :partial => 'notifications/activities/' + verb + "_subject", :locals => {:activity => self}
211
- notification_body = actionview.render :partial => 'notifications/activities/' + verb + "_body", :locals => {:activity => self}
212
- receiver.notify(notification_subject, notification_body, self)
209
+ receiver.notify("You have a new notification", "Youre not supposed to see this", self)
213
210
  end
214
211
  true
215
212
  end
@@ -8,7 +8,7 @@
8
8
  <div>
9
9
  <div style="padding: 10px 5px 5px 5px;">
10
10
  <span style="font-weight: bold;"><%= truncate_name(@message.sender.name)%></span>
11
- has sent a new message to <%= @receiver.subject.is_a?(Group) ? @receiver.name : "you" %>
11
+ <%= t('mailboxer.message_mailer.has_sent_new.' + @receiver.subject.class.to_s.downcase, :receiver => @receiver.name) %>
12
12
  </div>
13
13
  <div style="position: static;padding: 5px; border: #2A3890 solid 2px; background-color: #E1EEF5; margin:10px; min-height: 125px; width: 500px;">
14
14
  <div style="float:left; margin-right:7px; border: thin solid #D4E4EA; background-color: white; max-height: 119px;">
@@ -1,5 +1,5 @@
1
1
  <% self.class.send :include, SubjectsHelper %>
2
- <%=truncate_name(@message.sender.name)%> has sent a new message to <%= @receiver.subject.is_a?(Group) ? @receiver.name : "you" %>
2
+ <%=truncate_name(@message.sender.name)%> <%= t('mailboxer.message_mailer.has_sent_new.' + @receiver.subject.class.to_s.downcase, :receiver => @receiver.name) %>
3
3
 
4
4
  -----------------------------------------------
5
5
  <%= @message.body.html_safe? ? @message.body : strip_tags(@message.body) %>
@@ -8,7 +8,7 @@
8
8
  <div>
9
9
  <div style="padding: 10px 5px 5px 5px;">
10
10
  <span style="font-weight: bold;"><%= truncate_name(@message.sender.name)%></span>
11
- has sent a reply to <%= @receiver.subject.is_a?(Group) ? @receiver.name : "you" %>
11
+ <%= t('mailboxer.message_mailer.has_sent_reply.' + @receiver.subject.class.to_s.downcase, :receiver => @receiver.name) %>
12
12
  </div>
13
13
  <div style="position: static;padding: 5px; border: #2A3890 solid 2px; background-color: #E1EEF5; margin:10px; min-height: 125px; width: 500px;">
14
14
  <div style="float:left; margin-right:7px; border: thin solid #D4E4EA; background-color: white; max-height: 119px;">
@@ -1,5 +1,5 @@
1
1
  <% self.class.send :include, SubjectsHelper %>
2
- <%= truncate_name(@message.sender.name)%> has sent a reply to <%= @receiver.subject.is_a?(Group) ? @receiver.name : "you" %>
2
+ <%= truncate_name(@message.sender.name)%> <%= t('mailboxer.message_mailer.has_sent_reply.' + @receiver.subject.class.to_s.downcase, :receiver => @receiver.name) %>
3
3
 
4
4
  -----------------------------------------------
5
5
  "<%= @message.body.html_safe? ? @message.body : strip_tags(@message.body) %>"
@@ -9,11 +9,7 @@
9
9
 
10
10
  <div style="position: static;padding: 5px; border: #2A3890 solid 2px; background-color: #E1EEF5; margin:10px; min-height: 125px; width: 500px;">
11
11
  <div style="float:left; margin-right:7px; border: thin solid #D4E4EA; background-color: white; max-height: 119px;">
12
- <%if @notification.notified_object.nil? %>
13
- <img src="http://<%= ActionMailer::Base.default_url_options[:host] +User.new.logo.url(:profile)%>" >
14
- <%else%>
15
- <img src="http://<%= ActionMailer::Base.default_url_options[:host] +@notification.notified_object.sender.logo.url(:profile)%>" alt="<%=@notification.notified_object.sender.name%>">
16
- <%end%>
12
+ <img src="<%= root_url + @notification.notified_object.sender.logo.url(:profile)%>" alt="<%=@notification.notified_object.sender.name%>">
17
13
  </div>
18
14
  <div style=" margin: 5px 5px 5px 5px;">
19
15
  <p style="font-weight: bold; "><%= @notification.notified_object.sender.name %>
@@ -21,11 +17,9 @@
21
17
  <br/><span style="color: #6C6D6F; font-weight: normal;"><%= @notification.notified_object.sender.profile.organization%></span>
22
18
  <% end %>
23
19
  </p>
24
- <p>
25
- <%= strip_tags decode_notification @notification.subject,@notification.notified_object %>
26
- </p>
27
- <p style="text-align: justify; font-style: italic;">
28
- <%= raw decode_notification @notification.body,@notification.notified_object %>
20
+ <p style="text-align: justify;">
21
+ <%= render :partial => "notifications/activities/#{ @notification.notified_object.verb }",
22
+ :locals =>{:activity => @notification.notified_object}%>
29
23
  </p>
30
24
  </div>
31
25
  </div>
@@ -36,4 +30,4 @@
36
30
  </div>
37
31
  </div>
38
32
  </body>
39
- </html>
33
+ </html>
@@ -1,6 +1,7 @@
1
1
  <% self.class.send :include, Mailboxer::NotificationDecoder %>
2
- <%= strip_tags decode_notification @notification.subject,@notification.notified_object %>
2
+
3
3
  -----------------------------------------------
4
- <%= strip_tags decode_notification @notification.body,@notification.notified_object %>
4
+ <%= render :partial => "notifications/activities/#{ @notification.notified_object.verb }",
5
+ :locals =>{:activity => @notification.notified_object}%>
5
6
  -----------------------------------------------
6
7
  Visit <%= notifications_url %> and check all your notifications.
@@ -16,11 +16,9 @@
16
16
  </div>
17
17
  </div>
18
18
  <div class="content_right">
19
- <div class="subject">
20
- <%= raw decode_notification notification.subject,notification.notified_object %>
21
- </div>
22
19
  <div class="briefing">
23
- <%= raw decode_notification notification.body, notification.notified_object %>
20
+ <%= render :partial => "notifications/activities/#{ notification.notified_object.verb }",
21
+ :locals =>{:activity => notification.notified_object} %>
24
22
  </div>
25
23
  <div class="clearfloat">
26
24
  </div>
@@ -0,0 +1,10 @@
1
+ <div class="subject">
2
+ <%= raw t('notification.follow.'+ activity.receiver.subject.class.to_s.underscore,
3
+ :sender => link_to(truncate_name(activity.sender.name), polymorphic_url(activity.sender.subject)),
4
+ :who => t('notification.who.'+ activity.receiver.subject.class.to_s.underscore,
5
+ :name => truncate_name(activity.receiver.name))) %>
6
+ </div>
7
+ <div class="briefing">
8
+ <%= link_to(t('notification.confirm', :sender => truncate_name(activity.sender.name)),
9
+ edit_contact_url(activity.receiver.contact_to!(activity.sender),:s => activity.receiver.slug)) %>
10
+ </div>
@@ -0,0 +1,8 @@
1
+ <%= raw t('notification.follow.'+ activity.receiver.subject.class.to_s.underscore,
2
+ :sender => truncate_name(activity.sender.name),
3
+ :who => t('notification.who.'+ activity.receiver.subject.class.to_s.underscore,
4
+ :name => truncate_name(activity.receiver.name))) %>
5
+ -----------------------------------------------
6
+ <%= t('notification.look', :sender => truncate_name(activity.sender.name))%>: <%=polymorphic_url(activity.sender.subject)%>
7
+ <%= t('notification.confirm', :sender => truncate_name(activity.sender.name)) %> <%= edit_contact_url(activity.receiver.contact_to!(activity.sender),
8
+ :s => activity.receiver.slug)%>
@@ -0,0 +1,30 @@
1
+ <% if activity.direct_object.is_a? Actor or activity.direct_object.respond_to? :actor %>
2
+ <div class="subject">
3
+ <%= raw t('notification.fan',
4
+ :sender => link_to(truncate_name(activity.sender.name), polymorphic_url(activity.sender.subject)),
5
+ :whose => t('notification.whose.'+ activity.receiver.subject.class.to_s.underscore,
6
+ :receiver => truncate_name(activity.receiver.name)))%>
7
+ </div>
8
+ <div class="briefing">
9
+ <%= raw t('notification.look',
10
+ :sender => link_to(truncate_name(activity.sender.name), polymorphic_url(activity.sender.subject))) %>
11
+ </div>
12
+ <% else %>
13
+ <div class="subject">
14
+ <%= raw t('notification.like.'+ activity.receiver.subject.class.to_s.underscore,
15
+ :sender => link_to(truncate_name(activity.sender.name), polymorphic_url(activity.sender.subject)),
16
+ :whose => t('notification.whose.'+ activity.receiver.subject.class.to_s.underscore,
17
+ :receiver => truncate_name(activity.receiver.name)),
18
+ :thing => link_to(t(activity.direct_object.class.to_s.underscore+'.name'),
19
+ polymorphic_url( activity.direct_object))) %>
20
+ </div>
21
+ <div class="briefing">
22
+ <% if activity.direct_object.respond_to? :text %>
23
+ "<%= link_to(activity.direct_object.text.truncate(100, :separator =>' '),
24
+ polymorphic_url( activity.direct_object))%>"
25
+ <% else%>
26
+ <%= link_to(t('notification.watch_it'),
27
+ polymorphic_url( activity.direct_object))%>
28
+ <%end%>
29
+ </div>
30
+ <% end %>
@@ -0,0 +1,23 @@
1
+ <% if activity.direct_object.is_a? Actor or activity.direct_object.respond_to? :actor %>
2
+ <%= raw t('notification.fan',
3
+ :sender => truncate_name(activity.sender.name),
4
+ :whose => t('notification.whose.'+ activity.receiver.subject.class.to_s.underscore,
5
+ :receiver => truncate_name(activity.receiver.name)))%>
6
+ -----------------------------------------------
7
+ <% else %>
8
+ <%= raw t('notification.like.'+ activity.receiver.subject.class.to_s.underscore,
9
+ :sender => truncate_name(activity.sender.name),
10
+ :whose => t('notification.whose.'+ activity.receiver.subject.class.to_s.underscore,
11
+ :receiver => truncate_name(activity.receiver.name)),
12
+ :thing => t(activity.direct_object.class.to_s.underscore+'.name')) %>
13
+ -----------------------------------------------
14
+ <% if activity.direct_object.respond_to? :text %>
15
+ "<%= activity.direct_object.text.truncate(100, :separator =>' ')%>"
16
+ <%= t('notification.all_text', :url => polymorphic_url(activity.direct_object))%>
17
+ <% else%>
18
+ --><%= t('notification.watch', :url => polymorphic_url( activity.direct_object))%>
19
+ <%end%>
20
+ <% end %>
21
+
22
+ <%= raw t('notification.look',
23
+ :sender => truncate_name(activity.sender.name)) %>: <%=polymorphic_url(activity.sender.subject)%>
@@ -0,0 +1,10 @@
1
+ <div class="subject">
2
+ <%= raw t('notification.makefriend.'+ activity.receiver.subject.class.to_s.underscore,
3
+ :sender => link_to(truncate_name(activity.sender.name), polymorphic_url(activity.sender.subject)),
4
+ :who => t('notification.who.'+ activity.receiver.subject.class.to_s.underscore,
5
+ :name => truncate_name(activity.receiver.name))) %>
6
+ </div>
7
+ <div class="briefing">
8
+ <%= raw t('notification.look',
9
+ :sender => link_to(truncate_name(activity.sender.name), polymorphic_url(activity.sender.subject))) %>
10
+ </div>
@@ -0,0 +1,7 @@
1
+ <%= raw t('notification.makefriend.'+ activity.receiver.subject.class.to_s.underscore,
2
+ :sender => truncate_name(activity.sender.name),
3
+ :who => t('notification.who.'+ activity.receiver.subject.class.to_s.underscore,
4
+ :name => truncate_name(activity.receiver.name))) %>
5
+ -----------------------------------------------
6
+ <%= raw t('notification.look',
7
+ :sender => link_to(truncate_name(activity.sender.name), polymorphic_url(activity.sender.subject))) %>
@@ -0,0 +1,22 @@
1
+ <div class="subject">
2
+ <%= raw t('notification.post.'+ activity.receiver.subject.class.to_s.underscore,
3
+ :sender => link_to(truncate_name(activity.sender.name),
4
+ polymorphic_url(activity.sender.subject)),
5
+ :whose => t('notification.whose.'+ activity.receiver.subject.class.to_s.underscore,
6
+ :receiver => truncate_name(activity.receiver.name)),
7
+ :thing => link_to(t(activity.direct_object.class.to_s.underscore+'.one'),
8
+ polymorphic_url(activity.direct_object))) %>
9
+ </div>
10
+ <div class="briefing">
11
+ <% if activity.direct_object.respond_to? :text %>
12
+ "<%= link_to(activity.direct_object.text.truncate(100, :separator =>' '),
13
+ polymorphic_url(activity.direct_object))%>"
14
+ <% else%>
15
+ <%= link_to(t('notification.watch_it'),
16
+ polymorphic_url( activity.direct_object))%>
17
+ <%end%>
18
+ <% if SocialStream.activity_forms.include? :document and activity.direct_object.is_a? Document %>
19
+
20
+ <% end%>
21
+ </div>
22
+
@@ -0,0 +1,17 @@
1
+
2
+ <%= raw t('notification.post.'+ activity.receiver.subject.class.to_s.underscore,
3
+ :sender => truncate_name(activity.sender.name),
4
+ :whose => t('notification.whose.'+ activity.receiver.subject.class.to_s.underscore,
5
+ :receiver => truncate_name(activity.receiver.name)),
6
+ :thing => t(activity.direct_object.class.to_s.underscore+'.one')) %>
7
+ -----------------------------------------------
8
+
9
+ <% if activity.direct_object.respond_to? :text %>
10
+ "<%=activity.direct_object.text.truncate(100, :separator =>' ')%>"
11
+ --><%= t('notification.all_text', :url => polymorphic_url(activity.direct_object))%>
12
+ <% else%>
13
+ <%= t('notification.watch', :url => polymorphic_url(activity.direct_object))%>
14
+ <% end%>
15
+
16
+ <%= raw t('notification.look',
17
+ :sender => truncate_name(activity.sender.name))%>: <%=polymorphic_url(activity.sender.subject)%>
@@ -0,0 +1,18 @@
1
+ <div class="subject">
2
+ <%= raw t('notification.update.'+ activity.receiver.subject.class.to_s.underscore,
3
+ :sender => link_to(truncate_name(activity.sender.name),
4
+ polymorphic_url(activity.sender.subject)),
5
+ :whose => t('notification.whose.'+ activity.receiver.subject.class.to_s.underscore,
6
+ :receiver => truncate_name(activity.receiver.name)),
7
+ :thing => link_to(t(activity.direct_object.class.to_s.underscore+'.one'),
8
+ polymorphic_url( activity.direct_object))) %>
9
+ </div>
10
+ <div class="briefing">
11
+ <% if activity.direct_object.respond_to? :text %>
12
+ "<%= link_to(activity.direct_object.text.truncate(100, :separator =>' '),
13
+ polymorphic_url(activity.direct_object))%>"
14
+ <% else%>
15
+ <%= link_to(t('notification.watch_it'),
16
+ polymorphic_url( activity.direct_object))%>
17
+ <%end%>
18
+ </div>
@@ -0,0 +1,15 @@
1
+ <%= raw t('notification.update.'+ activity.receiver.subject.class.to_s.underscore,
2
+ :sender => truncate_name(activity.sender.name),
3
+ :whose => t('notification.whose.'+ activity.receiver.subject.class.to_s.underscore,
4
+ :receiver => truncate_name(activity.receiver.name)),
5
+ :thing => t(activity.direct_object.class.to_s.underscore+'.one')) %>
6
+ -----------------------------------------------
7
+ <% if activity.direct_object.respond_to? :text %>
8
+ "<%=activity.direct_object.text.truncate(100, :separator =>' ')%>"
9
+ --><%= t('notification.all_text', :url => polymorphic_url(activity.direct_object))%>
10
+ <% else%>
11
+ <%= t('notification.watch', :url => polymorphic_url( activity.direct_object))%>
12
+ <% end%>
13
+
14
+ <%= raw t('notification.look',
15
+ :sender => truncate_name(activity.sender.name))%>: <%=polymorphic_url(activity.sender.subject)%>
@@ -1,6 +1,6 @@
1
1
  $("#content").html("<%=escape_javascript(render :partial => 'index') %>");
2
2
  $("header").html("<%=escape_javascript(render :partial => 'layouts/header') %>");
3
3
 
4
- <%= location(link_to(image_tag("btn/btn_notification.png", :class => "menu_icon")+t('notification.other'), notifications_path,:remote => true)) %>
4
+ <%= location(link_to(t('notification.other'), notifications_path,:remote => true)+' ('+@mailbox.notifications.not_trashed.unread.count.to_s+')') %>
5
5
 
6
6
  $('.pagination a').attr('data-remote', 'true');
@@ -91,6 +91,7 @@ en:
91
91
  comment:
92
92
  input: "Write a comment..."
93
93
  confirm_delete: "Delete comment?"
94
+ name: "a comment"
94
95
  view_all: "View all comments"
95
96
  contact:
96
97
  all_n: "All contacts (%{count})"
@@ -242,6 +243,14 @@ en:
242
243
  subject: "Subject"
243
244
  mark_as_read: "Mark as read"
244
245
  message_mailer:
246
+ has_sent_new:
247
+ event: "has sent a new message to %{receiver}"
248
+ group: "has sent a new message to %{receiver}"
249
+ user: "has sent you a new message"
250
+ has_sent_reply:
251
+ event: "has sent a reply to %{receiver}"
252
+ group: "has sent a reply to %{receiver}"
253
+ user: "has sent you a reply"
245
254
  subject_new: "%{subject}"
246
255
  subject_reply: "%{subject}"
247
256
  notification_mailer:
@@ -265,40 +274,46 @@ en:
265
274
  sentbox: "Sentbox"
266
275
  trash: "Trash"
267
276
  notification:
268
- added:
269
- other: "%{sender} added %{who} as contact."
270
- user: "%{sender} added %{who} as contact."
271
- confirm: "Confirm %{sender.name} as contact?"
277
+ all_text: "Read the whole text at %{url}"
278
+ confirm: "Confirm %{sender} as contact?"
272
279
  destroy_sure: "Do you want to delete this notification?"
273
280
  fan: "%{sender} is now %{whose} fan."
281
+ follow:
282
+ group: "%{sender} added %{who} as contact."
283
+ user: "%{sender} added %{who} as contact."
274
284
  like:
275
- other: "%{sender} likes %{whose} %{object.name}."
276
- user: "%{sender} likes %{whose} %{object.name}."
277
- look: "Take a look at %{sender.name}'s wall"
285
+ group: "%{sender} likes %{whose} %{thing}."
286
+ user: "%{sender} likes %{whose} %{thing}."
287
+ look: "Take a look at %{sender}'s wall"
278
288
  makefriend:
279
- other: "%{sender} also added %{who} as contact."
289
+ group: "%{sender} also added %{who} as contact."
280
290
  user: "%{sender} also added %{who} as contact."
281
291
  one: "Notification"
282
292
  other: "Notifications"
283
293
  post:
284
- other: "%{sender} added a %{object} in %{whose} wall."
285
- user: "%{sender} added a %{object} in %{whose} wall."
294
+ group: "%{sender} added %{thing} in %{whose} wall."
295
+ user: "%{sender} added %{thing} in %{whose} wall."
286
296
  read: "Mark as read"
287
297
  read_all: "Mark all as read"
288
298
  unread: "Mark as unread"
289
299
  update:
290
- other: "%{sender} updated a %{object} in %{whose} wall."
291
- user: "%{sender} updated a %{object} in %{whose} wall."
300
+ group: "%{sender} updated %{thing} in %{whose} wall."
301
+ user: "%{sender} updated %{thing} in %{whose} wall."
302
+ watch: "Watch it at %{url}"
303
+ watch_it: "Watch it!"
292
304
  who:
305
+ group: "%{name}"
293
306
  user: "you"
294
307
  whose:
295
- others: "%{receiver}'s"
308
+ group: "%{receiver}'s"
296
309
  user: "your"
297
310
  post:
298
311
  confirm_delete: "Delete post?"
299
312
  form:
300
313
  title: "Post"
301
314
  input: "What are you doing?"
315
+ name: "post"
316
+ one: "a post"
302
317
  title: "Posts"
303
318
  preposition:
304
319
  and: "and"
@@ -437,6 +452,7 @@ en:
437
452
  sure: "Are you sure?"
438
453
  time:
439
454
  ago: "%{time} ago"
455
+ unknown: "Unknown"
440
456
  user:
441
457
  by: "By Users"
442
458
  one: "User"
@@ -90,6 +90,7 @@ es:
90
90
  comment:
91
91
  input: "Comentar..."
92
92
  confirm_delete: "¿Borrar commentario?"
93
+ name: "un comentario"
93
94
  view_all: "Ver todos los comentarios"
94
95
  contact:
95
96
  all_n: "Todos los contactos (%{count})"
@@ -239,6 +240,14 @@ es:
239
240
  subject: "Asunto"
240
241
  mark_as_read: "Marcar como leido"
241
242
  message_mailer:
243
+ has_sent_new:
244
+ event: "ha mandad un nuevo mensaje a %{receiver}"
245
+ group: "ha mandad un nuevo mensaje a %{receiver}"
246
+ user: "te ha mandad un nuevo mensaje"
247
+ has_sent_reply:
248
+ event: "ha mandad una respuesta a %{receiver}"
249
+ group: "ha mandad una respuesta a %{receiver}"
250
+ user: "te ha mandad una respuesta"
242
251
  subject_new: "%{subject}"
243
252
  subject_reply: "%{subject}"
244
253
  notification_mailer:
@@ -262,40 +271,46 @@ es:
262
271
  sentbox: "Salida"
263
272
  trash: "Papelera"
264
273
  notification:
265
- added:
266
- other: "%{sender} añadió a %{who} como contacto."
267
- user: "%{sender} te añadió como contacto."
268
- confirm: "¿Confirmar contacto con %{sender.name}?"
274
+ all_text: "Lee el texto entero en %{url}"
275
+ confirm: "¿Confirmar contacto con %{sender}?"
269
276
  destroy_sure: "¿Borrar notificación?"
270
277
  fan: "%{sender} es ahora fan %{whose}."
278
+ follow:
279
+ group: "%{sender} añadió a %{who} como contacto."
280
+ user: "%{sender} te añadió como contacto."
271
281
  like:
272
- other: "A %{sender} le gusta el %{object.name} %{whose}."
273
- user: "A %{sender} le gusta tu %{object.name}."
274
- look: "Écha un vistazo al muro de %{sender.name}"
282
+ group: "A %{sender} le gusta el %{thing} %{whose}."
283
+ user: "A %{sender} le gusta tu %{thing}."
284
+ look: "Echa un vistazo al muro de %{sender}"
275
285
  makefriend:
276
- other: "%{sender} también añadió a %{who} como contacto."
286
+ group: "%{sender} también añadió a %{who} como contacto."
277
287
  user: "%{sender} también te añadió como contacto."
278
288
  one: "Notificación"
279
289
  other: "Notificaciones"
280
290
  post:
281
- other: "%{sender} añadió %{object} en el muro %{whose}."
282
- user: "%{sender} añadió %{object} en tu muro."
291
+ group: "%{sender} añadió %{thing} en el muro %{whose}."
292
+ user: "%{sender} añadió %{thing} en tu muro."
283
293
  read: "Marcar como leída"
284
294
  read_all: "Marcar todas como leídas"
285
295
  unread: "Marcar como no leídas"
286
296
  update:
287
- other: "%{sender} actualizó %{object} en el muro %{whose}."
288
- user: "%{sender} actualizó %{object} en tu muro."
297
+ group: "%{sender} actualizó %{thing} en el muro %{whose}."
298
+ user: "%{sender} actualizó %{thing} en tu muro."
299
+ watch: "Échale un vistazo en %{url}"
300
+ watch_it: "¡Échale un vistazo!"
289
301
  who:
302
+ group: "%{name}"
290
303
  user: "tú"
291
304
  whose:
305
+ group: "de %{receiver}"
292
306
  user: "tuyo"
293
- others: "de %{receiver}"
294
307
  post:
295
308
  confirm_delete: "¿Borrar texto?"
296
309
  form:
297
310
  title: "Texto"
298
311
  input: "¿Qué quieres compartir?"
312
+ name: "publicación"
313
+ one: "una publicación"
299
314
  title: "Textos"
300
315
  profile:
301
316
  one: "Perfil"
@@ -432,6 +447,7 @@ es:
432
447
  sure: "¿Seguro?"
433
448
  time:
434
449
  ago: "hace %{time}"
450
+ unknown: "Desconocido"
435
451
  user:
436
452
  by: "Por usuarios"
437
453
  one: "Usuario"
@@ -24,10 +24,10 @@ module Mailboxer
24
24
  if activity.direct_object.present?
25
25
  object = activity.direct_object
26
26
  object = object.subject if object.is_a? Actor
27
- notification_text=notification_text.gsub(/\%\{object\}/,link_to(object.class.to_s.underscore,
27
+ notification_text=notification_text.gsub(/\%\{object\}/,link_to(t(object.class.to_s.underscore+".name"),
28
28
  url_for(:controller=> object.class.to_s.underscore.pluralize, :action=> :show,
29
29
  :id=> object.id, :only_path => false)))
30
- notification_text=notification_text.gsub(/\%\{object.name\}/,object.class.to_s.underscore)
30
+ notification_text=notification_text.gsub(/\%\{object.name\}/,t(object.class.to_s.underscore+".name"))
31
31
 
32
32
 
33
33
 
@@ -44,8 +44,8 @@ module Mailboxer
44
44
  #notification_text=notification_text.gsub(/\%\{object.image\}/,thumb_for(object)) if SocialStream.activity_forms.include? :document and object.is_a? Document
45
45
 
46
46
  else
47
- notification_text=notification_text.gsub(/\%\{object\}/,"nilclass")
48
- notification_text=notification_text.gsub(/\%\{object.name\}/,"nilclass")
47
+ notification_text=notification_text.gsub(/\%\{object\}/,t('unknown'))
48
+ notification_text=notification_text.gsub(/\%\{object.name\}/,t('unknown'))
49
49
  end
50
50
 
51
51
  notification_text
@@ -55,7 +55,9 @@ module Mailboxer
55
55
  return if activity.nil?
56
56
  notification_text = notification_text.gsub(/\%\{sender\}/, truncate_name(activity.sender.name))
57
57
  notification_text = notification_text.gsub(/\%\{confirm\}/,t('notification.confirm'))
58
- notification_text = notification_text.gsub(/\%\{look\}/,t('notification.look'))
58
+ notification_text = notification_text.gsub(/\%\{look\}/,t('notification.look') + ": "+
59
+ url_for(:controller=> activity.sender.subject.class.to_s.underscore.pluralize,
60
+ :action=> :show, :id=> activity.sender.subject.slug, :only_path => false))
59
61
  notification_text = notification_text.gsub(/\%\{sender.name\}/,truncate_name(activity.sender.name))
60
62
 
61
63
  if activity.receiver.subject.is_a?(User)
@@ -70,15 +72,15 @@ module Mailboxer
70
72
  if activity.direct_object.present?
71
73
  object = activity.direct_object
72
74
  object = object.subject if object.is_a? Actor
73
- notification_text=notification_text.gsub(/\%\{object\}/,object.class.to_s.underscore)
74
- notification_text=notification_text.gsub(/\%\{object.name\}/,object.class.to_s.underscore)
75
+ notification_text=notification_text.gsub(/\%\{object\}/,t(object.class.to_s.underscore+".name"))
76
+ notification_text=notification_text.gsub(/\%\{object.name\}/,t(object.class.to_s.underscore+".name"))
75
77
  notification_text=notification_text.gsub(/\%\{object.text\}/,object.text.truncate(100, :separator =>' ')) if object.respond_to? :text
76
78
 
77
79
  #notification_text=notification_text.gsub(/\%\{object.image\}/,thumb_for(object)) if SocialStream.activity_forms.include? :document and object.is_a? Document
78
80
 
79
81
  else
80
- notification_text=notification_text.gsub(/\%\{object\}/,"nilclass")
81
- notification_text=notification_text.gsub(/\%\{object.name\}/,"nilclass")
82
+ notification_text=notification_text.gsub(/\%\{object\}/,t('unknown'))
83
+ notification_text=notification_text.gsub(/\%\{object.name\}/,t('unknown'))
82
84
  end
83
85
 
84
86
  notification_text
@@ -1,5 +1,5 @@
1
1
  module SocialStream
2
2
  module Base
3
- VERSION = "0.9.27".freeze
3
+ VERSION = "0.9.28".freeze
4
4
  end
5
5
  end
@@ -1,7 +1,32 @@
1
+ # Helpers for building the post activity
2
+ #
3
+ class ActivityObjectSpecHelper < ActiveRecord::Base
4
+ set_table_name "activity_objects"
5
+ end
6
+
7
+ class PostSpecHelper < ActiveRecord::Base
8
+ set_table_name "posts"
9
+
10
+ belongs_to :activity_object_spec_helper, :foreign_key => "activity_object_id"
11
+ end
12
+
13
+ Factory.define :activity_object_spec_helper do |a|
14
+ a.object_type "Post"
15
+ end
16
+
17
+ Factory.define :post_spec_helper do |p|
18
+ p.association :activity_object_spec_helper
19
+ p.text "Post spec helper"
20
+ end
21
+
22
+ #
23
+ ## End of helpers
24
+
1
25
  Factory.define :activity do |a|
2
26
  a.contact { Factory(:friend).contact }
3
27
  a.activity_verb { ActivityVerb["post"] }
4
28
  a.relation_ids { |b| Array(b.sender.relation_custom('friend').id) }
29
+ a.activity_object_ids { Array(Factory(:post_spec_helper).activity_object_spec_helper.id) }
5
30
  end
6
31
 
7
32
  Factory.define :self_activity, :parent => :activity do |a|
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_stream-base
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 27
10
- version: 0.9.27
9
+ - 28
10
+ version: 0.9.28
11
11
  platform: ruby
12
12
  authors:
13
13
  - GING - DIT - UPM
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-11-08 00:00:00 +01:00
19
+ date: 2011-11-15 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -490,10 +490,6 @@ files:
490
490
  - app/assets/images/arrow-start.png
491
491
  - app/assets/images/arrow.png
492
492
  - app/assets/images/big-logo.png
493
- - app/assets/images/boxy/boxy-ne.png
494
- - app/assets/images/boxy/boxy-nw.png
495
- - app/assets/images/boxy/boxy-se.png
496
- - app/assets/images/boxy/boxy-sw.png
497
493
  - app/assets/images/btn/1-facebook.png
498
494
  - app/assets/images/btn/_notes/btn_certificates.png.mno
499
495
  - app/assets/images/btn/activity.png
@@ -730,7 +726,6 @@ files:
730
726
  - app/helpers/toolbar_helper.rb
731
727
  - app/helpers/users_helper.rb
732
728
  - app/mailers/invitation_mailer.rb
733
- - app/mailers/notification_mailer.rb
734
729
  - app/models/ability.rb
735
730
  - app/models/activity.rb
736
731
  - app/models/activity_object.rb
@@ -863,16 +858,16 @@ files:
863
858
  - app/views/notification_mailer/new_notification_email.text.erb
864
859
  - app/views/notifications/_index.html.erb
865
860
  - app/views/notifications/_notification.html.erb
866
- - app/views/notifications/activities/_follow_body.html.erb
867
- - app/views/notifications/activities/_follow_subject.html.erb
868
- - app/views/notifications/activities/_like_body.html.erb
869
- - app/views/notifications/activities/_like_subject.html.erb
870
- - app/views/notifications/activities/_make-friend_body.html.erb
871
- - app/views/notifications/activities/_make-friend_subject.html.erb
872
- - app/views/notifications/activities/_post_body.html.erb
873
- - app/views/notifications/activities/_post_subject.html.erb
874
- - app/views/notifications/activities/_update_body.html.erb
875
- - app/views/notifications/activities/_update_subject.html.erb
861
+ - app/views/notifications/activities/_follow.html.erb
862
+ - app/views/notifications/activities/_follow.text.erb
863
+ - app/views/notifications/activities/_like.html.erb
864
+ - app/views/notifications/activities/_like.text.erb
865
+ - app/views/notifications/activities/_make-friend.html.erb
866
+ - app/views/notifications/activities/_make-friend.text.erb
867
+ - app/views/notifications/activities/_post.html.erb
868
+ - app/views/notifications/activities/_post.text.erb
869
+ - app/views/notifications/activities/_update.html.erb
870
+ - app/views/notifications/activities/_update.text.erb
876
871
  - app/views/notifications/index.html.erb
877
872
  - app/views/notifications/index.js.erb
878
873
  - app/views/objects/_destroy.js.erb
Binary file
Binary file
Binary file
Binary file
@@ -1,34 +0,0 @@
1
- #OVERRING WARNING
2
- #We must override the NotificationMailer from Mailboxer to change the new_notification_email method
3
- #refer to it for more info
4
- #NOTE: There is just few lines different from original Mailboxer NotificationMailer. Please maintain it
5
- #updated for correct behaviour
6
- class NotificationMailer < ActionMailer::Base
7
- default :from => Mailboxer.default_from
8
- #Sends and email for indicating a new notification to a receiver.
9
- #It calls new_notification_email.
10
- def send_email(notification,receiver)
11
- new_notification_email(notification,receiver)
12
- end
13
-
14
- include ActionView::Helpers::SanitizeHelper
15
- #DIFFERENT FROM ORIGINAL----------------------
16
- include Mailboxer::NotificationDecoder
17
- #END OF DIFFERENCE----------------------------
18
-
19
- #Sends an email for indicating a new message for the receiver
20
- def new_notification_email(notification,receiver)
21
- @notification = notification
22
- @receiver = receiver
23
- #DIFFERENT FROM ORIGINAL----------------------
24
- subject = notification.subject.to_s
25
- subject = decode_basic_notification(subject,notification.notified_object)
26
- subject = subject.gsub(/\n/,'')
27
- #END OF DIFFERENCE----------------------------
28
- subject = strip_tags(subject) unless subject.html_safe?
29
- mail(:to => receiver.send(Mailboxer.email_method,notification), :subject => t('mailboxer.notification_mailer.subject', :subject => subject)) do |format|
30
- format.text {render __method__}
31
- format.html {render __method__}
32
- end
33
- end
34
- end
@@ -1,2 +0,0 @@
1
- %{confirm}
2
-
@@ -1,5 +0,0 @@
1
- <% if activity.receiver.subject.is_a?(User) %>
2
- <%= t('notification.added.user') %>
3
- <% else %>
4
- <%= t('notification.added.other') %>
5
- <% end %>
@@ -1,5 +0,0 @@
1
- <% if activity.direct_object.is_a? Actor or activity.direct_object.respond_to? :actor %>
2
- %{look}
3
- <% else %>
4
- "%{object.text}"
5
- <% end %>
@@ -1,9 +0,0 @@
1
- <% if activity.direct_object.is_a? Actor or activity.direct_object.respond_to? :actor %>
2
- <%= t('notification.fan')%>
3
- <% else %>
4
- <% if activity.receiver.subject.is_a?(User) %>
5
- <%= t('notification.like.user') %>
6
- <% else %>
7
- <%= t('notification.like.other') %>
8
- <% end %>
9
- <% end %>
@@ -1,5 +0,0 @@
1
- <% if activity.receiver.subject.is_a?(User) %>
2
- <%= t('notification.makefriend.user') %>
3
- <% else %>
4
- <%= t('notification.makefriend.other') %>
5
- <% end %>
@@ -1,6 +0,0 @@
1
- <% if activity.direct_object.respond_to? :text %>
2
- "%{object.text}"
3
- <%end%>
4
- <% if SocialStream.activity_forms.include? :document and activity.direct_object.is_a? Document %>
5
- %{object.image}
6
- <% end%>
@@ -1,6 +0,0 @@
1
- <% if activity.receiver.subject.is_a?(User) %>
2
- <%= t('notification.post.user') %>
3
- <% else %>
4
- <%= t('notification.post.other') %>
5
- <% end %>
6
-
@@ -1,5 +0,0 @@
1
- <% if activity.receiver.subject.is_a?(User) %>
2
- <%= t('notification.update.user') %>
3
- <% else %>
4
- <%= t('notification.update.other') %>
5
- <% end %>
@@ -1,5 +0,0 @@
1
- <% if activity.receiver.subject.is_a?(User) %>
2
- <%= t('notification.update.user') %>
3
- <% else %>
4
- <%= t('notification.update.other') %>
5
- <% end %>