social_stream 2.1.1 → 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.
Files changed (188) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -2
  3. data/LICENSE +1 -1
  4. data/base/Rakefile +3 -17
  5. data/base/app/assets/images/flags/de.png +0 -0
  6. data/base/app/assets/images/flags/fr.png +0 -0
  7. data/base/app/assets/images/flags/hu.png +0 -0
  8. data/base/app/assets/images/flags/nl.png +0 -0
  9. data/base/app/assets/javascripts/social_stream/actor.js +34 -0
  10. data/base/app/assets/javascripts/social_stream/contact.js +40 -5
  11. data/base/app/assets/javascripts/social_stream/flash.js +6 -1
  12. data/base/app/assets/javascripts/social_stream/group.js +6 -5
  13. data/base/app/assets/javascripts/social_stream/relation_customs.js +0 -1
  14. data/base/app/assets/stylesheets/social_stream/base/adjust/layout/_adjust.css.sass +3 -0
  15. data/base/app/assets/stylesheets/social_stream/base/buttons/_buttons.scss.sass +0 -2
  16. data/base/app/assets/stylesheets/social_stream/base/contacts/_contacts.css.sass +1 -11
  17. data/base/app/assets/stylesheets/social_stream/base/contacts/layouts/_contacts.css.sass +1 -29
  18. data/base/app/assets/stylesheets/social_stream/base/layouts/_header.css.sass +0 -1
  19. data/base/app/assets/stylesheets/social_stream/base/mixins/_buttons.css.sass +5 -0
  20. data/base/app/assets/stylesheets/social_stream/base/mixins/_layout.css.sass +36 -7
  21. data/base/app/controllers/actors_controller.rb +25 -0
  22. data/base/app/controllers/contacts_controller.rb +38 -8
  23. data/base/app/controllers/groups_controller.rb +2 -21
  24. data/base/app/controllers/profiles_controller.rb +4 -0
  25. data/base/app/controllers/settings_controller.rb +12 -2
  26. data/base/app/controllers/users_controller.rb +0 -8
  27. data/base/app/helpers/contacts_helper.rb +8 -0
  28. data/base/app/models/activity.rb +19 -6
  29. data/base/app/models/actor.rb +49 -11
  30. data/base/app/models/contact.rb +12 -5
  31. data/base/app/models/group.rb +13 -11
  32. data/base/app/models/permission.rb +30 -0
  33. data/base/app/models/relation.rb +17 -7
  34. data/base/app/models/relation/custom.rb +2 -40
  35. data/base/app/models/relation/follow.rb +8 -2
  36. data/base/app/models/relation/owner.rb +10 -0
  37. data/base/app/models/relation/single.rb +7 -4
  38. data/base/app/models/site.rb +1 -1
  39. data/base/app/models/tie.rb +8 -4
  40. data/base/app/views/contacts/_add_button.html.erb +9 -0
  41. data/base/app/views/contacts/_button.html.erb +3 -3
  42. data/base/app/views/contacts/_button_multiple.html.erb +4 -0
  43. data/base/app/views/contacts/_button_simple.html.erb +17 -0
  44. data/base/app/views/contacts/_new_modal.html.erb +22 -0
  45. data/base/app/views/contacts/destroy.js.erb +5 -4
  46. data/base/app/views/contacts/update.js.erb +5 -4
  47. data/base/app/views/devise/confirmations/new.html.erb +14 -9
  48. data/base/app/views/frontpage/_presentation.html.erb +2 -2
  49. data/base/app/views/groups/_form.html.erb +20 -20
  50. data/base/app/views/groups/show.html.erb +5 -5
  51. data/base/app/views/layouts/_header_dropdown_menu.html.erb +3 -5
  52. data/base/app/views/layouts/_header_signed_in.erb +3 -3
  53. data/base/app/views/layouts/_logo_in.html.erb +1 -1
  54. data/base/app/views/layouts/application.html.erb +2 -0
  55. data/base/app/views/permissions/_list.html.erb +1 -1
  56. data/base/app/views/profiles/_avatar.html.erb +1 -5
  57. data/base/app/views/profiles/_avatar_edit.html.erb +5 -0
  58. data/base/app/views/profiles/_comunication-info.html.erb +2 -36
  59. data/base/app/views/profiles/_comunication-info_edit.html.erb +27 -0
  60. data/base/app/views/profiles/_edit_icon.html.erb +0 -1
  61. data/base/app/views/profiles/_experience.html.erb +1 -6
  62. data/base/app/views/profiles/_experience_edit.html.erb +5 -0
  63. data/base/app/views/profiles/_personal.html.erb +1 -39
  64. data/base/app/views/profiles/_personal_edit.html.erb +31 -0
  65. data/base/app/views/profiles/_profile_edit.html.erb +7 -0
  66. data/base/app/views/profiles/_tags.html.erb +1 -4
  67. data/base/app/views/profiles/_tags_edit.html.erb +4 -0
  68. data/base/app/views/profiles/edit.html.erb +24 -0
  69. data/base/app/views/settings/_notifications.html.erb +12 -4
  70. data/base/app/views/users/show.html.erb +5 -5
  71. data/base/config/locales/de.yml +654 -0
  72. data/base/config/locales/en.yml +20 -9
  73. data/base/config/locales/es.yml +151 -140
  74. data/base/config/locales/fr.yml +656 -0
  75. data/base/config/locales/hu.yml +653 -0
  76. data/base/config/locales/nl.yml +656 -0
  77. data/base/config/locales/pt.yml +250 -239
  78. data/base/config/locales/rails.de.yml +203 -0
  79. data/base/config/locales/rails.fr.yml +222 -0
  80. data/base/config/locales/rails.hu.yml +199 -0
  81. data/base/config/locales/rails.nl.yml +199 -0
  82. data/base/config/locales/zh.yml +214 -202
  83. data/base/config/routes.rb +22 -30
  84. data/base/db/migrate/20130708152633_set_group_owners.rb +19 -0
  85. data/base/db/migrate/20130723133530_actor_notification_settings.rb +10 -0
  86. data/base/lib/generators/social_stream/base/templates/initializer.rb +13 -7
  87. data/base/lib/rails/social_stream.rb +2 -0
  88. data/base/lib/social_stream/base.rb +27 -7
  89. data/base/lib/social_stream/base/ability.rb +3 -5
  90. data/base/lib/social_stream/base/autoload.rb +1 -0
  91. data/base/lib/social_stream/base/version.rb +1 -1
  92. data/base/lib/social_stream/controllers/authorship.rb +18 -0
  93. data/base/lib/social_stream/controllers/helpers.rb +18 -4
  94. data/base/lib/social_stream/controllers/objects.rb +2 -8
  95. data/base/lib/social_stream/controllers/subjects.rb +9 -2
  96. data/base/lib/social_stream/models/supertype.rb +2 -0
  97. data/base/lib/social_stream/population/activity_object.rb +6 -8
  98. data/base/lib/social_stream/routing/mapper.rb +52 -0
  99. data/base/social_stream-base.gemspec +4 -7
  100. data/base/spec/controllers/groups_controller_spec.rb +19 -8
  101. data/base/spec/controllers/posts_controller_spec.rb +114 -147
  102. data/base/spec/models/post_authorization_spec.rb +190 -204
  103. data/base/spec/models/post_spec.rb +17 -63
  104. data/base/vendor/assets/javascripts/bootstrap-multiselect.js +434 -127
  105. data/documents/Rakefile +1 -6
  106. data/documents/config/locales/de.yml +93 -0
  107. data/documents/config/locales/es.yml +2 -2
  108. data/documents/config/locales/fr.yml +93 -0
  109. data/documents/config/locales/hu.yml +93 -0
  110. data/documents/config/locales/nl.yml +93 -0
  111. data/documents/config/locales/zh.yml +4 -4
  112. data/documents/config/routes.rb +7 -9
  113. data/documents/lib/social_stream/documents/version.rb +1 -1
  114. data/documents/social_stream-documents.gemspec +4 -4
  115. data/events/Rakefile +1 -6
  116. data/events/config/locales/es.yml +3 -3
  117. data/events/config/locales/zh.yml +3 -3
  118. data/events/lib/social_stream/events/models/actor.rb +2 -1
  119. data/events/lib/social_stream/events/version.rb +1 -1
  120. data/events/social_stream-events.gemspec +1 -1
  121. data/lib/generators/social_stream/install_generator.rb +1 -0
  122. data/lib/social_stream.rb +1 -0
  123. data/lib/social_stream/version.rb +1 -1
  124. data/lib/tasks/i18n.rake +22 -2
  125. data/linkser/Rakefile +1 -6
  126. data/linkser/config/locales/de.yml +17 -0
  127. data/linkser/config/locales/es.yml +2 -2
  128. data/linkser/config/locales/fr.yml +17 -0
  129. data/linkser/config/locales/hu.yml +17 -0
  130. data/linkser/config/locales/nl.yml +17 -0
  131. data/linkser/config/locales/zh.yml +2 -2
  132. data/linkser/lib/social_stream/linkser/version.rb +1 -1
  133. data/linkser/social_stream-linkser.gemspec +1 -1
  134. data/oauth2_server/Rakefile +1 -6
  135. data/oauth2_server/app/assets/images/step_1.png +0 -0
  136. data/oauth2_server/app/assets/images/step_2.png +0 -0
  137. data/oauth2_server/app/assets/images/step_3.png +0 -0
  138. data/oauth2_server/app/assets/javascripts/social_stream/site_client.js +27 -0
  139. data/oauth2_server/app/assets/stylesheets/social_stream/oauth2_server/applications/layout/_applications-oauth2server.css.sass +0 -5
  140. data/oauth2_server/app/assets/stylesheets/social_stream/oauth2_server/create/layout/_create-oauth2server.css.sass +3 -5
  141. data/oauth2_server/app/assets/stylesheets/social_stream/oauth2_server/show/layout/_show-oauth2server.css.sass +8 -6
  142. data/oauth2_server/app/controllers/site/clients_controller.rb +17 -41
  143. data/oauth2_server/app/decorators/social_stream/base/relation_decorator.rb +2 -0
  144. data/oauth2_server/app/decorators/social_stream/base/user_decorator.rb +1 -20
  145. data/oauth2_server/app/models/relation/manager.rb +1 -10
  146. data/oauth2_server/app/models/site/client.rb +4 -2
  147. data/oauth2_server/app/views/site/clients/_destroy.html.erb +11 -0
  148. data/oauth2_server/app/views/site/clients/_edit.html.erb +9 -2
  149. data/oauth2_server/app/views/site/clients/_edit_step_2.html.erb +6 -6
  150. data/oauth2_server/app/views/site/clients/_edit_step_3.html.erb +8 -6
  151. data/oauth2_server/app/views/site/clients/_form.html.erb +11 -11
  152. data/oauth2_server/app/views/site/clients/_list.html.erb +23 -11
  153. data/oauth2_server/app/views/site/clients/edit.html.erb +1 -1
  154. data/oauth2_server/app/views/site/clients/index.html.erb +9 -40
  155. data/oauth2_server/app/views/site/clients/show.html.erb +66 -68
  156. data/oauth2_server/config/locales/en.yml +19 -0
  157. data/oauth2_server/config/locales/es.yml +23 -4
  158. data/oauth2_server/config/locales/zh.yml +32 -13
  159. data/oauth2_server/config/routes.rb +3 -1
  160. data/oauth2_server/lib/social_stream/oauth2_server.rb +4 -1
  161. data/oauth2_server/lib/social_stream/oauth2_server/ability.rb +1 -1
  162. data/oauth2_server/lib/social_stream/oauth2_server/models/user.rb +18 -0
  163. data/oauth2_server/lib/social_stream/oauth2_server/version.rb +1 -1
  164. data/oauth2_server/social_stream-oauth2_server.gemspec +1 -1
  165. data/oauth2_server/spec/controllers/site_clients_controller_authorization_spec.rb +7 -0
  166. data/ostatus/Rakefile +1 -6
  167. data/ostatus/config/locales/zh.yml +8 -8
  168. data/ostatus/lib/social_stream-ostatus.rb +3 -0
  169. data/ostatus/lib/social_stream/ostatus/version.rb +1 -1
  170. data/ostatus/social_stream-ostatus.gemspec +1 -1
  171. data/places/config/locales/es.yml +51 -51
  172. data/presence/config/locales/es.yml +48 -48
  173. data/presence/config/locales/zh.yml +48 -48
  174. data/presence/lib/social_stream/presence/version.rb +1 -1
  175. data/presence/social_stream-presence.gemspec +1 -1
  176. data/social_stream.gemspec +8 -7
  177. metadata +60 -29
  178. data/base/app/assets/javascripts/social_stream/follow.js +0 -28
  179. data/base/app/controllers/followers_controller.rb +0 -34
  180. data/base/app/helpers/followers_helper.rb +0 -5
  181. data/base/app/views/contacts/_link_follow.html.erb +0 -16
  182. data/base/app/views/followers/destroy.js.erb +0 -1
  183. data/base/app/views/followers/index.html.erb +0 -30
  184. data/base/app/views/followers/update.js.erb +0 -3
  185. data/base/app/views/frontpage/_characteristics.html.erb +0 -23
  186. data/base/lib/social_stream/routing/constraints/custom.rb +0 -11
  187. data/base/lib/social_stream/routing/constraints/follow.rb +0 -11
  188. data/base/spec/controllers/followers_controller_spec.rb +0 -37
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c98e8f340abda58ad4fdb221277832f008dd9bc
4
- data.tar.gz: 163732a3cfc11f3799990396061ef43efe8fe784
3
+ metadata.gz: 0fa777d423bc8bdb5da4bdcd89bb767e882b98b3
4
+ data.tar.gz: ed92fae8cd6c25a55482b4723ebcbf26e8bae22f
5
5
  SHA512:
