social_stream 0.12.6 → 0.12.7
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.
- data/base/app/models/activity.rb +48 -1
- data/base/app/views/comments/_comment.html.erb +1 -1
- data/base/app/views/notification_mailer/new_notification_email.html.erb +5 -3
- data/base/app/views/notification_mailer/new_notification_email.text.erb +5 -3
- data/base/app/views/notifications/activities/_follow.html.erb +4 -4
- data/base/app/views/notifications/activities/_follow.text.erb +7 -7
- data/base/app/views/notifications/activities/_like.html.erb +1 -1
- data/base/app/views/notifications/activities/_like.text.erb +5 -5
- data/base/app/views/notifications/activities/_make-friend.text.erb +5 -5
- data/base/app/views/notifications/activities/_post.html.erb +1 -1
- data/base/app/views/notifications/activities/_post.text.erb +6 -6
- data/base/app/views/notifications/activities/_update.html.erb +1 -1
- data/base/app/views/notifications/activities/_update.text.erb +6 -6
- data/base/app/views/posts/_post.html.erb +1 -1
- data/base/config/locales/en.yml +3 -0
- data/base/config/locales/es.yml +16 -8
- data/base/lib/social_stream-base.rb +3 -0
- data/base/lib/social_stream/base.rb +5 -0
- data/base/lib/social_stream/base/version.rb +1 -1
- data/base/lib/social_stream/controllers/cancan_devise_integration.rb +22 -0
- data/base/social_stream-base.gemspec +3 -1
- data/events/app/views/events/index.html.erb +1 -1
- data/events/lib/social_stream/events/version.rb +1 -1
- data/events/social_stream-events.gemspec +1 -1
- data/lib/social_stream/version.rb +1 -1
- data/social_stream.gemspec +2 -2
- metadata +11 -12
- data/base/app/helpers/notifications_helper.rb +0 -3
- data/base/lib/mailboxer/notification_decoder.rb +0 -89
data/base/app/models/activity.rb
CHANGED
@@ -206,7 +206,7 @@ class Activity < ActiveRecord::Base
|
|
206
206
|
#Avaible verbs: follow, like, make-friend, post, update
|
207
207
|
|
208
208
|
if ['like','follow','make-friend','post','update'].include? verb and !contact.reflexive?
|
209
|
-
receiver.notify(
|
209
|
+
receiver.notify(notification_subject, "Youre not supposed to see this", self)
|
210
210
|
end
|
211
211
|
true
|
212
212
|
end
|
@@ -307,6 +307,53 @@ class Activity < ActiveRecord::Base
|
|
307
307
|
end
|
308
308
|
end
|
309
309
|
|
310
|
+
#
|
311
|
+
# Get the email subject for the activity's notification
|
312
|
+
#
|
313
|
+
def notification_subject
|
314
|
+
sender_name= sender.name.truncate(30, :separator => ' ')
|
315
|
+
receiver_name= receiver.name.truncate(30, :separator => ' ')
|
316
|
+
case verb
|
317
|
+
when 'like'
|
318
|
+
if direct_object.is_a? Actor or direct_object.respond_to? :actor
|
319
|
+
I18n.t('notification.fan',
|
320
|
+
:sender => sender_name,
|
321
|
+
:whose => I18n.t('notification.whose.'+ receiver.subject.class.to_s.underscore,
|
322
|
+
:receiver => receiver_name))
|
323
|
+
else
|
324
|
+
I18n.t('notification.like.'+ receiver.subject.class.to_s.underscore,
|
325
|
+
:sender => sender_name,
|
326
|
+
:whose => I18n.t('notification.whose.'+ receiver.subject.class.to_s.underscore,
|
327
|
+
:receiver => receiver_name),
|
328
|
+
:thing => I18n.t(direct_object.class.to_s.underscore+'.name'))
|
329
|
+
end
|
330
|
+
when 'follow'
|
331
|
+
I18n.t('notification.follow.'+ receiver.subject.class.to_s.underscore,
|
332
|
+
:sender => sender_name,
|
333
|
+
:who => I18n.t('notification.who.'+ receiver.subject.class.to_s.underscore,
|
334
|
+
:name => receiver_name))
|
335
|
+
when 'make-friend'
|
336
|
+
I18n.t('notification.makefriend.'+ receiver.subject.class.to_s.underscore,
|
337
|
+
:sender => sender_name,
|
338
|
+
:who => I18n.t('notification.who.'+ receiver.subject.class.to_s.underscore,
|
339
|
+
:name => receiver_name))
|
340
|
+
when 'post'
|
341
|
+
I18n.t('notification.post.'+ receiver.subject.class.to_s.underscore,
|
342
|
+
:sender => sender_name,
|
343
|
+
:whose => I18n.t('notification.whose.'+ receiver.subject.class.to_s.underscore,
|
344
|
+
:receiver => receiver_name),
|
345
|
+
:thing => I18n.t(direct_object.class.to_s.underscore+'.one'))
|
346
|
+
when 'update'
|
347
|
+
I18n.t('notification.update.'+ receiver.subject.class.to_s.underscore,
|
348
|
+
:sender => sender_name,
|
349
|
+
:whose => I18n.t('notification.whose.'+ receiver.subject.class.to_s.underscore,
|
350
|
+
:receiver => receiver_name),
|
351
|
+
:thing => I18n.t(direct_object.class.to_s.underscore+'.one'))
|
352
|
+
else
|
353
|
+
t('notification.default')
|
354
|
+
end
|
355
|
+
end
|
356
|
+
|
310
357
|
#Send notifications to actors based on proximity, interest and permissions
|
311
358
|
def send_notifications
|
312
359
|
notify
|
@@ -1 +1 @@
|
|
1
|
-
<%= comment.text %>
|
1
|
+
<%= simple_format auto_link(comment.text) %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<% self.class.send :include,
|
1
|
+
<% self.class.send :include, SubjectsHelper, ActionView::Helpers::TextHelper %>
|
2
2
|
<!DOCTYPE html>
|
3
3
|
<html>
|
4
4
|
<head>
|
@@ -6,7 +6,9 @@
|
|
6
6
|
</head>
|
7
7
|
<body>
|
8
8
|
<div>
|
9
|
-
|
9
|
+
<div >
|
10
|
+
<%= t('notification.hello', :receiver => @receiver.name)%>
|
11
|
+
</div>
|
10
12
|
<div style="position: static;padding: 5px; border: #2A3890 solid 2px; background-color: #E1EEF5; margin:10px; min-height: 125px; width: 500px;">
|
11
13
|
<div style="float:left; margin-right:7px; border: thin solid #D4E4EA; background-color: white; max-height: 119px;">
|
12
14
|
<img src="<%= root_url + @notification.notified_object.sender.logo.url(:profile)%>" alt="<%=@notification.notified_object.sender.name%>">
|
@@ -25,7 +27,7 @@
|
|
25
27
|
</div>
|
26
28
|
<div style="padding: 10px 5px 5px 5px;">
|
27
29
|
<p>
|
28
|
-
|
30
|
+
<%= raw t('notification.visit', :url=> link_to(notifications_url,notifications_url))%>
|
29
31
|
</p>
|
30
32
|
</div>
|
31
33
|
</div>
|
@@ -1,7 +1,9 @@
|
|
1
|
-
<% self.class.send :include,
|
1
|
+
<% self.class.send :include, SubjectsHelper, ActionView::Helpers::TextHelper %>
|
2
|
+
<%= t('notification.hello', :receiver => @receiver.name)%>
|
2
3
|
|
3
|
-
-----------------------------------------------
|
4
4
|
<%= render :partial => "notifications/activities/#{ @notification.notified_object.verb }",
|
5
5
|
:locals =>{:activity => @notification.notified_object}%>
|
6
|
+
|
7
|
+
|
6
8
|
-----------------------------------------------
|
7
|
-
|
9
|
+
<%= raw t('notification.visit', :url=> notifications_url)%>
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<div class="subject">
|
2
2
|
<%= raw t('notification.follow.'+ activity.receiver.subject.class.to_s.underscore,
|
3
|
-
|
4
|
-
|
5
|
-
|
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
6
|
</div>
|
7
7
|
<div class="briefing">
|
8
|
-
<%= link_to(t('notification.confirm', :sender => truncate_name(activity.sender.name)),
|
8
|
+
<%= raw link_to(t('notification.confirm', :sender => truncate_name(activity.sender.name)),
|
9
9
|
edit_contact_url(activity.receiver.contact_to!(activity.sender),:s => activity.receiver.slug)) %>
|
10
10
|
</div>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<%= raw t('notification.follow.'+ activity.receiver.subject.class.to_s.underscore,
|
2
|
-
|
3
|
-
|
4
|
-
|
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)%>
|
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', :sender => truncate_name(activity.sender.name))%>: <%=polymorphic_url(activity.sender.subject)%>
|
7
|
+
<%= raw t('notification.confirm', :sender => truncate_name(activity.sender.name)) %> <%= edit_contact_url(activity.receiver.contact_to!(activity.sender),
|
8
|
+
:s => activity.receiver.slug)%>
|
@@ -20,7 +20,7 @@
|
|
20
20
|
</div>
|
21
21
|
<div class="briefing">
|
22
22
|
<% if activity.direct_object.respond_to? :text %>
|
23
|
-
"<%= link_to(activity.direct_object.text.truncate(100, :separator =>' '),
|
23
|
+
"<%= link_to(sanitize(activity.direct_object.text.truncate(100, :separator =>' ')),
|
24
24
|
polymorphic_url( activity.direct_object))%>"
|
25
25
|
<% else%>
|
26
26
|
<%= link_to(t('notification.watch_it'),
|
@@ -3,19 +3,19 @@
|
|
3
3
|
:sender => truncate_name(activity.sender.name),
|
4
4
|
:whose => t('notification.whose.'+ activity.receiver.subject.class.to_s.underscore,
|
5
5
|
:receiver => truncate_name(activity.receiver.name)))%>
|
6
|
-
|
6
|
+
|
7
7
|
<% else %>
|
8
8
|
<%= raw t('notification.like.'+ activity.receiver.subject.class.to_s.underscore,
|
9
9
|
:sender => truncate_name(activity.sender.name),
|
10
10
|
:whose => t('notification.whose.'+ activity.receiver.subject.class.to_s.underscore,
|
11
11
|
:receiver => truncate_name(activity.receiver.name)),
|
12
12
|
:thing => t(activity.direct_object.class.to_s.underscore+'.name')) %>
|
13
|
-
|
13
|
+
|
14
14
|
<% if activity.direct_object.respond_to? :text %>
|
15
|
-
"<%= activity.direct_object.text.truncate(100, :separator =>' ')%>"
|
16
|
-
|
15
|
+
"<%= sanitize(activity.direct_object.text.truncate(100, :separator =>' '))%>"
|
16
|
+
<%= raw t('notification.all_text', :url => polymorphic_url(activity.direct_object))%>
|
17
17
|
<% else%>
|
18
|
-
--><%= t('notification.watch', :url => polymorphic_url( activity.direct_object))%>
|
18
|
+
--><%= raw t('notification.watch', :url => polymorphic_url( activity.direct_object))%>
|
19
19
|
<%end%>
|
20
20
|
<% end %>
|
21
21
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%= raw t('notification.makefriend.'+ activity.receiver.subject.class.to_s.underscore,
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
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
6
|
<%= raw t('notification.look',
|
7
|
-
|
7
|
+
:sender => truncate_name(activity.sender.name)) %>: <%=polymorphic_url(activity.sender.subject)%>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
</div>
|
10
10
|
<div class="briefing">
|
11
11
|
<% if activity.direct_object.respond_to? :text %>
|
12
|
-
"<%= link_to(activity.direct_object.text.truncate(100, :separator =>' '),
|
12
|
+
"<%= link_to(sanitize(activity.direct_object.text.truncate(100, :separator =>' ')),
|
13
13
|
polymorphic_url(activity.direct_object))%>"
|
14
14
|
<% else%>
|
15
15
|
<%= link_to(t('notification.watch_it'),
|
@@ -1,13 +1,13 @@
|
|
1
1
|
|
2
2
|
<%= raw t('notification.post.'+ activity.receiver.subject.class.to_s.underscore,
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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
8
|
|
9
9
|
<% if activity.direct_object.respond_to? :text %>
|
10
|
-
"<%=activity.direct_object.text.truncate(100, :separator =>' ')%>"
|
10
|
+
"<%= sanitize(activity.direct_object.text.truncate(100, :separator =>' '))%>"
|
11
11
|
--><%= t('notification.all_text', :url => polymorphic_url(activity.direct_object))%>
|
12
12
|
<% else%>
|
13
13
|
<%= t('notification.watch', :url => polymorphic_url(activity.direct_object))%>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
</div>
|
10
10
|
<div class="briefing">
|
11
11
|
<% if activity.direct_object.respond_to? :text %>
|
12
|
-
"<%= link_to(activity.direct_object.text.truncate(100, :separator =>' '),
|
12
|
+
"<%= link_to(sanitize(activity.direct_object.text.truncate(100, :separator =>' ')),
|
13
13
|
polymorphic_url(activity.direct_object))%>"
|
14
14
|
<% else%>
|
15
15
|
<%= link_to(t('notification.watch_it'),
|
@@ -1,11 +1,11 @@
|
|
1
1
|
<%= raw t('notification.update.'+ activity.receiver.subject.class.to_s.underscore,
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
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
7
|
<% if activity.direct_object.respond_to? :text %>
|
8
|
-
"<%=activity.direct_object.text.truncate(100, :separator =>' ')%>"
|
8
|
+
"<%= sanitize activity.direct_object.text.truncate(100, :separator =>' ')%>"
|
9
9
|
--><%= t('notification.all_text', :url => polymorphic_url(activity.direct_object))%>
|
10
10
|
<% else%>
|
11
11
|
<%= t('notification.watch', :url => polymorphic_url( activity.direct_object))%>
|
data/base/config/locales/en.yml
CHANGED
@@ -276,11 +276,13 @@ en:
|
|
276
276
|
notification:
|
277
277
|
all_text: "Read the whole text at %{url}"
|
278
278
|
confirm: "Confirm %{sender} as contact?"
|
279
|
+
default: "You have a new notification"
|
279
280
|
destroy_sure: "Do you want to delete this notification?"
|
280
281
|
fan: "%{sender} is now %{whose} fan."
|
281
282
|
follow:
|
282
283
|
group: "%{sender} added %{who} as contact."
|
283
284
|
user: "%{sender} added %{who} as contact."
|
285
|
+
hello: "Hi %{receiver},"
|
284
286
|
like:
|
285
287
|
group: "%{sender} likes %{whose} %{thing}."
|
286
288
|
user: "%{sender} likes %{whose} %{thing}."
|
@@ -299,6 +301,7 @@ en:
|
|
299
301
|
update:
|
300
302
|
group: "%{sender} updated %{thing} in %{whose} wall."
|
301
303
|
user: "%{sender} updated %{thing} in %{whose} wall."
|
304
|
+
visit: "Visit %{url} and check all your notifications."
|
302
305
|
watch: "Watch it at %{url}"
|
303
306
|
watch_it: "Watch it!"
|
304
307
|
who:
|
data/base/config/locales/es.yml
CHANGED
@@ -85,6 +85,7 @@ es:
|
|
85
85
|
browse: "Descubrir"
|
86
86
|
button:
|
87
87
|
cancel: "Cancelar"
|
88
|
+
create: "Crear"
|
88
89
|
save: "Guardar"
|
89
90
|
update: "Actualizar"
|
90
91
|
comment:
|
@@ -158,9 +159,11 @@ es:
|
|
158
159
|
collaborate:
|
159
160
|
default: "Colabora"
|
160
161
|
sentence1: "Organice sus proyectos y actividades"
|
161
|
-
sentence2: "
|
162
|
+
sentence2: "Participe en grupos y conferencias"
|
163
|
+
sentence3: "Cree sus propios grupos y conferencias"
|
162
164
|
elements:
|
163
165
|
comments: "Comentarios"
|
166
|
+
conferences: "Conferencias"
|
164
167
|
networks: "Redes sociales"
|
165
168
|
organizers: "Organizadores"
|
166
169
|
participants: "Participantes"
|
@@ -241,13 +244,13 @@ es:
|
|
241
244
|
mark_as_read: "Marcar como leido"
|
242
245
|
message_mailer:
|
243
246
|
has_sent_new:
|
244
|
-
event: "ha
|
245
|
-
group: "ha
|
246
|
-
user: "te ha
|
247
|
+
event: "ha mandado un nuevo mensaje a %{receiver}"
|
248
|
+
group: "ha mandado un nuevo mensaje a %{receiver}"
|
249
|
+
user: "te ha mandado un nuevo mensaje"
|
247
250
|
has_sent_reply:
|
248
|
-
event: "ha
|
249
|
-
group: "ha
|
250
|
-
user: "te ha
|
251
|
+
event: "ha mandado una respuesta a %{receiver}"
|
252
|
+
group: "ha mandado una respuesta a %{receiver}"
|
253
|
+
user: "te ha mandado una respuesta"
|
251
254
|
subject_new: "%{subject}"
|
252
255
|
subject_reply: "%{subject}"
|
253
256
|
notification_mailer:
|
@@ -273,11 +276,13 @@ es:
|
|
273
276
|
notification:
|
274
277
|
all_text: "Lee el texto entero en %{url}"
|
275
278
|
confirm: "¿Confirmar contacto con %{sender}?"
|
279
|
+
default: "Tienes una nueva notificación"
|
276
280
|
destroy_sure: "¿Borrar notificación?"
|
277
281
|
fan: "%{sender} es ahora fan %{whose}."
|
278
|
-
follow:
|
282
|
+
follow:
|
279
283
|
group: "%{sender} añadió a %{who} como contacto."
|
280
284
|
user: "%{sender} te añadió como contacto."
|
285
|
+
hello: "Hola %{receiver},"
|
281
286
|
like:
|
282
287
|
group: "A %{sender} le gusta el %{thing} %{whose}."
|
283
288
|
user: "A %{sender} le gusta tu %{thing}."
|
@@ -296,6 +301,7 @@ es:
|
|
296
301
|
update:
|
297
302
|
group: "%{sender} actualizó %{thing} en el muro %{whose}."
|
298
303
|
user: "%{sender} actualizó %{thing} en tu muro."
|
304
|
+
visit: "Visita %{url} y comprueba todas tus notificaciones."
|
299
305
|
watch: "Échale un vistazo en %{url}"
|
300
306
|
watch_it: "¡Échale un vistazo!"
|
301
307
|
who:
|
@@ -312,6 +318,8 @@ es:
|
|
312
318
|
name: "publicación"
|
313
319
|
one: "una publicación"
|
314
320
|
title: "Textos"
|
321
|
+
preposition:
|
322
|
+
and: "y"
|
315
323
|
profile:
|
316
324
|
one: "Perfil"
|
317
325
|
age: "Edad"
|
@@ -39,6 +39,8 @@ require 'modernizr-rails'
|
|
39
39
|
require 'thinking-sphinx'
|
40
40
|
# Syntactically Awesome Stylesheets
|
41
41
|
require 'sass-rails'
|
42
|
+
# Autolink text blocks
|
43
|
+
require 'rails_autolink'
|
42
44
|
|
43
45
|
# Provides your Rails application with social network and activity stream support
|
44
46
|
module SocialStream
|
@@ -50,6 +52,7 @@ module SocialStream
|
|
50
52
|
|
51
53
|
module Controllers
|
52
54
|
autoload :Helpers, 'social_stream/controllers/helpers'
|
55
|
+
autoload :CancanDeviseIntegration, 'social_stream/controllers/cancan_devise_integration'
|
53
56
|
end
|
54
57
|
|
55
58
|
module Models
|
@@ -21,9 +21,14 @@ module SocialStream
|
|
21
21
|
initializer "social_stream-base.controller_helpers" do
|
22
22
|
ActiveSupport.on_load(:action_controller) do
|
23
23
|
include SocialStream::Controllers::Helpers
|
24
|
+
include SocialStream::Controllers::CancanDeviseIntegration
|
24
25
|
end
|
25
26
|
end
|
26
27
|
|
28
|
+
initializer "social_stream-base.cancan_devise_integration" do
|
29
|
+
ApplicationController.rescue_handlers += [["CanCan::AccessDenied", :rescue_from_access_denied]]
|
30
|
+
end
|
31
|
+
|
27
32
|
initializer "social_stream-base.toolbar_config" do
|
28
33
|
SocialStream::ToolbarConfig.module_eval do
|
29
34
|
include SocialStream::ToolbarConfig::Base
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module SocialStream
|
2
|
+
module Controllers
|
3
|
+
# Common methods added to ApplicationController
|
4
|
+
module CancanDeviseIntegration
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
module InstanceMethods
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
# Redirect to login if the user is trying to access a protected resource
|
12
|
+
# and she is not authenticated
|
13
|
+
def rescue_from_access_denied
|
14
|
+
unless user_signed_in?
|
15
|
+
redirect_to new_user_session_path
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
@@ -51,8 +51,10 @@ Gem::Specification.new do |s|
|
|
51
51
|
s.add_runtime_dependency('modernizr-rails', '~> 2.0.6')
|
52
52
|
# Sphinx search engine
|
53
53
|
s.add_runtime_dependency('thinking-sphinx', '~> 2.0.8')
|
54
|
-
#Syntactically Awesome Stylesheets
|
54
|
+
# Syntactically Awesome Stylesheets
|
55
55
|
s.add_runtime_dependency('sass-rails', '~> 3.1.0')
|
56
|
+
# Autolink text blocks
|
57
|
+
s.add_runtime_dependency('rails_autolink', '~> 1.0.4')
|
56
58
|
|
57
59
|
# Development gem dependencies
|
58
60
|
#
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.files = `git ls-files`.split("\n")
|
13
13
|
|
14
14
|
# Gem dependencies
|
15
|
-
s.add_runtime_dependency('social_stream-base', '~> 0.9.
|
15
|
+
s.add_runtime_dependency('social_stream-base', '~> 0.9.29')
|
16
16
|
s.add_runtime_dependency('conference_manager-ruby', '~> 0.0.3')
|
17
17
|
|
18
18
|
# Development Gem dependencies
|
data/social_stream.gemspec
CHANGED
@@ -11,9 +11,9 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.files = `git ls-files`.split("\n")
|
12
12
|
|
13
13
|
# Gem dependencies
|
14
|
-
s.add_runtime_dependency('social_stream-base', '~> 0.9.
|
14
|
+
s.add_runtime_dependency('social_stream-base', '~> 0.9.29')
|
15
15
|
s.add_runtime_dependency('social_stream-documents', '~> 0.4.4')
|
16
|
-
s.add_runtime_dependency('social_stream-events', '~> 0.0.
|
16
|
+
s.add_runtime_dependency('social_stream-events', '~> 0.0.20')
|
17
17
|
|
18
18
|
# Development Gem dependencies
|
19
19
|
#
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_stream
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 33
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 12
|
9
|
-
-
|
10
|
-
version: 0.12.
|
9
|
+
- 7
|
10
|
+
version: 0.12.7
|
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-
|
19
|
+
date: 2011-11-16 00:00:00 +01:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -27,12 +27,12 @@ dependencies:
|
|
27
27
|
requirements:
|
28
28
|
- - ~>
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
hash:
|
30
|
+
hash: 1
|
31
31
|
segments:
|
32
32
|
- 0
|
33
33
|
- 9
|
34
|
-
-
|
35
|
-
version: 0.9.
|
34
|
+
- 29
|
35
|
+
version: 0.9.29
|
36
36
|
type: :runtime
|
37
37
|
version_requirements: *id001
|
38
38
|
- !ruby/object:Gem::Dependency
|
@@ -59,12 +59,12 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - ~>
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
hash:
|
62
|
+
hash: 55
|
63
63
|
segments:
|
64
64
|
- 0
|
65
65
|
- 0
|
66
|
-
-
|
67
|
-
version: 0.0.
|
66
|
+
- 20
|
67
|
+
version: 0.0.20
|
68
68
|
type: :runtime
|
69
69
|
version_requirements: *id003
|
70
70
|
- !ruby/object:Gem::Dependency
|
@@ -437,7 +437,6 @@ files:
|
|
437
437
|
- base/app/helpers/contacts_helper.rb
|
438
438
|
- base/app/helpers/groups_helper.rb
|
439
439
|
- base/app/helpers/location_helper.rb
|
440
|
-
- base/app/helpers/notifications_helper.rb
|
441
440
|
- base/app/helpers/permissions_helper.rb
|
442
441
|
- base/app/helpers/profiles_helper.rb
|
443
442
|
- base/app/helpers/search_helper.rb
|
@@ -668,12 +667,12 @@ files:
|
|
668
667
|
- base/lib/generators/social_stream/base/templates/navigation.rb
|
669
668
|
- base/lib/generators/social_stream/base/templates/relations.yml
|
670
669
|
- base/lib/generators/social_stream/base/templates/sphinx.yml
|
671
|
-
- base/lib/mailboxer/notification_decoder.rb
|
672
670
|
- base/lib/paperclip/social_stream.rb
|
673
671
|
- base/lib/social_stream-base.rb
|
674
672
|
- base/lib/social_stream/ability.rb
|
675
673
|
- base/lib/social_stream/base.rb
|
676
674
|
- base/lib/social_stream/base/version.rb
|
675
|
+
- base/lib/social_stream/controllers/cancan_devise_integration.rb
|
677
676
|
- base/lib/social_stream/controllers/helpers.rb
|
678
677
|
- base/lib/social_stream/d3.rb
|
679
678
|
- base/lib/social_stream/migrations/base.rb
|
@@ -1,89 +0,0 @@
|
|
1
|
-
module Mailboxer
|
2
|
-
module NotificationDecoder
|
3
|
-
include SubjectsHelper, ActionView::Helpers::TextHelper
|
4
|
-
def decode_notification notification_text, activity
|
5
|
-
return if activity.nil?
|
6
|
-
notification_text = notification_text.gsub(/\%\{sender\}/, link_to(truncate_name(activity.sender.name),
|
7
|
-
url_for(:controller=> activity.sender.subject.class.to_s.underscore.pluralize,
|
8
|
-
:action=> :show, :id=> activity.sender.subject.slug, :only_path => false)))
|
9
|
-
notification_text = notification_text.gsub(/\%\{confirm\}/,link_to(t('notification.confirm'),edit_contact_url(activity.receiver.contact_to!(activity.sender), :s => activity.receiver.slug)))
|
10
|
-
notification_text = notification_text.gsub(/\%\{look\}/,link_to(t('notification.look'),
|
11
|
-
url_for(:controller=> activity.sender.subject.class.to_s.underscore.pluralize,
|
12
|
-
:action=> :show, :id=> activity.sender.subject.slug, :only_path => false)))
|
13
|
-
notification_text = notification_text.gsub(/\%\{sender.name\}/,truncate_name(activity.sender.name))
|
14
|
-
|
15
|
-
if activity.receiver.subject.is_a?(User)
|
16
|
-
notification_text = notification_text.gsub(/\%\{whose\}/,t('notification.whose.user'))
|
17
|
-
notification_text = notification_text.gsub(/\%\{who\}/,t('notification.who.user'))
|
18
|
-
else
|
19
|
-
notification_text = notification_text.gsub(/\%\{whose\}/,t('notification.whose.others',
|
20
|
-
:receiver => truncate_name(activity.receiver.name)))
|
21
|
-
notification_text = notification_text.gsub(/\%\{who\}/,truncate_name(activity.receiver.name))
|
22
|
-
end
|
23
|
-
|
24
|
-
if activity.direct_object.present?
|
25
|
-
object = activity.direct_object
|
26
|
-
object = object.subject if object.is_a? Actor
|
27
|
-
notification_text=notification_text.gsub(/\%\{object\}/,link_to(t(object.class.to_s.underscore+".name"),
|
28
|
-
url_for(:controller=> object.class.to_s.underscore.pluralize, :action=> :show,
|
29
|
-
:id=> object.id, :only_path => false)))
|
30
|
-
notification_text=notification_text.gsub(/\%\{object.name\}/,t(object.class.to_s.underscore+".name"))
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
if object.respond_to? :text
|
35
|
-
notification_text=notification_text.gsub(/\%\{object.text\}/,link_to(object.text.truncate(100, :separator =>' '),
|
36
|
-
url_for(:controller=> object.class.to_s.underscore.pluralize, :action=> :show,
|
37
|
-
:id=> object.id, :only_path => false)))
|
38
|
-
elsif SocialStream.objects.include? :document and object.is_a? Document
|
39
|
-
notification_text=notification_text.gsub(/\%\{object.text\}/,link_to(object.file_file_name.truncate(100, :separator =>' '),
|
40
|
-
url_for(:controller=> object.class.to_s.underscore.pluralize, :action=> :show,
|
41
|
-
:id=> object.id, :only_path => false)))
|
42
|
-
|
43
|
-
end
|
44
|
-
#notification_text=notification_text.gsub(/\%\{object.image\}/,thumb_for(object)) if SocialStream.activity_forms.include? :document and object.is_a? Document
|
45
|
-
|
46
|
-
else
|
47
|
-
notification_text=notification_text.gsub(/\%\{object\}/,t('unknown'))
|
48
|
-
notification_text=notification_text.gsub(/\%\{object.name\}/,t('unknown'))
|
49
|
-
end
|
50
|
-
|
51
|
-
notification_text
|
52
|
-
end
|
53
|
-
|
54
|
-
def decode_basic_notification notification_text, activity
|
55
|
-
return if activity.nil?
|
56
|
-
notification_text = notification_text.gsub(/\%\{sender\}/, truncate_name(activity.sender.name))
|
57
|
-
notification_text = notification_text.gsub(/\%\{confirm\}/,t('notification.confirm'))
|
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))
|
61
|
-
notification_text = notification_text.gsub(/\%\{sender.name\}/,truncate_name(activity.sender.name))
|
62
|
-
|
63
|
-
if activity.receiver.subject.is_a?(User)
|
64
|
-
notification_text = notification_text.gsub(/\%\{whose\}/,t('notification.whose.user'))
|
65
|
-
notification_text = notification_text.gsub(/\%\{who\}/,t('notification.who.user'))
|
66
|
-
else
|
67
|
-
notification_text = notification_text.gsub(/\%\{whose\}/,t('notification.whose.others',
|
68
|
-
:receiver => truncate_name(activity.receiver.name)))
|
69
|
-
notification_text = notification_text.gsub(/\%\{who\}/,truncate_name(activity.receiver.name))
|
70
|
-
end
|
71
|
-
|
72
|
-
if activity.direct_object.present?
|
73
|
-
object = activity.direct_object
|
74
|
-
object = object.subject if object.is_a? Actor
|
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"))
|
77
|
-
notification_text=notification_text.gsub(/\%\{object.text\}/,object.text.truncate(100, :separator =>' ')) if object.respond_to? :text
|
78
|
-
|
79
|
-
#notification_text=notification_text.gsub(/\%\{object.image\}/,thumb_for(object)) if SocialStream.activity_forms.include? :document and object.is_a? Document
|
80
|
-
|
81
|
-
else
|
82
|
-
notification_text=notification_text.gsub(/\%\{object\}/,t('unknown'))
|
83
|
-
notification_text=notification_text.gsub(/\%\{object.name\}/,t('unknown'))
|
84
|
-
end
|
85
|
-
|
86
|
-
notification_text
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|