social_stream 0.23.4 → 0.24.0
Sign up to get free protection for your applications and to get access to all the features.
- data/base/app/assets/images/flags/pt.png +0 -0
- data/base/app/assets/javascripts/social_stream.toolbar.js +41 -0
- data/base/app/assets/stylesheets/settings.css +1 -0
- data/base/app/controllers/activity_actions_controller.rb +44 -0
- data/base/app/controllers/followers_controller.rb +39 -0
- data/base/app/helpers/activities_helper.rb +10 -10
- data/base/app/helpers/activity_actions_helper.rb +35 -0
- data/base/app/helpers/contacts_helper.rb +1 -1
- data/base/app/helpers/followers_helper.rb +5 -0
- data/base/app/helpers/toolbar_helper.rb +55 -68
- data/base/app/models/activity_action.rb +28 -0
- data/base/app/models/activity_object.rb +11 -2
- data/base/app/models/actor.rb +23 -33
- data/base/app/models/contact.rb +32 -43
- data/base/app/models/group.rb +2 -6
- data/base/app/models/relation.rb +1 -1
- data/base/app/models/relation/follow.rb +14 -0
- data/base/app/models/tie.rb +30 -30
- data/base/app/models/user.rb +8 -0
- data/base/app/views/activities/_options.html.erb +0 -1
- data/base/app/views/activity_actions/_follow_form.html.erb +10 -0
- data/base/app/views/activity_actions/_follow_sentence.html.erb +3 -0
- data/base/app/views/activity_actions/_update_form.js.erb +2 -0
- data/base/app/views/activity_actions/create.js.erb +1 -0
- data/base/app/views/activity_actions/update.js.erb +1 -0
- data/base/app/views/avatars/index.html.erb +1 -1
- data/base/app/views/cheesecake/index.html.erb +1 -1
- data/base/app/views/contacts/{_link.html.erb → _link_custom.html.erb} +0 -0
- data/base/app/views/contacts/_link_follow.html.erb +12 -0
- data/base/app/views/contacts/edit.html.erb +1 -1
- data/base/app/views/contacts/index.html.erb +1 -1
- data/base/app/views/contacts/index.js.erb +1 -1
- data/base/app/views/contacts/new.html.erb +1 -1
- data/base/app/views/conversations/index.html.erb +1 -1
- data/base/app/views/conversations/index.js.erb +1 -1
- data/base/app/views/conversations/show.html.erb +1 -1
- data/base/app/views/conversations/show.js.erb +1 -1
- data/base/app/views/devise/registrations/edit.html.erb +1 -1
- data/base/app/views/followers/destroy.js.erb +1 -0
- data/base/app/views/followers/index.html.erb +5 -0
- data/base/app/views/followers/update.js.erb +1 -0
- data/base/app/views/groups/_show.html.erb +1 -1
- data/base/app/views/groups/new.html.erb +1 -1
- data/base/app/views/layouts/_header_dropdown_menu.html.erb +5 -3
- data/base/app/views/messages/new.html.erb +1 -1
- data/base/app/views/messages/new.js.erb +1 -1
- data/base/app/views/objects/_show.html.erb +1 -1
- data/base/app/views/profiles/edit.html.erb +1 -1
- data/base/app/views/profiles/show.html.erb +1 -1
- data/base/app/views/relation/customs/index.html.erb +1 -1
- data/base/app/views/settings/index.html.erb +1 -1
- data/base/app/views/settings/index.js.erb +1 -0
- data/base/app/views/ties/index.html.erb +1 -1
- data/base/app/views/toolbar/_logo.html.erb +0 -7
- data/base/app/views/users/_show.html.erb +1 -1
- data/base/config/locales/en.yml +16 -6
- data/base/config/locales/es.yml +15 -6
- data/base/config/locales/pt.yml +507 -0
- data/base/config/locales/rails.pt.yml +192 -0
- data/base/config/routes.rb +20 -7
- data/base/db/migrate/20120316093946_create_activity_actions.rb +15 -0
- data/base/db/migrate/20120316113728_activity_action_follow.rb +23 -0
- data/base/lib/generators/social_stream/base/install_generator.rb +0 -4
- data/base/lib/generators/social_stream/base/templates/initializer.rb +7 -0
- data/base/lib/inherited_resources/social_stream.rb +18 -0
- data/base/lib/rails/social_stream.rb +23 -0
- data/base/lib/social_stream-base.rb +7 -3
- data/base/lib/social_stream/base/dependencies.rb +3 -2
- data/base/lib/social_stream/base/engine.rb +6 -6
- data/base/lib/social_stream/base/version.rb +1 -1
- data/base/lib/social_stream/models/channeled.rb +8 -0
- data/base/lib/social_stream/models/object.rb +1 -3
- data/base/lib/social_stream/models/subtype.rb +31 -25
- data/base/lib/social_stream/models/supertype.rb +54 -19
- data/base/lib/social_stream/views/toolbar/base.rb +143 -0
- data/base/lib/tasks/db/populate.rake +1 -1
- data/base/social_stream-base.gemspec +1 -3
- data/base/spec/dummy/config/initializers/social_stream.rb +7 -0
- data/base/spec/models/activity_action_spec.rb +26 -0
- data/base/spec/models/tie_spec.rb +2 -2
- data/documents/app/views/common_documents/_headers.html.erb +1 -1
- data/documents/lib/social_stream-documents.rb +4 -2
- data/documents/lib/social_stream/documents/engine.rb +3 -3
- data/documents/lib/social_stream/documents/version.rb +1 -1
- data/documents/lib/social_stream/views/toolbar/documents.rb +28 -0
- data/documents/social_stream-documents.gemspec +1 -1
- data/events/app/assets/javascripts/social_stream.event.js +33 -0
- data/events/app/assets/stylesheets/events.css.scss +37 -0
- data/events/app/views/events/_event.html.erb +3 -44
- data/events/app/views/events/_event_date.html.erb +20 -0
- data/events/app/views/events/_event_date_sidebar.html.erb +14 -0
- data/events/app/views/events/_event_details.html.erb +21 -0
- data/events/app/views/events/_event_poster.html.erb +9 -0
- data/events/app/views/events/_event_sidebar.html.erb +10 -0
- data/events/app/views/events/index.html.erb +1 -1
- data/events/app/views/events/index.js.erb +1 -1
- data/events/config/locales/en.yml +6 -0
- data/events/config/locales/es.yml +7 -0
- data/events/lib/social_stream/events/version.rb +1 -1
- data/events/social_stream-events.gemspec +2 -2
- data/lib/social_stream/version.rb +1 -1
- data/linkser/lib/social_stream/linkser/version.rb +1 -1
- data/linkser/social_stream-linkser.gemspec +1 -1
- data/presence/app/assets/images/games/sfighter/abobo/abobo.png +0 -0
- data/presence/app/assets/images/games/sfighter/abobo/abobo_block_81x130x1.png +0 -0
- data/presence/app/assets/images/games/sfighter/abobo/abobo_die_156x119x1.png +0 -0
- data/presence/app/assets/images/games/sfighter/abobo/abobo_hit_108x120x3.png +0 -0
- data/presence/app/assets/images/games/sfighter/abobo/abobo_idle_100x121x3.png +0 -0
- data/presence/app/assets/images/games/sfighter/abobo/abobo_kick_137x130x2.png +0 -0
- data/presence/app/assets/images/games/sfighter/abobo/abobo_punch_131x170x4.png +0 -0
- data/presence/app/assets/images/games/sfighter/abobo/abobo_walk_backward_94x126x6.png +0 -0
- data/presence/app/assets/images/games/sfighter/abobo/abobo_walk_forward_94x126x6.png +0 -0
- data/presence/app/assets/images/games/sfighter/cvs/cvs_block_69x99x2.png +0 -0
- data/presence/app/assets/images/games/sfighter/cvs/cvs_die_150x110x1.png +0 -0
- data/presence/app/assets/images/games/sfighter/cvs/cvs_hit_59x103x1.png +0 -0
- data/presence/app/assets/images/games/sfighter/cvs/cvs_idle_59x106x6.png +0 -0
- data/presence/app/assets/images/games/sfighter/cvs/cvs_kick_156x106x9.png +0 -0
- data/presence/app/assets/images/games/sfighter/cvs/cvs_punch_120x104x6.png +0 -0
- data/presence/app/assets/images/games/sfighter/cvs/cvs_walk_backward_58x106x5.png +0 -0
- data/presence/app/assets/images/games/sfighter/cvs/cvs_walk_forward_58x106x5.png +0 -0
- data/presence/app/assets/images/games/sfighter/stage/background1.png +0 -0
- data/presence/app/assets/images/games/sfighter/stage/background2.png +0 -0
- data/presence/app/assets/images/games/sfighter/stage/background3.png +0 -0
- data/presence/app/assets/images/games/sfighter/stage/foreground.png +0 -0
- data/presence/app/assets/images/games/sfighter/stage/ground.png +0 -0
- data/presence/app/assets/images/games/sfighter/thumbnail.png +0 -0
- data/presence/app/assets/images/games/ter/classic_circle.png +0 -0
- data/presence/app/assets/images/games/ter/classic_thumbnail.png +0 -0
- data/presence/app/assets/images/games/ter/modern_thumbnail.png +0 -0
- data/presence/app/assets/images/webcam.png +0 -0
- data/presence/app/assets/javascripts/jquery.ui.chatbox.sstreampresence.js +2 -2
- data/presence/app/assets/javascripts/presence_XmppClient.js.erb +3 -1
- data/presence/app/assets/javascripts/presence_game.js.erb +13 -6
- data/presence/app/assets/javascripts/presence_game_comunication.js.erb +83 -13
- data/presence/app/assets/javascripts/presence_game_factory.js.erb +47 -0
- data/presence/app/assets/javascripts/presence_game_interface.js.erb +143 -53
- data/presence/app/assets/javascripts/presence_game_sfighter.js.erb +583 -0
- data/presence/app/assets/javascripts/presence_game_ter.js.erb +20 -9
- data/presence/app/assets/javascripts/presence_uiManager.js.erb +0 -2
- data/presence/app/assets/javascripts/presence_utilities.js +1 -1
- data/presence/app/assets/javascripts/presence_videochat.js.erb +5 -0
- data/presence/app/assets/javascripts/social_stream-presence.js +1 -0
- data/presence/app/assets/stylesheets/chat.css.scss +59 -6
- data/presence/config/locales/en.yml +1 -1
- data/presence/config/locales/es.yml +1 -1
- data/presence/lib/social_stream-presence.rb +4 -0
- data/presence/lib/social_stream/presence/engine.rb +6 -0
- data/presence/lib/social_stream/presence/version.rb +1 -1
- data/presence/lib/social_stream/views/toolbar/presence.rb +28 -0
- data/presence/social_stream-presence.gemspec +1 -1
- data/social_stream.gemspec +5 -5
- metadata +92 -41
- data/base/app/assets/javascripts/toolbar.js +0 -22
- data/base/app/views/layouts/_settings.html.erb +0 -18
- data/base/app/views/toolbar/_home.html.erb +0 -15
- data/base/app/views/toolbar/_messages.html.erb +0 -15
- data/base/app/views/toolbar/_profile.html.erb +0 -28
- data/base/lib/generators/social_stream/base/templates/navigation.rb +0 -4
- data/base/lib/social_stream/toolbar_config/base.rb +0 -94
- data/documents/lib/social_stream/toolbar_config/documents.rb +0 -27
- data/events/lib/social_stream/toolbar_config/events.rb +0 -22
@@ -0,0 +1,192 @@
|
|
1
|
+
pt:
|
2
|
+
date:
|
3
|
+
abbr_day_names:
|
4
|
+
- dom
|
5
|
+
- seg
|
6
|
+
- ter
|
7
|
+
- qua
|
8
|
+
- qui
|
9
|
+
- sex
|
10
|
+
- sáb
|
11
|
+
abbr_month_names:
|
12
|
+
-
|
13
|
+
- jan
|
14
|
+
- fev
|
15
|
+
- mar
|
16
|
+
- abr
|
17
|
+
- mai
|
18
|
+
- jun
|
19
|
+
- jul
|
20
|
+
- ago
|
21
|
+
- set
|
22
|
+
- out
|
23
|
+
- nov
|
24
|
+
- dez
|
25
|
+
day_names:
|
26
|
+
- domingo
|
27
|
+
- segunda
|
28
|
+
- terça
|
29
|
+
- quarta
|
30
|
+
- quinta
|
31
|
+
- sexta
|
32
|
+
- sábado
|
33
|
+
formats:
|
34
|
+
default: ! '%d/%m/%Y'
|
35
|
+
long: ! '%d de %B de %Y'
|
36
|
+
short: ! '%d de %b'
|
37
|
+
month_names:
|
38
|
+
-
|
39
|
+
- janeiro
|
40
|
+
- fevereiro
|
41
|
+
- março
|
42
|
+
- abril
|
43
|
+
- maio
|
44
|
+
- junho
|
45
|
+
- julho
|
46
|
+
- agosto
|
47
|
+
- setembro
|
48
|
+
- outubro
|
49
|
+
- novembro
|
50
|
+
- dezembro
|
51
|
+
order:
|
52
|
+
- :dia
|
53
|
+
- :mês
|
54
|
+
- :ano
|
55
|
+
datetime:
|
56
|
+
distance_in_words:
|
57
|
+
about_x_hours:
|
58
|
+
one: aproximadamente 1 hora
|
59
|
+
other: aproximadamente %{count} horas
|
60
|
+
about_x_months:
|
61
|
+
one: aproximadamente 1 mês
|
62
|
+
other: aproximadamente %{count} meses
|
63
|
+
about_x_years:
|
64
|
+
one: aproximadamente 1 ano
|
65
|
+
other: aproximadamente %{count} anos
|
66
|
+
almost_x_years:
|
67
|
+
one: quase 1 ano
|
68
|
+
other: quase %{count} anos
|
69
|
+
half_a_minute: meio minuto
|
70
|
+
less_than_x_minutes:
|
71
|
+
one: menos de 1 minuto
|
72
|
+
other: menos de %{count} minutos
|
73
|
+
less_than_x_seconds:
|
74
|
+
one: menos de 1 segundo
|
75
|
+
other: menos de %{count} segundos
|
76
|
+
over_x_years:
|
77
|
+
one: mais de 1 ano
|
78
|
+
other: mais de %{count} anos
|
79
|
+
x_days:
|
80
|
+
one: 1 dia
|
81
|
+
other: ! '%{count} dias'
|
82
|
+
x_minutes:
|
83
|
+
one: 1 minuto
|
84
|
+
other: ! '%{count} minutos'
|
85
|
+
x_months:
|
86
|
+
one: 1 mês
|
87
|
+
other: ! '%{count} meses'
|
88
|
+
x_seconds:
|
89
|
+
one: 1 segundo
|
90
|
+
other: ! '%{count} segundos'
|
91
|
+
prompts:
|
92
|
+
day: Dia
|
93
|
+
hour: Hora
|
94
|
+
minute: Minuto
|
95
|
+
month: Mês
|
96
|
+
second: Segundo
|
97
|
+
year: Ano
|
98
|
+
errors:
|
99
|
+
format: ! '%{attribute} %{message}'
|
100
|
+
messages:
|
101
|
+
accepted: deve ser aceito
|
102
|
+
blank: não pode ficar em branco
|
103
|
+
confirmation: não está de acordo com a confirmação
|
104
|
+
empty: não pode ficar vazio
|
105
|
+
equal_to: deve ser igual a %{count}
|
106
|
+
even: deve ser par
|
107
|
+
exclusion: não está disponível
|
108
|
+
greater_than: deve ser maior que %{count}
|
109
|
+
greater_than_or_equal_to: deve ser maior ou igual a %{count}
|
110
|
+
inclusion: não está incluído na lista
|
111
|
+
invalid: não é válido
|
112
|
+
less_than: deve ser menor que %{count}
|
113
|
+
less_than_or_equal_to: deve ser menor ou igual a %{count}
|
114
|
+
not_a_number: não é um número
|
115
|
+
not_an_integer: não é um número inteiro
|
116
|
+
odd: deve ser ímpar
|
117
|
+
record_invalid: ! 'A validação falhou: %{errors}'
|
118
|
+
taken: já está em uso
|
119
|
+
too_long: ! 'é muito longo (máximo: %{count} caracteres)'
|
120
|
+
too_short: ! 'é muito curto (mínimo: %{count} caracteres)'
|
121
|
+
wrong_length: não possui o tamanho esperado (%{count} caracteres)
|
122
|
+
template:
|
123
|
+
body: ! 'Por favor, verifique o(s) seguinte(s) campo(s):'
|
124
|
+
header:
|
125
|
+
one: ! 'Não foi possível gravar %{model}: 1 erro'
|
126
|
+
other: ! 'Não foi possível gravar %{model}: %{count} erros.'
|
127
|
+
helpers:
|
128
|
+
select:
|
129
|
+
prompt: Por favor selecione
|
130
|
+
submit:
|
131
|
+
create: Criar %{model}
|
132
|
+
submit: Salvar %{model}
|
133
|
+
update: Atualizar %{model}
|
134
|
+
number:
|
135
|
+
currency:
|
136
|
+
format:
|
137
|
+
delimiter: .
|
138
|
+
format: ! '%u %n'
|
139
|
+
precision: 2
|
140
|
+
separator: ! ','
|
141
|
+
significant: false
|
142
|
+
strip_insignificant_zeros: false
|
143
|
+
unit: R$
|
144
|
+
format:
|
145
|
+
delimiter: .
|
146
|
+
precision: 3
|
147
|
+
separator: ! ','
|
148
|
+
significant: false
|
149
|
+
strip_insignificant_zeros: false
|
150
|
+
human:
|
151
|
+
decimal_units:
|
152
|
+
format: ! '%n %u'
|
153
|
+
units:
|
154
|
+
billion: bilhão
|
155
|
+
million: milhão
|
156
|
+
quadrillion: quatrilhão
|
157
|
+
thousand: mil
|
158
|
+
trillion: trilhão
|
159
|
+
unit: ''
|
160
|
+
format:
|
161
|
+
delimiter: ''
|
162
|
+
precision: 2
|
163
|
+
significant: true
|
164
|
+
strip_insignificant_zeros: true
|
165
|
+
storage_units:
|
166
|
+
format: ! '%n %u'
|
167
|
+
units:
|
168
|
+
byte:
|
169
|
+
one: Byte
|
170
|
+
other: Bytes
|
171
|
+
gb: GB
|
172
|
+
kb: KB
|
173
|
+
mb: MB
|
174
|
+
tb: TB
|
175
|
+
percentage:
|
176
|
+
format:
|
177
|
+
delimiter: ''
|
178
|
+
precision:
|
179
|
+
format:
|
180
|
+
delimiter: ''
|
181
|
+
support:
|
182
|
+
array:
|
183
|
+
last_word_connector: ! ', e '
|
184
|
+
two_words_connector: ! ' e'
|
185
|
+
words_connector: ! ', '
|
186
|
+
time:
|
187
|
+
am: ''
|
188
|
+
formats:
|
189
|
+
default: ! '%A, %d de %B de %Y, %H:%M h'
|
190
|
+
long: ! '%A, %d de %B de %Y, %H:%M h'
|
191
|
+
short: ! '%d/%m, %H:%M h'
|
192
|
+
pm: ''
|
data/base/config/routes.rb
CHANGED
@@ -40,16 +40,29 @@ Rails.application.routes.draw do
|
|
40
40
|
resources object.to_s.pluralize
|
41
41
|
end
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
case SocialStream.relation_model
|
44
|
+
when :follow
|
45
|
+
resources :followers
|
46
|
+
resources :contacts do
|
47
|
+
collection do
|
48
|
+
get 'pending'
|
49
|
+
end
|
50
|
+
end
|
51
|
+
when :custom
|
52
|
+
resources :contacts do
|
53
|
+
collection do
|
54
|
+
get 'pending'
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
namespace "relation" do
|
59
|
+
resources :customs
|
46
60
|
end
|
47
|
-
end
|
48
61
|
|
49
|
-
|
50
|
-
resources :customs
|
62
|
+
resources :permissions
|
51
63
|
end
|
52
|
-
|
64
|
+
|
65
|
+
resources :activity_actions
|
53
66
|
|
54
67
|
match 'tags' => 'tags#index', :as => 'tags'
|
55
68
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreateActivityActions < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :activity_actions do |t|
|
4
|
+
t.references :actor
|
5
|
+
t.references :activity_object
|
6
|
+
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
add_index :activity_actions, :actor_id
|
10
|
+
add_index :activity_actions, :activity_object_id
|
11
|
+
|
12
|
+
add_foreign_key "activity_actions", "actors", :name => "index_activity_actions_on_actor_id"
|
13
|
+
add_foreign_key "activity_actions", "activity_objects", :name => "index_activity_actions_on_activity_object_id"
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class ActivityActionFollow < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
add_column :activity_actions, :follow, :boolean, :default => false
|
4
|
+
add_column :activity_objects, :follower_count, :integer, :default => 0
|
5
|
+
remove_column :actors, :follower_count
|
6
|
+
|
7
|
+
ActivityObject.reset_column_information
|
8
|
+
Actor.reset_column_information
|
9
|
+
|
10
|
+
Tie.
|
11
|
+
joins(:relation).
|
12
|
+
with_permissions('follow', nil).
|
13
|
+
each do |t|
|
14
|
+
t.set_follow_action
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def down
|
19
|
+
remove_column :activity_actions, :follow
|
20
|
+
remove_column :activity_objects, :follower_count
|
21
|
+
add_column :actors, :follower_count, :integer, :default => 0
|
22
|
+
end
|
23
|
+
end
|
@@ -41,10 +41,6 @@ class SocialStream::Base::InstallGenerator < Rails::Generators::Base #:nodoc:
|
|
41
41
|
remove_file 'app/views/layouts/application.html.erb'
|
42
42
|
end
|
43
43
|
|
44
|
-
def create_navigation_config
|
45
|
-
copy_file 'navigation.rb', 'config/navigation.rb'
|
46
|
-
end
|
47
|
-
|
48
44
|
def require_javascripts
|
49
45
|
inject_into_file 'app/assets/javascripts/application.js',
|
50
46
|
"//= require social_stream-base\n",
|
@@ -20,6 +20,13 @@ SocialStream.setup do |config|
|
|
20
20
|
# You can write your own activity objects
|
21
21
|
#
|
22
22
|
# config.activity_forms = [ :post, :document, :foo, :bar ]
|
23
|
+
|
24
|
+
# Config the relation model of your network
|
25
|
+
#
|
26
|
+
# :custom - users define their own relation types, and post with privacy, like Google+
|
27
|
+
# :follow - user just follow other users, like Twitter
|
28
|
+
#
|
29
|
+
# config.relation_model = :custom
|
23
30
|
|
24
31
|
# Quick search (header) and Extended search models and its order. Remember to create
|
25
32
|
# the indexes with thinking-sphinx if you are using customized models.
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Monkey path inherited_resources
|
2
|
+
#
|
3
|
+
#
|
4
|
+
# Fix https://github.com/josevalim/inherited_resources/issues/216
|
5
|
+
module InheritedResources::BaseHelpers
|
6
|
+
private
|
7
|
+
|
8
|
+
def resource_params
|
9
|
+
@resource_params ||=
|
10
|
+
build_resource_params
|
11
|
+
end
|
12
|
+
|
13
|
+
def build_resource_params
|
14
|
+
rparams = [params[resource_request_name] || params[resource_instance_name] || {}]
|
15
|
+
rparams << as_role if role_given?
|
16
|
+
rparams
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Monkey patches to Ruby on Rails
|
2
|
+
#
|
3
|
+
# Use unix file util to prove the content type sent by the browser
|
4
|
+
class ActionDispatch::Http::UploadedFile
|
5
|
+
def initialize_with_magic(*args, &block)
|
6
|
+
initialize_without_magic(*args, &block)
|
7
|
+
|
8
|
+
if (unix_file = `which file`.chomp).present? && File.exists?(unix_file)
|
9
|
+
`#{ unix_file } -v 2>&1` =~ /^file-(.*)$/
|
10
|
+
version = $1
|
11
|
+
|
12
|
+
@content_type =
|
13
|
+
if version >= "4.24"
|
14
|
+
`#{ unix_file } -b --mime-type #{ @tempfile.path }`.chomp
|
15
|
+
else
|
16
|
+
`#{ unix_file } -bi #{ @tempfile.path }`.chomp =~ /(\w*\/[\w+-\.]*)/
|
17
|
+
$1
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
alias_method_chain :initialize, :magic
|
23
|
+
end
|
@@ -36,15 +36,16 @@ module SocialStream
|
|
36
36
|
module Sidebar
|
37
37
|
autoload :Base, 'social_stream/views/sidebar/base'
|
38
38
|
end
|
39
|
+
|
40
|
+
module Toolbar
|
41
|
+
autoload :Base, 'social_stream/views/toolbar/base'
|
42
|
+
end
|
39
43
|
end
|
40
44
|
|
41
45
|
module TestHelpers
|
42
46
|
autoload :Controllers, 'social_stream/test_helpers/controllers'
|
43
47
|
end
|
44
48
|
|
45
|
-
module ToolbarConfig
|
46
|
-
autoload :Base, 'social_stream/toolbar_config/base'
|
47
|
-
end
|
48
49
|
|
49
50
|
mattr_accessor :subjects
|
50
51
|
@@subjects = [ :user, :group ]
|
@@ -58,6 +59,9 @@ module SocialStream
|
|
58
59
|
|
59
60
|
mattr_accessor :activity_forms
|
60
61
|
@@activity_forms = [ :post ]
|
62
|
+
|
63
|
+
mattr_accessor :relation_model
|
64
|
+
@@relation_model = :custom
|
61
65
|
|
62
66
|
mattr_accessor :quick_search_models
|
63
67
|
@@quick_search_models = [ :user, :group, :post ]
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# Monkey path Ruby on Rails
|
2
|
+
require 'rails/social_stream'
|
1
3
|
# Database foreign keys
|
2
4
|
require 'foreigner'
|
3
5
|
# jQuery
|
@@ -14,6 +16,7 @@ require 'devise'
|
|
14
16
|
require 'cancan'
|
15
17
|
# REST controllers
|
16
18
|
require 'inherited_resources'
|
19
|
+
require 'inherited_resources/social_stream'
|
17
20
|
# Scopes in controllers
|
18
21
|
require 'has_scope'
|
19
22
|
# Logo attachments
|
@@ -33,8 +36,6 @@ require 'acts_as_taggable_on/social_stream'
|
|
33
36
|
require 'formtastic'
|
34
37
|
#Background tasks
|
35
38
|
require 'resque/server'
|
36
|
-
#Simple Navigation for menu
|
37
|
-
require 'simple-navigation'
|
38
39
|
# Modernizr.js library
|
39
40
|
require 'modernizr-rails'
|
40
41
|
# Sphinx search engine
|
@@ -35,12 +35,6 @@ module SocialStream
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
-
initializer "social_stream-base.toolbar_config" do
|
39
|
-
SocialStream::ToolbarConfig.module_eval do
|
40
|
-
include SocialStream::ToolbarConfig::Base
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
38
|
initializer "social_stream-base.views.settings" do
|
45
39
|
SocialStream::Views::Settings.module_eval do
|
46
40
|
include SocialStream::Views::Settings::Base
|
@@ -53,6 +47,12 @@ module SocialStream
|
|
53
47
|
end
|
54
48
|
end
|
55
49
|
|
50
|
+
initializer "social_stream-base.views.toolbar" do
|
51
|
+
SocialStream::Views::Toolbar.module_eval do
|
52
|
+
include SocialStream::Views::Toolbar::Base
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
56
|
initializer "social_stream-base.avatars_for_rails" do
|
57
57
|
AvatarsForRails.setup do |config|
|
58
58
|
config.avatarable_model = :actor
|
@@ -23,6 +23,8 @@ module SocialStream
|
|
23
23
|
subtype_of :channel,
|
24
24
|
:belongs => { :dependent => nil }
|
25
25
|
|
26
|
+
# before_validation :set_owner_id, :on => :create
|
27
|
+
|
26
28
|
before_validation :check_existing_channel
|
27
29
|
end
|
28
30
|
|
@@ -43,6 +45,12 @@ module SocialStream
|
|
43
45
|
|
44
46
|
self.channel = existing_channel
|
45
47
|
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def set_owner_id
|
52
|
+
self.owner_id ||= author_id
|
53
|
+
end
|
46
54
|
end
|
47
55
|
end
|
48
56
|
end
|