6
- metadata.gz: 05918a9619f19d52a3b47c270a6b2438277ba59cfcb5d2323d6b132ac90bccfcd457f8ac630cd3e27988f960941b458ffa0a663573a23e861d871ce63aaee77c
7
- data.tar.gz: 39177589b24d9ed84803361c7624dddb8f4deddb72ff2fd9f3d0027b02d3e45e4e9ada54ab479be149f165ded45aa55ec53c317ceb7b6e44b91acc94ba02a579
6
+ metadata.gz: 6f54c0b15d0b36ac58dadf3347b568b6197900e3caa1e923653b3d36b4663828345d3c6e680de1fc604558030002697b0f3886b53d00bcc4618e365ebb0e98c3
7
+ data.tar.gz: 36700f4bf7ca3cc7761f2015e587a39579d060a3c9b1f169655a31860313e9160166b59dbd234523b7f342e646a23d306ed6061086c3ae851a14d95de5a4f7f4
data/Gemfile CHANGED
@@ -3,6 +3,9 @@ source "http://rubygems.org"
3
3
  # Uncomment the following lines if you are planing to
4
4
  # use a local code of any of these gems
5
5
 
6
+ # Travis' bundler does not properly resolve dependencies for railties
7
+ gem 'rails', '3.2.14'
8
+
6
9
  # Gems before social_stream-base
