social_stream 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/base/app/assets/javascripts/social_stream/actor.js +7 -1
- data/base/app/assets/javascripts/social_stream/contact.js +8 -0
- data/base/app/assets/javascripts/social_stream/flash.js +11 -1
- data/base/app/controllers/groups_controller.rb +1 -1
- data/base/app/controllers/profiles_controller.rb +7 -2
- data/base/app/controllers/search_controller.rb +9 -11
- data/base/app/models/permission.rb +4 -3
- data/base/app/models/relation/custom.rb +5 -5
- data/base/app/models/user.rb +2 -0
- data/base/app/views/contacts/_new_modal.html.erb +2 -2
- data/base/app/views/contacts/index.html.erb +3 -2
- data/base/app/views/devise/registrations/edit.html.erb +1 -15
- data/base/app/views/groups/_form.html.erb +1 -1
- data/base/app/views/groups/_new_modal.html.erb +1 -1
- data/base/app/views/groups/new.html.erb +1 -1
- data/base/app/views/profiles/_comunication-info_edit.html.erb +1 -1
- data/base/app/views/profiles/_experience_edit.html.erb +2 -2
- data/base/app/views/profiles/_personal_edit.html.erb +3 -3
- data/base/app/views/relation/customs/destroy.js.erb +1 -0
- data/base/app/views/relation/customs/update.js.erb +1 -1
- data/base/app/views/settings/index.html.erb +1 -1
- data/base/config/locales/en.yml +3 -0
- data/base/config/locales/es.yml +1 -1
- data/base/lib/social_stream/base/autoload.rb +15 -8
- data/base/lib/social_stream/base/version.rb +1 -1
- data/base/lib/social_stream/population.rb +14 -0
- data/base/lib/social_stream/search.rb +4 -2
- data/base/lib/tasks/db/populate.rake +108 -160
- data/lib/social_stream/version.rb +1 -1
- data/oauth2_server/app/assets/images/logos/{app-default.png → medium/site.png} +0 -0
- data/oauth2_server/app/assets/stylesheets/social_stream/oauth2_server/applications/layout/_applications-oauth2server.css.sass +3 -0
- data/oauth2_server/app/assets/stylesheets/social_stream/oauth2_server/mixins/_mixin.css.sass +46 -1
- data/oauth2_server/app/controllers/site/clients_controller.rb +21 -2
- data/oauth2_server/app/views/site/clients/_list.html.erb +2 -0
- data/oauth2_server/app/views/site/clients/index.html.erb +9 -2
- data/oauth2_server/app/views/site/clients/show.html.erb +11 -12
- data/oauth2_server/config/locales/en.yml +2 -1
- data/oauth2_server/config/locales/es.yml +1 -1
- data/oauth2_server/lib/social_stream/oauth2_server/controllers/helpers.rb +4 -6
- data/oauth2_server/lib/social_stream/oauth2_server/version.rb +1 -1
- data/oauth2_server/social_stream-oauth2_server.gemspec +1 -1
- data/oauth2_server/spec/controllers/dummy_controller_spec.rb +9 -2
- data/social_stream.gemspec +2 -2
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 978d9e87fb278626d427da3ada3ffd333defe398
|
4
|
+
data.tar.gz: b230736937ad6c26148ea5e92b74ef9417089c44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a88183687d93df8c329a3d7b1f760150effe0ec36efd54d77fc66f7f805eabba11934223b50e9afe64896b0c126e1ac8ae56af678b6e98b3beb4e86cebb43b8a
|
7
|
+
data.tar.gz: 03bf445c73f5974b0daee3ae54b11b4767f534c92d2fea64b9ca86775e63583db17cdb6f3ba57f5cd0c0cfe4e69d1fb69fb8414243d0ca4472a517d830d37c84
|
@@ -3,6 +3,7 @@ SocialStream.Actor = (function(SS, $, undefined) {
|
|
3
3
|
var select2 = function(selector) {
|
4
4
|
$(selector).select2({
|
5
5
|
multiple: true,
|
6
|
+
minimumInputLength: 1,
|
6
7
|
ajax: {
|
7
8
|
url: $(selector).attr('data-path'),
|
8
9
|
dataType: 'json',
|
@@ -15,7 +16,8 @@ SocialStream.Actor = (function(SS, $, undefined) {
|
|
15
16
|
},
|
16
17
|
id: function(object) { return object.id.toString(); },
|
17
18
|
formatResult: select2FormatResult,
|
18
|
-
formatSelection: select2FormatSelection
|
19
|
+
formatSelection: select2FormatSelection,
|
20
|
+
initSelection: select2InitSelection
|
19
21
|
});
|
20
22
|
};
|
21
23
|
|
@@ -27,6 +29,10 @@ SocialStream.Actor = (function(SS, $, undefined) {
|
|
27
29
|
return '<img src="' + object.image.url + '"> ' + object.name;
|
28
30
|
};
|
29
31
|
|
32
|
+
var select2InitSelection = function(element, callback) {
|
33
|
+
callback([ { id: element.val(), name: element.attr('data-actor_name'), locked: true } ]);
|
34
|
+
};
|
35
|
+
|
30
36
|
return {
|
31
37
|
select2: select2
|
32
38
|
};
|
@@ -171,6 +171,13 @@ SocialStream.Contact = (function($, SS, undefined) {
|
|
171
171
|
|
172
172
|
// new_ callbacks
|
173
173
|
|
174
|
+
var initHideModal = function() {
|
175
|
+
$('#add-contact-modal').on('hide', function () {
|
176
|
+
$('input[name="actors"]').select2('close');
|
177
|
+
$('select[name="relations[]"]').select2('close');
|
178
|
+
});
|
179
|
+
};
|
180
|
+
|
174
181
|
var initActorSelect2 = function() {
|
175
182
|
SS.Actor.select2('input[name="actors"]');
|
176
183
|
};
|
@@ -298,6 +305,7 @@ SocialStream.Contact = (function($, SS, undefined) {
|
|
298
305
|
hideLoading);
|
299
306
|
|
300
307
|
callback.register('new_',
|
308
|
+
initHideModal,
|
301
309
|
initActorSelect2,
|
302
310
|
initRelationSelect2);
|
303
311
|
|
@@ -1,4 +1,8 @@
|
|
1
1
|
SocialStream.Flash = (function(Flashy, undefined) {
|
2
|
+
var notice = function(message) {
|
3
|
+
Flashy.message('notice', message);
|
4
|
+
};
|
5
|
+
|
2
6
|
var error = function(message) {
|
3
7
|
if (message === undefined) {
|
4
8
|
message = I18n.t('ajax.error');
|
@@ -11,8 +15,14 @@ SocialStream.Flash = (function(Flashy, undefined) {
|
|
11
15
|
Flashy.message('success', message);
|
12
16
|
};
|
13
17
|
|
18
|
+
var warning = function(message) {
|
19
|
+
Flashy.message('warning', message);
|
20
|
+
};
|
21
|
+
|
14
22
|
return {
|
23
|
+
notice: notice,
|
15
24
|
error: error,
|
16
|
-
success: success
|
25
|
+
success: success,
|
26
|
+
warning: warning
|
17
27
|
};
|
18
28
|
})(Flashy);
|
@@ -1,6 +1,8 @@
|
|
1
1
|
class ProfilesController < ApplicationController
|
2
2
|
before_filter :authenticate_user!, :except => [ :show ]
|
3
3
|
|
4
|
+
before_filter :authorize_update, except: [ :show ]
|
5
|
+
|
4
6
|
respond_to :html, :js
|
5
7
|
|
6
8
|
def show
|
@@ -14,11 +16,10 @@ class ProfilesController < ApplicationController
|
|
14
16
|
end
|
15
17
|
|
16
18
|
def edit
|
17
|
-
current_profile
|
18
19
|
end
|
19
20
|
|
20
21
|
def update
|
21
|
-
|
22
|
+
subject_profile.update_attributes profile_params
|
22
23
|
|
23
24
|
respond_to do |format|
|
24
25
|
format.html{ redirect_to [profile_subject, :profile] }
|
@@ -53,4 +54,8 @@ class ProfilesController < ApplicationController
|
|
53
54
|
|
54
55
|
current_subject.profile
|
55
56
|
end
|
57
|
+
|
58
|
+
def authorize_update
|
59
|
+
authorize! :update, subject_profile
|
60
|
+
end
|
56
61
|
end
|
@@ -45,17 +45,15 @@ class SearchController < ApplicationController
|
|
45
45
|
private
|
46
46
|
|
47
47
|
def search mode
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
end
|
48
|
+
page = ( mode == "quick" ? 1 : params[:page] )
|
49
|
+
limit = ( mode == "quick" ? 7 : RESULTS_SEARCH_PER_PAGE )
|
50
|
+
|
51
|
+
SocialStream::Search.search(params[:q],
|
52
|
+
current_subject,
|
53
|
+
mode: mode,
|
54
|
+
key: params[:type],
|
55
|
+
page: page,
|
56
|
+
limit: limit)
|
58
57
|
|
59
|
-
result
|
60
58
|
end
|
61
59
|
end
|
@@ -51,18 +51,19 @@ class Permission < ActiveRecord::Base
|
|
51
51
|
# if the class is not found
|
52
52
|
def available(subject)
|
53
53
|
class_name = subject.class.to_s.underscore
|
54
|
+
# TODO add further classes
|
54
55
|
base_class_name = subject.class.base_class.to_s.underscore
|
55
56
|
|
56
|
-
candidates = [ class_name
|
57
|
+
candidates = [ class_name ]
|
57
58
|
|
58
59
|
if class_name != base_class_name
|
59
|
-
candidates += [ base_class_name
|
60
|
+
candidates += [ base_class_name ]
|
60
61
|
end
|
61
62
|
|
62
63
|
list = nil
|
63
64
|
|
64
65
|
candidates.each do |n|
|
65
|
-
list = SocialStream.available_permissions[n]
|
66
|
+
list = SocialStream.available_permissions.with_indifferent_access[n]
|
66
67
|
|
67
68
|
break if list.present?
|
68
69
|
end
|
@@ -24,8 +24,8 @@ class Relation::Custom < Relation
|
|
24
24
|
class << self
|
25
25
|
def defaults_for(actor)
|
26
26
|
subject_type = actor.subject.class.to_s.underscore
|
27
|
-
|
28
|
-
|
27
|
+
|
28
|
+
cfg_rels = SocialStream.custom_relations.with_indifferent_access[subject_type]
|
29
29
|
|
30
30
|
if cfg_rels.nil?
|
31
31
|
raise "Undefined relations for subject type #{ subject_type }. Please, add an entry to config/initializers/social_stream.rb"
|
@@ -36,10 +36,10 @@ class Relation::Custom < Relation
|
|
36
36
|
cfg_rels.each_pair do |name, cfg_rel|
|
37
37
|
rels[name] =
|
38
38
|
create! :actor => actor,
|
39
|
-
:name => cfg_rel[
|
40
|
-
:receiver_type => cfg_rel[
|
39
|
+
:name => cfg_rel[:name],
|
40
|
+
:receiver_type => cfg_rel[:receiver_type]
|
41
41
|
|
42
|
-
if (ps = cfg_rel[
|
42
|
+
if (ps = cfg_rel[:permissions]).present?
|
43
43
|
ps.each do |p|
|
44
44
|
p.push(nil) if p.size == 1
|
45
45
|
|
data/base/app/models/user.rb
CHANGED
@@ -6,10 +6,10 @@
|
|
6
6
|
</div>
|
7
7
|
<div class="modal-body">
|
8
8
|
<%= label_tag 'actors', t('actor.title.other') %>
|
9
|
-
<%= text_field_tag 'actors', '', 'data-path' => actors_path(stranger: true, sender_id: Actor.normalize_id(sender)), 'data-type' => Array.wrap(type).compact.join(',') %>
|
9
|
+
<%= text_field_tag 'actors', '', 'data-path' => actors_path(stranger: true, sender_id: Actor.normalize_id(sender)), 'data-type' => Array.wrap(type).compact.join(','), placeholder: t('contact.new.modal.placeholder.actors') %>
|
10
10
|
|
11
11
|
<%= label_tag 'relations', t('activerecord.attributes.contact.relation_ids') %>
|
12
|
-
<%= select_tag 'relations', contact_select_options(sender.options_for_contact_select), multiple: true %>
|
12
|
+
<%= select_tag 'relations', contact_select_options(sender.options_for_contact_select), multiple: true, "data-placeholder" => t('contact.new.modal.placeholder.actors') %>
|
13
13
|
</div>
|
14
14
|
<div class="modal-footer">
|
15
15
|
<%= submit_tag t('contact.new.modal.button') %>
|
@@ -20,10 +20,11 @@
|
|
20
20
|
<div id="<%= type %>" class="tab-pane <%= 'active' if current_contact_section?(type) %>">
|
21
21
|
<%= text_field_tag "contact-filter-#{ type }", (current_contact_section?(type) ? params[:q] : ""), class: "pull-right contact-filter", placeholder: "filter", autocomplete: "off" %>
|
22
22
|
|
23
|
-
<% if type == :group %>
|
23
|
+
<% if user_signed_in? && type == :group %>
|
24
24
|
<%= link_to t('group.new.link'), new_group_path, class: 'new_group-modal-link', 'data-toggle' => 'modal' %>
|
25
25
|
|
26
|
-
<%= render partial: 'groups/new_modal'
|
26
|
+
<%= render partial: 'groups/new_modal',
|
27
|
+
locals: { resource_class: Group } %>
|
27
28
|
<% end %>
|
28
29
|
|
29
30
|
<div class="contact-list">
|
@@ -1,15 +1 @@
|
|
1
|
-
<%=
|
2
|
-
link_to(t('settings.main'), settings_path)
|
3
|
-
) %>
|
4
|
-
|
5
|
-
<h2>
|
6
|
-
<%= t('settings.for')%> <%= current_subject.name %>
|
7
|
-
</h2>
|
8
|
-
|
9
|
-
<%= render :partial => "edit_user"%>
|
10
|
-
<%= render :partial => "settings/language" %>
|
11
|
-
<%= render :partial => "settings/notifications" %>
|
12
|
-
<% if current_subject.respond_to? :authentication_token%>
|
13
|
-
<%= render :partial => "settings/api_key" %>
|
14
|
-
<% end %>
|
15
|
-
<%= render :partial => "delete_account"%>
|
1
|
+
<%= render template: 'settings/index' %>
|
@@ -18,7 +18,7 @@
|
|
18
18
|
</section>
|
19
19
|
<section class="owners">
|
20
20
|
<%= f.label :owners %>
|
21
|
-
<%= f.hidden_field :owners, 'data-path' => actors_path(format: :json) %>
|
21
|
+
<%= f.hidden_field :owners, 'data-path' => actors_path(format: :json), "data-actor_name" => current_subject.name %>
|
22
22
|
</section>
|
23
23
|
<section class="tags">
|
24
24
|
<%= f.label :tags_list %>
|
@@ -1,10 +1,10 @@
|
|
1
|
-
<%= form_for(@profile, :url => [
|
1
|
+
<%= form_for(@profile, :url => [@profile.subject, :profile]) do |f| %>
|
2
2
|
<span class="required">*</span>
|
3
3
|
<%= f.label :name %>
|
4
4
|
|
5
5
|
<%= f.text_field :name, :class => "required" %>
|
6
6
|
|
7
|
-
<%= f.label :description, t("profile.#{
|
7
|
+
<%= f.label :description, t("profile.#{ f.object.subject.class.to_s.downcase }.about") %>
|
8
8
|
|
9
9
|
<%= f.text_area :description, :maxlength => 200, :rows => 10 %>
|
10
10
|
|
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
<%= f.text_field :organization %>
|
14
14
|
|
15
|
-
<%= f.label :birthday, t('profile.' +
|
15
|
+
<%= f.label :birthday, t('profile.' + f.object.subject.class.to_s.downcase + '.birthday') %>
|
16
16
|
|
17
17
|
<%= date_select "profile", "birthday", :order => [:day, :month, :year], :end_year => Date.today.year, :start_year => (Date.today.year - 100), :prompt => {:day => 'Day', :month => 'Month', :year => 'Year'} %>
|
18
18
|
|
data/base/config/locales/en.yml
CHANGED
data/base/config/locales/es.yml
CHANGED
@@ -586,7 +586,7 @@ es:
|
|
586
586
|
query: Más resultados para %{query} >
|
587
587
|
name: Buscar
|
588
588
|
no_subject_found: No se encontró a %{subject}.
|
589
|
-
nothing: No se ha
|
589
|
+
nothing: No se ha encontrado nada.
|
590
590
|
searching: 'Buscando: %{query}'
|
591
591
|
show_all: Todos
|
592
592
|
write: Escribe tu búsqueda...
|
@@ -1,17 +1,16 @@
|
|
1
1
|
module SocialStream
|
2
|
+
|
2
3
|
autoload :Ability, 'social_stream/ability'
|
3
4
|
autoload :ActivityStreams, 'social_stream/activity_streams'
|
5
|
+
|
4
6
|
module ActivityStreams
|
5
7
|
autoload :Supertype, 'social_stream/activity_streams/supertype'
|
6
8
|
autoload :Subtype, 'social_stream/activity_streams/subtype'
|
7
9
|
end
|
10
|
+
|
8
11
|
module Base
|
9
12
|
autoload :Ability, 'social_stream/base/ability'
|
10
13
|
end
|
11
|
-
autoload :D3, 'social_stream/d3'
|
12
|
-
autoload :Populate, 'social_stream/populate'
|
13
|
-
autoload :Relations, 'social_stream/relations'
|
14
|
-
autoload :TestHelpers, 'social_stream/test_helpers'
|
15
14
|
|
16
15
|
module Controllers
|
17
16
|
autoload :Authorship, 'social_stream/controllers/authorship'
|
@@ -23,6 +22,8 @@ module SocialStream
|
|
23
22
|
autoload :Subjects, 'social_stream/controllers/subjects'
|
24
23
|
end
|
25
24
|
|
25
|
+
autoload :D3, 'social_stream/d3'
|
26
|
+
|
26
27
|
module Devise
|
27
28
|
module Controllers
|
28
29
|
autoload :UserSignIn, 'social_stream/devise/controllers/user_sign_in'
|
@@ -36,6 +37,8 @@ module SocialStream
|
|
36
37
|
autoload :Supertype, 'social_stream/models/supertype'
|
37
38
|
end
|
38
39
|
|
40
|
+
autoload :Population, 'social_stream/population'
|
41
|
+
|
39
42
|
module Population
|
40
43
|
autoload :ActivityObject, 'social_stream/population/activity_object'
|
41
44
|
autoload :Actor, 'social_stream/population/actor'
|
@@ -43,6 +46,8 @@ module SocialStream
|
|
43
46
|
autoload :Timestamps, 'social_stream/population/timestamps'
|
44
47
|
end
|
45
48
|
|
49
|
+
autoload :Relations, 'social_stream/relations'
|
50
|
+
|
46
51
|
module Routing
|
47
52
|
module Constraints
|
48
53
|
autoload :Custom, 'social_stream/routing/constraints/custom'
|
@@ -53,12 +58,14 @@ module SocialStream
|
|
53
58
|
|
54
59
|
autoload :Search, 'social_stream/search'
|
55
60
|
|
56
|
-
|
57
|
-
autoload :List, 'social_stream/views/list'
|
58
|
-
autoload :Location, 'social_stream/views/location'
|
59
|
-
end
|
61
|
+
autoload :TestHelpers, 'social_stream/test_helpers'
|
60
62
|
|
61
63
|
module TestHelpers
|
62
64
|
autoload :Controllers, 'social_stream/test_helpers/controllers'
|
63
65
|
end
|
66
|
+
|
67
|
+
module Views
|
68
|
+
autoload :List, 'social_stream/views/list'
|
69
|
+
autoload :Location, 'social_stream/views/location'
|
70
|
+
end
|
64
71
|
end
|