social_stream-base 2.1.0 → 2.2.0
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.
- checksums.yaml +4 -4
- data/app/assets/images/flags/de.png +0 -0
- data/app/assets/images/flags/fr.png +0 -0
- data/app/assets/images/flags/hu.png +0 -0
- data/app/assets/images/flags/nl.png +0 -0
- data/app/assets/javascripts/social_stream/actor.js +34 -0
- data/app/assets/javascripts/social_stream/contact.js +40 -5
- data/app/assets/javascripts/social_stream/flash.js +6 -1
- data/app/assets/javascripts/social_stream/group.js +6 -5
- data/app/assets/javascripts/social_stream/relation_customs.js +0 -1
- data/app/assets/stylesheets/social_stream/base/adjust/layout/_adjust.css.sass +3 -0
- data/app/assets/stylesheets/social_stream/base/buttons/_buttons.scss.sass +0 -2
- data/app/assets/stylesheets/social_stream/base/contacts/_contacts.css.sass +1 -11
- data/app/assets/stylesheets/social_stream/base/contacts/layouts/_contacts.css.sass +1 -29
- data/app/assets/stylesheets/social_stream/base/layouts/_header.css.sass +0 -1
- data/app/assets/stylesheets/social_stream/base/mixins/_buttons.css.sass +5 -0
- data/app/assets/stylesheets/social_stream/base/mixins/_layout.css.sass +36 -7
- data/app/controllers/actors_controller.rb +25 -0
- data/app/controllers/contacts_controller.rb +38 -8
- data/app/controllers/groups_controller.rb +2 -21
- data/app/controllers/profiles_controller.rb +4 -0
- data/app/controllers/settings_controller.rb +12 -2
- data/app/controllers/users_controller.rb +0 -8
- data/app/helpers/contacts_helper.rb +8 -0
- data/app/models/activity.rb +19 -6
- data/app/models/actor.rb +49 -11
- data/app/models/contact.rb +12 -5
- data/app/models/group.rb +13 -11
- data/app/models/permission.rb +30 -0
- data/app/models/relation.rb +17 -7
- data/app/models/relation/custom.rb +2 -40
- data/app/models/relation/follow.rb +8 -2
- data/app/models/relation/owner.rb +10 -0
- data/app/models/relation/single.rb +7 -4
- data/app/models/site.rb +1 -1
- data/app/models/tie.rb +8 -4
- data/app/views/contacts/_add_button.html.erb +9 -0
- data/app/views/contacts/_button.html.erb +3 -3
- data/app/views/contacts/_button_multiple.html.erb +4 -0
- data/app/views/contacts/_button_simple.html.erb +17 -0
- data/app/views/contacts/_new_modal.html.erb +22 -0
- data/app/views/contacts/destroy.js.erb +5 -4
- data/app/views/contacts/update.js.erb +5 -4
- data/app/views/devise/confirmations/new.html.erb +14 -9
- data/app/views/frontpage/_presentation.html.erb +2 -2
- data/app/views/groups/_form.html.erb +20 -20
- data/app/views/groups/show.html.erb +5 -5
- data/app/views/layouts/_header_dropdown_menu.html.erb +3 -5
- data/app/views/layouts/_header_signed_in.erb +3 -3
- data/app/views/layouts/_logo_in.html.erb +1 -1
- data/app/views/layouts/application.html.erb +2 -0
- data/app/views/permissions/_list.html.erb +1 -1
- data/app/views/profiles/_avatar.html.erb +1 -5
- data/app/views/profiles/_avatar_edit.html.erb +5 -0
- data/app/views/profiles/_comunication-info.html.erb +2 -36
- data/app/views/profiles/_comunication-info_edit.html.erb +27 -0
- data/app/views/profiles/_edit_icon.html.erb +0 -1
- data/app/views/profiles/_experience.html.erb +1 -6
- data/app/views/profiles/_experience_edit.html.erb +5 -0
- data/app/views/profiles/_personal.html.erb +1 -39
- data/app/views/profiles/_personal_edit.html.erb +31 -0
- data/app/views/profiles/_profile_edit.html.erb +7 -0
- data/app/views/profiles/_tags.html.erb +1 -4
- data/app/views/profiles/_tags_edit.html.erb +4 -0
- data/app/views/profiles/edit.html.erb +24 -0
- data/app/views/settings/_notifications.html.erb +12 -4
- data/app/views/users/show.html.erb +5 -5
- data/config/locales/de.yml +654 -0
- data/config/locales/en.yml +20 -9
- data/config/locales/es.yml +151 -140
- data/config/locales/fr.yml +656 -0
- data/config/locales/hu.yml +653 -0
- data/config/locales/nl.yml +656 -0
- data/config/locales/pt.yml +250 -239
- data/config/locales/rails.de.yml +203 -0
- data/config/locales/rails.fr.yml +222 -0
- data/config/locales/rails.hu.yml +199 -0
- data/config/locales/rails.nl.yml +199 -0
- data/config/locales/zh.yml +214 -202
- data/config/routes.rb +22 -30
- data/db/migrate/20130708152633_set_group_owners.rb +19 -0
- data/db/migrate/20130723133530_actor_notification_settings.rb +10 -0
- data/lib/generators/social_stream/base/templates/initializer.rb +13 -7
- data/lib/rails/social_stream.rb +2 -0
- data/lib/social_stream/base.rb +27 -7
- data/lib/social_stream/base/ability.rb +3 -5
- data/lib/social_stream/base/autoload.rb +1 -0
- data/lib/social_stream/base/version.rb +1 -1
- data/lib/social_stream/controllers/authorship.rb +18 -0
- data/lib/social_stream/controllers/helpers.rb +18 -4
- data/lib/social_stream/controllers/objects.rb +2 -8
- data/lib/social_stream/controllers/subjects.rb +9 -2
- data/lib/social_stream/models/supertype.rb +2 -0
- data/lib/social_stream/population/activity_object.rb +6 -8
- data/lib/social_stream/routing/mapper.rb +52 -0
- data/social_stream-base.gemspec +4 -7
- data/spec/controllers/groups_controller_spec.rb +19 -8
- data/spec/controllers/posts_controller_spec.rb +114 -147
- data/spec/models/post_authorization_spec.rb +190 -204
- data/spec/models/post_spec.rb +17 -63
- data/vendor/assets/javascripts/bootstrap-multiselect.js +434 -127
- metadata +48 -29
- data/app/assets/javascripts/social_stream/follow.js +0 -28
- data/app/controllers/followers_controller.rb +0 -34
- data/app/helpers/followers_helper.rb +0 -5
- data/app/views/contacts/_link_follow.html.erb +0 -16
- data/app/views/followers/destroy.js.erb +0 -1
- data/app/views/followers/index.html.erb +0 -30
- data/app/views/followers/update.js.erb +0 -3
- data/app/views/frontpage/_characteristics.html.erb +0 -23
- data/lib/social_stream/routing/constraints/custom.rb +0 -11
- data/lib/social_stream/routing/constraints/follow.rb +0 -11
- data/spec/controllers/followers_controller_spec.rb +0 -37
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ee108a6d8f73b1340ebede2f72b76b88118d2ff6
|
|
4
|
+
data.tar.gz: 6da91ab7d4ab780895d3744e7eb53a3a21e52c35
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7084015f905d5a3dac7ddbca431996993eb9e945e93823c4abcf3e5e17e76ef3c7713ee6a4e088baa0112a1602fd6896ca9db1b683afe9c5550bff6011ac97d6
|
|
7
|
+
data.tar.gz: 59559a542cab6358dd8b10836a1cde1367da7c8967c7ae5e90155593bcac81766ca2be3b6744cc888630d9871eda9249eb7cc4ca7ea4169b21db95eb01413cfc
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
SocialStream.Actor = (function(SS, $, undefined) {
|
|
2
|
+
// Select2
|
|
3
|
+
var select2 = function(selector) {
|
|
4
|
+
$(selector).select2({
|
|
5
|
+
multiple: true,
|
|
6
|
+
ajax: {
|
|
7
|
+
url: $(selector).attr('data-path'),
|
|
8
|
+
dataType: 'json',
|
|
9
|
+
data: function(term, page) {
|
|
10
|
+
return { q: term, page: page, type: $(selector).attr('data-type') };
|
|
11
|
+
},
|
|
12
|
+
results: function(data, page) {
|
|
13
|
+
return { results: data };
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
id: function(object) { return object.id.toString(); },
|
|
17
|
+
formatResult: select2FormatResult,
|
|
18
|
+
formatSelection: select2FormatSelection
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
var select2FormatSelection = function(object, container, query) {
|
|
23
|
+
return object.name;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var select2FormatResult = function(object, container) {
|
|
27
|
+
return '<img src="' + object.image.url + '"> ' + object.name;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
select2: select2
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
})(SocialStream, jQuery);
|
|
@@ -35,7 +35,7 @@ SocialStream.Contact = (function($, SS, undefined) {
|
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var initMultipleButtons = function() {
|
|
39
39
|
$('.edit_contact select[name*="relation_ids"]').multiselect({
|
|
40
40
|
buttonClass: 'btn btn-small',
|
|
41
41
|
buttonText: relationSelectText
|
|
@@ -169,6 +169,18 @@ SocialStream.Contact = (function($, SS, undefined) {
|
|
|
169
169
|
$('html').on('click.dropdown.data-api', saveForms);
|
|
170
170
|
};
|
|
171
171
|
|
|
172
|
+
// new_ callbacks
|
|
173
|
+
|
|
174
|
+
var initActorSelect2 = function() {
|
|
175
|
+
SS.Actor.select2('input[name="actors"]');
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
var initRelationSelect2 = function() {
|
|
179
|
+
$('select[name="relations[]"]').select2();
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
// update callbacks
|
|
183
|
+
|
|
172
184
|
var updateForms = function(options) {
|
|
173
185
|
var forms = getForms(options.id);
|
|
174
186
|
|
|
@@ -211,7 +223,7 @@ SocialStream.Contact = (function($, SS, undefined) {
|
|
|
211
223
|
$(contact).fadeOut('slow', function() {
|
|
212
224
|
$(data).replaceAll(contact).fadeIn();
|
|
213
225
|
|
|
214
|
-
|
|
226
|
+
initMultipleButtons();
|
|
215
227
|
});
|
|
216
228
|
}
|
|
217
229
|
});
|
|
@@ -263,23 +275,46 @@ SocialStream.Contact = (function($, SS, undefined) {
|
|
|
263
275
|
callback([ { id: element.val(), name: element.attr('data-recipient-name') } ]);
|
|
264
276
|
};
|
|
265
277
|
|
|
278
|
+
var initSimpleButtons = function(){
|
|
279
|
+
$(".following-button").mouseenter(function(){
|
|
280
|
+
$(this).hide();
|
|
281
|
+
$(this).siblings(".unfollow-button").show();
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
$(".unfollow-button").mouseleave(function(){
|
|
285
|
+
$(this).hide();
|
|
286
|
+
$(this).siblings(".following-button").show();
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
$(".unfollow-button").hide();
|
|
290
|
+
};
|
|
291
|
+
|
|
266
292
|
callback.register('index',
|
|
267
293
|
initTabs,
|
|
268
|
-
|
|
294
|
+
initMultipleButtons,
|
|
295
|
+
initSimpleButtons,
|
|
269
296
|
initFilter,
|
|
270
297
|
initNewGroupModal,
|
|
271
298
|
hideLoading);
|
|
272
299
|
|
|
300
|
+
callback.register('new_',
|
|
301
|
+
initActorSelect2,
|
|
302
|
+
initRelationSelect2);
|
|
303
|
+
|
|
273
304
|
callback.register('update',
|
|
274
305
|
updateForms,
|
|
275
306
|
replaceContact,
|
|
307
|
+
initSimpleButtons,
|
|
276
308
|
checkAndHideContact);
|
|
277
309
|
|
|
278
|
-
callback.register('destroy',
|
|
310
|
+
callback.register('destroy',
|
|
311
|
+
initSimpleButtons,
|
|
312
|
+
hideContact);
|
|
279
313
|
|
|
280
314
|
// FIXME There is probably a more efficient way to do this..
|
|
281
315
|
$(function() {
|
|
282
|
-
|
|
316
|
+
initMultipleButtons();
|
|
317
|
+
initSimpleButtons();
|
|
283
318
|
initContactFormsHtmlListener();
|
|
284
319
|
});
|
|
285
320
|
|
|
@@ -7,7 +7,12 @@ SocialStream.Flash = (function(Flashy, undefined) {
|
|
|
7
7
|
Flashy.message('error', message);
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
+
var success = function(message) {
|
|
11
|
+
Flashy.message('success', message);
|
|
12
|
+
};
|
|
13
|
+
|
|
10
14
|
return {
|
|
11
|
-
error: error
|
|
15
|
+
error: error,
|
|
16
|
+
success: success
|
|
12
17
|
};
|
|
13
18
|
})(Flashy);
|
|
@@ -4,20 +4,21 @@
|
|
|
4
4
|
//= require jquery.ba-url
|
|
5
5
|
//
|
|
6
6
|
//= require social_stream/callback
|
|
7
|
+
//= require social_stream/actor
|
|
7
8
|
|
|
8
9
|
SocialStream.Group = (function(SS, $, undefined){
|
|
9
10
|
var callback = new SS.Callback();
|
|
10
11
|
|
|
11
|
-
var initParticipants = function() {
|
|
12
|
-
SS.
|
|
12
|
+
var initParticipants = function(options) {
|
|
13
|
+
SS.Actor.select2(options.form + ' input[name$="[owners]"]');
|
|
13
14
|
};
|
|
14
15
|
|
|
15
|
-
var initTags = function() {
|
|
16
|
-
SS.Tag.select2("
|
|
16
|
+
var initTags = function(options) {
|
|
17
|
+
SS.Tag.select2(options.form + ' input[name$="[tag_list]"]');
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
var initValidate = function(options){
|
|
20
|
-
$.each(options.
|
|
21
|
+
$.each($(options.form), function(i, opt){
|
|
21
22
|
$(opt.form).validate({errorClass: opt.errorClass});
|
|
22
23
|
});
|
|
23
24
|
};
|
|
@@ -78,7 +78,6 @@ SocialStream.RelationCustom = (function(SS, $, undefined){
|
|
|
78
78
|
$('#permissions').find('.relation_permissions').hide();
|
|
79
79
|
|
|
80
80
|
if (radioInput.attr('data-loaded')) {
|
|
81
|
-
console.log('#relation_' + relVal + '_permissions');
|
|
82
81
|
$('#relation_' + relVal + '_permissions').show();
|
|
83
82
|
|
|
84
83
|
return;
|
|
@@ -60,35 +60,7 @@ input#group_name
|
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
.relation_customs
|
|
63
|
-
|
|
64
|
-
float: left
|
|
65
|
-
margin-left: 2.5%
|
|
66
|
-
.relation_list
|
|
67
|
-
@include makeColumn(3, 0)
|
|
68
|
-
padding-right: 5px
|
|
69
|
-
input
|
|
70
|
-
margin-right: 10px
|
|
71
|
-
label
|
|
72
|
-
display: inline-block
|
|
73
|
-
|
|
74
|
-
.actions
|
|
75
|
-
display: inline-block
|
|
76
|
-
float: right
|
|
77
|
-
margin-right: 10px
|
|
78
|
-
|
|
79
|
-
.edit_name
|
|
80
|
-
margin-top: -22px
|
|
81
|
-
.edit_relation_custom
|
|
82
|
-
margin-bottom: 0px
|
|
83
|
-
#relation_custom_name
|
|
84
|
-
width: 69% !important
|
|
85
|
-
margin-left: 23px
|
|
86
|
-
margin-top: -3px
|
|
87
|
-
.icon_tool16-ok
|
|
88
|
-
margin-top: -3px
|
|
89
|
-
|
|
90
|
-
.btn
|
|
91
|
-
margin-left: 32px
|
|
63
|
+
@include privacity
|
|
92
64
|
|
|
93
65
|
#relation_custom_name
|
|
94
66
|
width: 215px
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
@include ie7-restore-left-whitespace()
|
|
15
15
|
@include box-shadow(inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05))
|
|
16
16
|
@include transition(background 1s, color, 1s)
|
|
17
|
+
@include border-radius(7px)
|
|
18
|
+
|
|
17
19
|
a
|
|
18
20
|
color: $gray
|
|
19
21
|
|
|
@@ -65,6 +67,7 @@
|
|
|
65
67
|
@include ie7-restore-left-whitespace()
|
|
66
68
|
@include box-shadow(inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05))
|
|
67
69
|
@include transition(background 1s, color, 1s)
|
|
70
|
+
@include border-radius(7px)
|
|
68
71
|
a
|
|
69
72
|
color: $gray
|
|
70
73
|
|
|
@@ -138,6 +141,8 @@
|
|
|
138
141
|
.caret
|
|
139
142
|
border-top-color: $principal-btnColorborder
|
|
140
143
|
border-bottom-color: $principal-btnColorborder
|
|
144
|
+
margin-top: 8px
|
|
145
|
+
margin-left: 2px
|
|
141
146
|
&:hover
|
|
142
147
|
border-top-color: $auxiliarColor
|
|
143
148
|
border-bottom-color: $auxiliarColor
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
@mixin menuHorizontal
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
margin-left: 4em
|
|
2
|
+
list-style-type: none
|
|
3
|
+
margin-left: 4em
|
|
4
|
+
display: inline
|
|
5
|
+
li
|
|
7
6
|
display: inline
|
|
8
|
-
li
|
|
9
|
-
display: inline
|
|
10
7
|
|
|
11
8
|
@mixin makeColumnoMargin($columns:1, $offset: 0)
|
|
12
9
|
float: left
|
|
@@ -81,3 +78,35 @@
|
|
|
81
78
|
.add
|
|
82
79
|
margin-top: 2px
|
|
83
80
|
width: auto
|
|
81
|
+
|
|
82
|
+
@mixin privacity
|
|
83
|
+
width: 80%
|
|
84
|
+
float: left
|
|
85
|
+
margin-left: 2.5%
|
|
86
|
+
.relation_list
|
|
87
|
+
@include makeColumn(3, 0)
|
|
88
|
+
padding-right: 5px
|
|
89
|
+
border-right: 1px solid #c4c4c4
|
|
90
|
+
input
|
|
91
|
+
margin-right: 10px
|
|
92
|
+
label
|
|
93
|
+
display: inline-block
|
|
94
|
+
|
|
95
|
+
.actions
|
|
96
|
+
display: inline-block
|
|
97
|
+
float: right
|
|
98
|
+
margin-right: 10px
|
|
99
|
+
|
|
100
|
+
.edit_name
|
|
101
|
+
margin-top: -22px
|
|
102
|
+
.edit_relation_custom
|
|
103
|
+
margin-bottom: 0px
|
|
104
|
+
#relation_custom_name
|
|
105
|
+
width: 69% !important
|
|
106
|
+
margin-left: 23px
|
|
107
|
+
margin-top: -3px
|
|
108
|
+
.icon_tool16-ok
|
|
109
|
+
margin-top: -3px
|
|
110
|
+
|
|
111
|
+
.btn
|
|
112
|
+
margin-left: 32px
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
class ActorsController < ApplicationController
|
|
2
|
+
respond_to :json
|
|
3
|
+
|
|
4
|
+
def index
|
|
5
|
+
@actors = Actor.
|
|
6
|
+
name_search(params[:q]).
|
|
7
|
+
subject_type(params[:type])
|
|
8
|
+
|
|
9
|
+
if params[:stranger].present?
|
|
10
|
+
@actors = @actors.not_contacted_from(sender)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
@actors = @actors.page(params[:page])
|
|
14
|
+
|
|
15
|
+
render json: @actors, helper: self
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
private
|
|
19
|
+
|
|
20
|
+
def sender
|
|
21
|
+
@sender ||=
|
|
22
|
+
params[:sender_id] && Actor.find(params[:sender_id]) ||
|
|
23
|
+
current_subject
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
class ContactsController < ApplicationController
|
|
2
2
|
before_filter :authenticate_user!, except: [ :index ]
|
|
3
|
-
load_and_authorize_resource except: [ :index, :suggestion, :pending ]
|
|
4
|
-
before_filter :exclude_reflexive, except: [ :index, :suggestion, :pending ]
|
|
3
|
+
load_and_authorize_resource except: [ :index, :create, :suggestion, :pending ]
|
|
4
|
+
before_filter :exclude_reflexive, except: [ :index, :create, :suggestion, :pending ]
|
|
5
|
+
before_filter :create_authorization, only: [ :create ]
|
|
6
|
+
before_filter :create_filled_params, only: [ :create ]
|
|
5
7
|
|
|
6
8
|
helper_method :current_subject_contacts_to
|
|
7
9
|
|
|
@@ -18,6 +20,23 @@ class ContactsController < ApplicationController
|
|
|
18
20
|
end
|
|
19
21
|
end
|
|
20
22
|
|
|
23
|
+
def create
|
|
24
|
+
relation_ids = params[:relations].map(&:to_i)
|
|
25
|
+
|
|
26
|
+
params[:actors].split(',').each do |a|
|
|
27
|
+
c = profile_or_current_subject.contact_to!(a)
|
|
28
|
+
# Record who is manipulating the contact, mainly in groups
|
|
29
|
+
c.user_author = current_user
|
|
30
|
+
c.relation_ids = relation_ids
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
flash[:success] = t "contact.new.added.other",
|
|
34
|
+
actors: params[:actors].split(',').map{ |a| Actor.find(a).name }.to_sentence,
|
|
35
|
+
relations: relation_ids.map{ |r| Relation.find(r).name }.to_sentence
|
|
36
|
+
|
|
37
|
+
redirect_to request.referrer || { action: :index }
|
|
38
|
+
end
|
|
39
|
+
|
|
21
40
|
def update
|
|
22
41
|
# Record who is manipulating the contact, mainly in groups
|
|
23
42
|
@contact.user_author = current_user
|
|
@@ -92,11 +111,22 @@ class ContactsController < ApplicationController
|
|
|
92
111
|
end
|
|
93
112
|
end
|
|
94
113
|
|
|
95
|
-
def
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
114
|
+
def create_authorization
|
|
115
|
+
authorize! :create, Contact.new(sender: Actor.normalize(profile_or_current_subject!))
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
def create_filled_params
|
|
119
|
+
errors = []
|
|
120
|
+
|
|
121
|
+
%w( actors relations ).each do |p|
|
|
122
|
+
if params[p].blank?
|
|
123
|
+
errors << "#{ p } cannot be blank"
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if errors.present?
|
|
128
|
+
flash[:error] = errors.to_sentence
|
|
129
|
+
redirect_to action: :index
|
|
130
|
+
end
|
|
101
131
|
end
|
|
102
132
|
end
|