7
10
  # gem 'mailboxer', :path => '../mailboxer'
8
11
  # gem 'avatars_for_rails', :path => '../avatars_for_rails'
@@ -13,11 +16,11 @@ source "http://rubygems.org"
13
16
  # Needs the libsndfile package
14
17
  gem 'paperclip_waveform'
15
18
 
19
+ gem 'pry-rails'
20
+
16
21
  # social_stream gems
17
22
  %w(base documents events linkser presence).each do |g|
18
23
  gem "social_stream-#{ g }", :path => g
19
24
  end
20
25
 
21
- gem 'pry'
22
-
23
26
  gemspec
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 Universidad Politécnica de Madrid
1
+ Copyright (c) 2013 Universidad Politécnica de Madrid
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -1,21 +1,9 @@
1
1
  # encoding: UTF-8
2
- require 'rake'
3
- require 'rdoc/task'
4
-
5
- require 'rubygems'
6
-
7
- require 'rspec/core/rake_task'
8
-
9
- require 'ci/reporter/rake/rspec'
10
-
11
- require 'bundler'
2
+ require 'bundler/gem_tasks'
12
3
 
13
- require File.join(File.dirname(__FILE__), 'lib', 'social_stream', 'base', 'version')
14
-
15
-
16
- RSpec::Core::RakeTask.new(:spec)
4
+ require 'rdoc/task'
17
5
 
18
- task :default => :spec
6
+ task :default => :rdoc
19
7
 
20
8
  Rake::RDocTask.new(:rdoc) do |rdoc|
21
9
  rdoc.rdoc_dir = 'rdoc'
@@ -25,8 +13,6 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
25
13
  rdoc.rdoc_files.include('lib/**/*.rb', 'app/**/*.rb')
26
14
  end
27
15
 
28
- Bundler::GemHelper.install_tasks
29
-
30
16
  # Modify this gem's tags
31
17
  class Bundler::GemHelper
32
18
  def version_tag
@@ -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 initContactButtons = function() {
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
- initContactButtons();
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
- initContactButtons,
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', hideContact);
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
- initContactButtons();
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.Contact.select2("#group__participants");
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("#group_tag_list");
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.validate, function(i, opt){
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;
@@ -1,3 +1,6 @@
1
+ body
2
+ color: red
3
+
1
4
  #content
2
5
  h2
3
6
  margin-top: 0px
@@ -1,2 +0,0 @@
1
- input[type="submit"]
2
- @include btn-primary
@@ -32,17 +32,7 @@
32
32
  #relation_customs
33
33
  h2
34
34
  @include colorfont-big-size
35
-
36
- #relation_customs,
37
- .relation_list
38
- border-right: 1px solid #c4c4c4
39
-
40
-
41
- #new_relation
42
- .new_relation_custom
43
- .btn
44
-
45
-
35
+
46
36
 
47
37
  #permissions
48
38
  h4
@@ -60,35 +60,7 @@ input#group_name
60
60
 
61
61
 
62
62
  .relation_customs
63
- width: 80%
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
@@ -134,7 +134,6 @@ header
134
134
  z-index: 6
135
135
  li
136
136
  a
137
- padding: 7px 7px 7px !important
138
137
  img
139
138
  width: 20px
140
139
  .name
@@ -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
- padding: 0
3
- text-align: center
4
- ul
5
- list-style-type: none
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 total_contacts
96
- @total_contacts ||=
97
- Contact.sent_by(current_subject).
98
- joins(:receiver).merge(Actor.alphabetic).
99
- positive.
100
- select("actors.name")
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