social_stream-base 0.15.2 → 0.16.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.
- data/app/assets/images/btn/permission_negative.png +0 -0
- data/app/assets/images/btn/permission_positive.png +0 -0
- data/app/assets/javascripts/activities.js.erb +2 -118
- data/app/assets/javascripts/social_stream-base.js +3 -0
- data/app/assets/javascripts/social_stream.timeline.js +42 -0
- data/app/assets/javascripts/social_stream.wall.js.erb +125 -0
- data/app/assets/stylesheets/cheesecake.css.scss +9 -1
- data/app/helpers/notifications_helper.rb +1 -5
- data/app/models/activity.rb +21 -2
- data/app/models/comment.rb +5 -0
- data/app/models/permission.rb +16 -1
- data/app/models/post.rb +5 -0
- data/app/views/activities/_new.html.erb +7 -6
- data/app/views/activities/_wall.html.erb +6 -0
- data/app/views/cheesecake/_index.html.erb +17 -0
- data/app/views/cheesecake/_sector_form.html.erb +15 -6
- data/app/views/comments/_new.html.erb +2 -2
- data/app/views/comments/create.js.erb +1 -3
- data/app/views/notifications/activities/_post.html.erb +0 -3
- data/app/views/permissions/_index.html.erb +2 -2
- data/app/views/posts/create.js.erb +1 -4
- data/config/locales/en.yml +33 -23
- data/config/locales/es.yml +53 -24
- data/db/migrate/20120208135718_group_title_and_description_in_activity_object.rb +52 -0
- data/lib/social_stream/base/version.rb +1 -1
- data/spec/factories/activity.rb +1 -1
- metadata +71 -67
- data/app/views/activities/_filter.html.erb +0 -83
Binary file
|
Binary file
|
@@ -1,106 +1,9 @@
|
|
1
1
|
//= require jquery.livequery
|
2
2
|
//= require jquery.tipsy
|
3
3
|
//
|
4
|
+
//= require social_stream.wall
|
5
|
+
//
|
4
6
|
//initial state
|
5
|
-
var default_security_width = '100px';
|
6
|
-
$(function() {
|
7
|
-
$('#wrapper_activities_header form').hide();
|
8
|
-
$('#new_<%= SocialStream.activity_forms.first %>').show();
|
9
|
-
$('#select_<%= SocialStream.activity_forms.first %>').addClass('selected');
|
10
|
-
chosen = $('#security').security_chosen();
|
11
|
-
$('#security').change(function() {
|
12
|
-
$(this).children("option:selected").each(function(i,opt){
|
13
|
-
if(opt.value==relation_public){
|
14
|
-
if(public_selected==false){
|
15
|
-
public_selected = true;
|
16
|
-
for(id in relation_options){
|
17
|
-
if(id==relation_public_pos){
|
18
|
-
$("#securitychzn_o_" + relation_public_pos).click();
|
19
|
-
}else{
|
20
|
-
chosen.result_deselect(id);
|
21
|
-
}
|
22
|
-
}
|
23
|
-
chosen.results_update_field();
|
24
|
-
}else{
|
25
|
-
if($('#security').children("option:selected").size()>1){
|
26
|
-
public_selected = false;
|
27
|
-
chosen.result_deselect(relation_public_pos);
|
28
|
-
chosen.results_update_field();
|
29
|
-
}
|
30
|
-
}
|
31
|
-
}
|
32
|
-
});
|
33
|
-
|
34
|
-
$('#securities .search-choice a').click(function(){
|
35
|
-
if($('#security').children("option:selected").size()==0){
|
36
|
-
$('#securities input').css('width', default_security_width)
|
37
|
-
}
|
38
|
-
});
|
39
|
-
});
|
40
|
-
$('#securities input').blur(function(){
|
41
|
-
if($('#security').children("option:selected").size()==0){
|
42
|
-
$('#securities input').css('width', default_security_width)
|
43
|
-
}
|
44
|
-
});
|
45
|
-
// Remove width calculation
|
46
|
-
$('#securities input.default').css('width', default_security_width);
|
47
|
-
setActivityPrivacyTooltips();
|
48
|
-
});
|
49
|
-
|
50
|
-
|
51
|
-
$(document).ready(function() {
|
52
|
-
activate_anti_rebounds();
|
53
|
-
});
|
54
|
-
|
55
|
-
activate_anti_rebounds = function(){
|
56
|
-
$('#wrapper_activities_header form').submit(function() {
|
57
|
-
$(this).find('input[type=text]').each(function() {
|
58
|
-
$(this).blur().attr('readonly', true);
|
59
|
-
});
|
60
|
-
$("#masterSubmitButton").val(I18n.t('activity.sending') + '...').attr("disabled", true);
|
61
|
-
|
62
|
-
// Add _relation_ids[] parameter from authorization selector
|
63
|
-
$('.liveAdded').remove();
|
64
|
-
|
65
|
-
var currentForm = $(this);
|
66
|
-
|
67
|
-
$('#security option:selected').each(function() {
|
68
|
-
currentForm.append(
|
69
|
-
$('<input/>')
|
70
|
-
.addClass('liveAdded')
|
71
|
-
.attr('type', 'hidden')
|
72
|
-
.attr('name', currentForm
|
73
|
-
.attr('id').split('_')[1]+'[_relation_ids][]')
|
74
|
-
.val($(this).attr('value')));
|
75
|
-
});
|
76
|
-
return true;
|
77
|
-
});
|
78
|
-
|
79
|
-
$('.new_comment').submit(function() {
|
80
|
-
$(this).find('input[type=text]').each(function() {
|
81
|
-
$(this).blur().attr('readonly', true);
|
82
|
-
});
|
83
|
-
$(this).find(".submitActivity").each(function() {
|
84
|
-
$(this).val(I18n.t('activity.sending') + '...').attr("disabled", true);
|
85
|
-
});
|
86
|
-
return true;
|
87
|
-
});
|
88
|
-
}
|
89
|
-
|
90
|
-
|
91
|
-
unblock_all_forms = function() {
|
92
|
-
//Sharing buttons
|
93
|
-
$(".submitActivity").val(I18n.t('share')).removeAttr("disabled");
|
94
|
-
//Header activities form
|
95
|
-
$("#masterSubmitButton").val(I18n.t('share')).removeAttr("disabled");
|
96
|
-
$('#wrapper_activities_header form').find('input[type=text]').each(function() {
|
97
|
-
$(this).removeAttr("readonly").val("").blur();
|
98
|
-
});
|
99
|
-
//New comments
|
100
|
-
$('.input_new_comments').each(function() {chosen.result_deselect(0)
|
101
|
-
$(this).removeAttr("readonly").val("");
|
102
|
-
});
|
103
|
-
}
|
104
7
|
|
105
8
|
$('#masterSubmitButton').live('click',function(){
|
106
9
|
$('#wrapper_activities_header form:visible').submit();
|
@@ -229,22 +132,3 @@ $('#left_scroll img').livequery("click",function(){
|
|
229
132
|
|
230
133
|
|
231
134
|
});
|
232
|
-
|
233
|
-
setActivityPrivacyTooltips = function(activityId) {
|
234
|
-
var fullId = '.activity_audience';
|
235
|
-
var summaryId = '.activity_audience_summary';
|
236
|
-
|
237
|
-
if (activityId != undefined) {
|
238
|
-
fullId = '#' + activityId + ' ' + fullId;
|
239
|
-
summaryId = '#' + activityId + ' ' + summaryId;
|
240
|
-
}
|
241
|
-
|
242
|
-
$(fullId).hide();
|
243
|
-
$(summaryId).tipsy({
|
244
|
-
html: true,
|
245
|
-
title: function(){
|
246
|
-
return $(this).siblings('.activity_audience').html();
|
247
|
-
}
|
248
|
-
});
|
249
|
-
};
|
250
|
-
|
@@ -0,0 +1,42 @@
|
|
1
|
+
SocialStream.Timeline = (function(SS, $, undefined){
|
2
|
+
var setupCallbacks = [];
|
3
|
+
|
4
|
+
var addSetupCallback = function(callback){
|
5
|
+
setupCallbacks.push(callback);
|
6
|
+
}
|
7
|
+
|
8
|
+
var setup = function(){
|
9
|
+
$.each(setupCallbacks, function(i, callback){ callback(); });
|
10
|
+
}
|
11
|
+
|
12
|
+
var setPrivacyTooltips = function(activityId) {
|
13
|
+
var fullId = '.activity_audience';
|
14
|
+
var summaryId = '.activity_audience_summary';
|
15
|
+
|
16
|
+
if (activityId != undefined) {
|
17
|
+
fullId = '#' + activityId + ' ' + fullId;
|
18
|
+
summaryId = '#' + activityId + ' ' + summaryId;
|
19
|
+
}
|
20
|
+
|
21
|
+
$(fullId).hide();
|
22
|
+
$(summaryId).tipsy({
|
23
|
+
html: true,
|
24
|
+
title: function(){
|
25
|
+
return $(this).siblings('.activity_audience').html();
|
26
|
+
}
|
27
|
+
});
|
28
|
+
};
|
29
|
+
|
30
|
+
var newActivity = function(activityId){
|
31
|
+
setPrivacyTooltips(activityId);
|
32
|
+
SS.Wall.unblockForms();
|
33
|
+
}
|
34
|
+
|
35
|
+
addSetupCallback(setPrivacyTooltips);
|
36
|
+
|
37
|
+
return {
|
38
|
+
addSetupCallback: addSetupCallback,
|
39
|
+
setup: setup,
|
40
|
+
newActivity: newActivity
|
41
|
+
};
|
42
|
+
}) (SocialStream, jQuery);
|
@@ -0,0 +1,125 @@
|
|
1
|
+
//= require social_stream.timeline
|
2
|
+
//
|
3
|
+
SocialStream.Wall = (function(SS, $, undefined){
|
4
|
+
var setupCallbacks = [];
|
5
|
+
|
6
|
+
var addSetupCallback = function(callback){
|
7
|
+
setupCallbacks.push(callback);
|
8
|
+
}
|
9
|
+
|
10
|
+
var setup = function(){
|
11
|
+
$.each(setupCallbacks, function(i, callback){ callback(); });
|
12
|
+
}
|
13
|
+
|
14
|
+
var setupFirstForm = function(){
|
15
|
+
$('#wrapper_activities_header form').hide();
|
16
|
+
$('#new_<%= SocialStream.activity_forms.first %>').show();
|
17
|
+
$('#select_<%= SocialStream.activity_forms.first %>').addClass('selected');
|
18
|
+
}
|
19
|
+
|
20
|
+
var setupSecuritySelect = function(){
|
21
|
+
var default_security_width = '100px';
|
22
|
+
|
23
|
+
chosen = $('#security').security_chosen();
|
24
|
+
|
25
|
+
$('#security').change(function() {
|
26
|
+
$(this).children("option:selected").each(function(i,opt){
|
27
|
+
if(opt.value==relation_public){
|
28
|
+
if(public_selected==false){
|
29
|
+
public_selected = true;
|
30
|
+
for(id in relation_options){
|
31
|
+
if(id==relation_public_pos){
|
32
|
+
$("#securitychzn_o_" + relation_public_pos).click();
|
33
|
+
}else{
|
34
|
+
chosen.result_deselect(id);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
chosen.results_update_field();
|
38
|
+
}else{
|
39
|
+
if($('#security').children("option:selected").size()>1){
|
40
|
+
public_selected = false;
|
41
|
+
chosen.result_deselect(relation_public_pos);
|
42
|
+
chosen.results_update_field();
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
});
|
47
|
+
|
48
|
+
$('#securities .search-choice a').click(function(){
|
49
|
+
if($('#security').children("option:selected").size()==0){
|
50
|
+
$('#securities input').css('width', default_security_width)
|
51
|
+
}
|
52
|
+
});
|
53
|
+
});
|
54
|
+
|
55
|
+
$('#securities input').blur(function(){
|
56
|
+
if($('#security').children("option:selected").size()==0){
|
57
|
+
$('#securities input').css('width', default_security_width)
|
58
|
+
}
|
59
|
+
});
|
60
|
+
|
61
|
+
// Remove width calculation
|
62
|
+
$('#securities input.default').css('width', default_security_width);
|
63
|
+
|
64
|
+
}
|
65
|
+
|
66
|
+
var activateAntiRebounds = function(){
|
67
|
+
$('#wrapper_activities_header form').submit(function() {
|
68
|
+
$(this).find('input[type=text]').each(function() {
|
69
|
+
$(this).blur().attr('readonly', true);
|
70
|
+
});
|
71
|
+
$("#masterSubmitButton").val(I18n.t('activity.sending') + '...').attr("disabled", true);
|
72
|
+
|
73
|
+
// Add _relation_ids[] parameter from authorization selector
|
74
|
+
$('.liveAdded').remove();
|
75
|
+
|
76
|
+
var currentForm = $(this);
|
77
|
+
|
78
|
+
$('#security option:selected').each(function() {
|
79
|
+
currentForm.append(
|
80
|
+
$('<input/>')
|
81
|
+
.addClass('liveAdded')
|
82
|
+
.attr('type', 'hidden')
|
83
|
+
.attr('name', currentForm
|
84
|
+
.attr('id').split('_')[1]+'[_relation_ids][]')
|
85
|
+
.val($(this).attr('value')));
|
86
|
+
});
|
87
|
+
return true;
|
88
|
+
});
|
89
|
+
|
90
|
+
$('.new_comment').submit(function() {
|
91
|
+
$(this).find('input[type=text]').each(function() {
|
92
|
+
$(this).blur().attr('readonly', true);
|
93
|
+
});
|
94
|
+
$(this).find(".submitActivity").each(function() {
|
95
|
+
$(this).val(I18n.t('activity.sending') + '...').attr("disabled", true);
|
96
|
+
});
|
97
|
+
return true;
|
98
|
+
});
|
99
|
+
}
|
100
|
+
|
101
|
+
var unblockForms = function() {
|
102
|
+
//Sharing buttons
|
103
|
+
$(".submitActivity").val(I18n.t('share')).removeAttr("disabled");
|
104
|
+
//Header activities form
|
105
|
+
$("#masterSubmitButton").val(I18n.t('share')).removeAttr("disabled");
|
106
|
+
$('#wrapper_activities_header form').find('input[type=text]').each(function() {
|
107
|
+
$(this).removeAttr("readonly").val("").blur();
|
108
|
+
});
|
109
|
+
//New comments
|
110
|
+
$('.input_new_comments').each(function() {chosen.result_deselect(0)
|
111
|
+
$(this).removeAttr("readonly").val("");
|
112
|
+
});
|
113
|
+
}
|
114
|
+
|
115
|
+
addSetupCallback(setupFirstForm);
|
116
|
+
addSetupCallback(setupSecuritySelect);
|
117
|
+
addSetupCallback(activateAntiRebounds);
|
118
|
+
|
119
|
+
return {
|
120
|
+
addSetupCallback: addSetupCallback,
|
121
|
+
setup: setup,
|
122
|
+
activateAntiRebounds: activateAntiRebounds,
|
123
|
+
unblockForms: unblockForms
|
124
|
+
};
|
125
|
+
}) (SocialStream, jQuery)
|
@@ -354,7 +354,15 @@
|
|
354
354
|
.permissions_explanation_tipsy_menu.tipsy .tipsy-inner {
|
355
355
|
max-width: 300px;
|
356
356
|
text-align: left;
|
357
|
+
padding: 5px 8px 4px 2px;
|
357
358
|
}
|
358
359
|
.permissions_explanation_tipsy_menu.tipsy .tipsy-inner .permission {
|
359
|
-
padding
|
360
|
+
padding: 4px 0px 4px 20px;
|
361
|
+
text-align: justify;
|
362
|
+
}
|
363
|
+
.permissions_explanation_tipsy_menu.tipsy .tipsy-inner .permission.positive {
|
364
|
+
background: url("btn/permission_positive.png") 0px no-repeat;
|
365
|
+
}
|
366
|
+
.permissions_explanation_tipsy_menu.tipsy .tipsy-inner .permission.negative {
|
367
|
+
background: url("btn/permission_negative.png") 0px no-repeat;
|
360
368
|
}
|
@@ -4,8 +4,6 @@ module NotificationsHelper
|
|
4
4
|
def title_of(act_obj)
|
5
5
|
if act_obj.is_a? Comment
|
6
6
|
'Re: ' + title_of(act_obj.parent_post)
|
7
|
-
elsif act_obj.is_a? Post and (not act_obj.text.nil?)
|
8
|
-
act_obj.text.truncate(30, :separator => ' ')
|
9
7
|
elsif act_obj.respond_to? :title and (not act_obj.title.nil?)
|
10
8
|
act_obj.title.truncate(30, :separator => ' ')
|
11
9
|
elsif act_obj.respond_to? :url and (not act_obj.url.nil?)
|
@@ -16,9 +14,7 @@ module NotificationsHelper
|
|
16
14
|
|
17
15
|
# An activity object description
|
18
16
|
def description_of(act_obj)
|
19
|
-
if act_obj.respond_to? :
|
20
|
-
sanitize(act_obj.text)
|
21
|
-
elsif act_obj.respond_to? :description and (not act_obj.description.nil?)
|
17
|
+
if act_obj.respond_to? :description and (not act_obj.description.nil?)
|
22
18
|
sanitize(act_obj.description)
|
23
19
|
else
|
24
20
|
I18n.t('notification.watch_it')
|
data/app/models/activity.rb
CHANGED
@@ -209,15 +209,34 @@ class Activity < ActiveRecord::Base
|
|
209
209
|
end
|
210
210
|
|
211
211
|
def notify
|
212
|
-
return true
|
212
|
+
return true unless notificable?
|
213
213
|
#Avaible verbs: follow, like, make-friend, post, update
|
214
214
|
|
215
|
-
if
|
215
|
+
if direct_object.is_a? Comment
|
216
|
+
participants.each do |p|
|
217
|
+
p.notify(notification_subject, "Youre not supposed to see this", self) unless p == sender
|
218
|
+
end
|
219
|
+
elsif ['like','follow','make-friend','post','update'].include? verb and !channel.reflexive?
|
216
220
|
receiver.notify(notification_subject, "Youre not supposed to see this", self)
|
217
221
|
end
|
218
222
|
true
|
219
223
|
end
|
220
224
|
|
225
|
+
# A list of participants
|
226
|
+
def participants
|
227
|
+
parts=Set.new
|
228
|
+
same_thread.map{|a| a.activity_objects.first}.each do |ao|
|
229
|
+
parts << ao.author if ao.respond_to? :author and !ao.author.nil?
|
230
|
+
end
|
231
|
+
parts
|
232
|
+
end
|
233
|
+
|
234
|
+
# This and related activities
|
235
|
+
def same_thread
|
236
|
+
return [self] if ancestry.nil?
|
237
|
+
[Activity.find(ancestry)] + Activity.find_all_by_ancestry(ancestry)
|
238
|
+
end
|
239
|
+
|
221
240
|
# Is subject allowed to perform action on this {Activity}?
|
222
241
|
def allow?(subject, action)
|
223
242
|
return false if channel.blank?
|
data/app/models/comment.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
class Comment < ActiveRecord::Base
|
2
2
|
include SocialStream::Models::Object
|
3
3
|
|
4
|
+
alias_attribute :text, :description
|
4
5
|
validates_presence_of :text
|
5
6
|
|
6
7
|
def parent_post
|
@@ -11,4 +12,8 @@ class Comment < ActiveRecord::Base
|
|
11
12
|
self._relation_ids = Activity.find(id).relation_ids
|
12
13
|
@_activity_parent_id = id
|
13
14
|
end
|
15
|
+
|
16
|
+
def title
|
17
|
+
description.truncate(30, :separator =>' ')
|
18
|
+
end
|
14
19
|
end
|
data/app/models/permission.rb
CHANGED
@@ -46,7 +46,22 @@ class Permission < ActiveRecord::Base
|
|
46
46
|
# An explanation of the permissions. Type can be brief or detailed.
|
47
47
|
# If detailed, description includes more information about the relation
|
48
48
|
def description(type, options = {})
|
49
|
-
|
49
|
+
unless options[:subject].present?
|
50
|
+
raise "Now we need subject for permission description"
|
51
|
+
end
|
52
|
+
|
53
|
+
options[:name] = options[:subject].name
|
54
|
+
|
55
|
+
prefix = "permission.description"
|
56
|
+
suffix = "#{ type }.#{ action }.#{ object || "nil" }"
|
57
|
+
|
58
|
+
if options[:state]
|
59
|
+
suffix += ".#{ options[:state] }"
|
60
|
+
end
|
61
|
+
|
62
|
+
options[:default] = :"#{ prefix }.default.#{ suffix }"
|
63
|
+
|
64
|
+
I18n.t "#{ prefix }.#{ options[:subject].subject_type.underscore }.#{ suffix }",
|
50
65
|
options
|
51
66
|
end
|
52
67
|
end
|
data/app/models/post.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
class Post < ActiveRecord::Base
|
2
2
|
include SocialStream::Models::Object
|
3
3
|
|
4
|
+
alias_attribute :text, :description
|
4
5
|
validates_presence_of :text
|
5
6
|
|
6
7
|
define_index do
|
@@ -9,4 +10,8 @@ class Post < ActiveRecord::Base
|
|
9
10
|
has created_at
|
10
11
|
end
|
11
12
|
|
13
|
+
def title
|
14
|
+
description.truncate(30, :separator =>' ')
|
15
|
+
end
|
16
|
+
|
12
17
|
end
|
@@ -6,12 +6,6 @@
|
|
6
6
|
:receiver => receiver
|
7
7
|
} %>
|
8
8
|
<% end %>
|
9
|
-
|
10
|
-
<%= javascript_tag do %>
|
11
|
-
$(function(){
|
12
|
-
activate_anti_rebounds();
|
13
|
-
});
|
14
|
-
<% end %>
|
15
9
|
</div>
|
16
10
|
|
17
11
|
<div id="activity_form_select">
|
@@ -54,3 +48,10 @@
|
|
54
48
|
<%= submit_tag(t('share'), :class => "button submitActivity", :id => "masterSubmitButton") %>
|
55
49
|
</div>
|
56
50
|
<% end %>
|
51
|
+
|
52
|
+
<%= javascript_tag do %>
|
53
|
+
$(function(){
|
54
|
+
SocialStream.Wall.setup();
|
55
|
+
});
|
56
|
+
<% end %>
|
57
|
+
|
@@ -151,6 +151,23 @@
|
|
151
151
|
$("#edited_subsector_name_" + event.data[0]).html($("#form_subsector_name_" + event.data[0]).val());
|
152
152
|
event.data[1].changeLabel($("#form_subsector_name_" + event.data[0]).val());
|
153
153
|
});
|
154
|
+
$("#subsector_" + i).find(".permissions_field .permission").each(function(){
|
155
|
+
var permission_field = $(this);
|
156
|
+
var update_state = function(){
|
157
|
+
var label_class = permission_field.attr("id").replace("form_", "edited_");
|
158
|
+
if(permission_field.is(":checked")){
|
159
|
+
$("." + label_class).removeClass("negative").addClass("positive");
|
160
|
+
$("." + label_class).find(".negative_message").hide();
|
161
|
+
$("." + label_class).find(".positive_message").show();
|
162
|
+
}else{
|
163
|
+
$("." + label_class).removeClass("positive").addClass("negative");
|
164
|
+
$("." + label_class).find(".positive_message").hide();
|
165
|
+
$("." + label_class).find(".negative_message").show();
|
166
|
+
}
|
167
|
+
}
|
168
|
+
update_state();
|
169
|
+
permission_field.on("change",update_state);
|
170
|
+
});
|
154
171
|
$("#subsector_" + i).show();
|
155
172
|
}else{
|
156
173
|
if(sector.subsectors[i-1]){
|
@@ -38,7 +38,7 @@
|
|
38
38
|
<%= t('cheesecake.form.fields.name')%>:
|
39
39
|
</div>
|
40
40
|
<div class="form_field">
|
41
|
-
<input type="text" class="form_tag
|
41
|
+
<input type="text" class="form_tag form_subsector_name" id="form_subsector_name_<%= i %>" value="New subsector <%= i %>">
|
42
42
|
</div>
|
43
43
|
</div>
|
44
44
|
<div class="form_row less_padding">
|
@@ -50,15 +50,22 @@
|
|
50
50
|
<div class="form_field permissions_field">
|
51
51
|
<% default_permissions.each_with_index do |p, i| %>
|
52
52
|
<div contain=<%= dom_id p %> class="checkboxPermissionOptionLeft">
|
53
|
-
<input class="permission <%= dom_id p %>" type="checkbox"/>
|
54
|
-
<label for
|
53
|
+
<input id="form_subsector_<%= i %>_<%= dom_id p %>" class="permission <%= dom_id p %>" type="checkbox"/>
|
54
|
+
<label for="form_subsector_<%= i %>_<%= dom_id p %>"><%= p.description(:brief, :relation => "%RELATION_NAME%", :subject => current_subject) %></label>
|
55
55
|
<div class="clearfloat"></div>
|
56
56
|
</div>
|
57
57
|
<% end %>
|
58
58
|
</div>
|
59
59
|
<div class="permissions_explanation" style="display:none;">
|
60
60
|
<% default_permissions.each_with_index do |p, i| %>
|
61
|
-
<div class="permission <%= dom_id p %>
|
61
|
+
<div class="permission <%= dom_id p %> positive edited_subsector_<%= i %>_<%= dom_id p %>">
|
62
|
+
<div class="positive_message">
|
63
|
+
<%= p.description(:detailed, :relation => "%RELATION_NAME%", :subject => current_subject, :state => "positive") %>
|
64
|
+
</div>
|
65
|
+
<div class="negative_message" style="display:none;">
|
66
|
+
<%= p.description(:detailed, :relation => "%RELATION_NAME%", :subject => current_subject, :state => "negative") %>
|
67
|
+
</div>
|
68
|
+
</div>
|
62
69
|
<% end %>
|
63
70
|
</div>
|
64
71
|
</div>
|
@@ -86,7 +93,7 @@
|
|
86
93
|
$(".permissions_field").each(function(){
|
87
94
|
$(this).tipsy({
|
88
95
|
delayIn: 500,
|
89
|
-
delayOut:
|
96
|
+
delayOut: 200,
|
90
97
|
gravity: 'e',
|
91
98
|
offset: 100,
|
92
99
|
opacity: 1,
|
@@ -94,7 +101,9 @@
|
|
94
101
|
html: true,
|
95
102
|
hoverable: true,
|
96
103
|
title: function(){
|
97
|
-
|
104
|
+
var html = $(this).parent().find('.permissions_explanation').html();
|
105
|
+
var relation = $(this).parent().parent().find('.form_subsector_name').val();
|
106
|
+
return html.replace(/%RELATION_NAME%/g, relation);
|
98
107
|
}
|
99
108
|
});
|
100
109
|
});
|
@@ -33,9 +33,8 @@
|
|
33
33
|
<% end %>
|
34
34
|
|
35
35
|
<%= javascript_tag do %>
|
36
|
-
$(
|
36
|
+
$(function() {
|
37
37
|
$("#comment_text_<%= dom_id(activity) %>").Watermark("<%= I18n.t('comment.input') %>","#666");
|
38
|
-
activate_anti_rebounds();
|
39
38
|
|
40
39
|
$("#comment_text_<%= dom_id(activity) %>")
|
41
40
|
.change(function(){autoSize("<%= dom_id(activity) %>");})
|
@@ -43,5 +42,6 @@
|
|
43
42
|
.keyup(function(){autoSize("<%= dom_id(activity) %>");});
|
44
43
|
autoSize("<%= dom_id(activity) %>");
|
45
44
|
|
45
|
+
SocialStream.Wall.activateAntiRebounds();
|
46
46
|
});
|
47
47
|
<% end %>
|
@@ -5,6 +5,4 @@ $(".input_new_comments").each(function() {
|
|
5
5
|
$(this).focus().val("").blur();
|
6
6
|
});
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
unblock_all_forms();
|
8
|
+
SocialStream.Timeline.newActivity("<%= escape_javascript dom_id(@comment.post_activity) %>");
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<td>
|
11
11
|
<div contain=<%= dom_id p %> class="checkboxPermissionOptionLeft">
|
12
12
|
<input id=<%= dom_id p %> class="permission" type="checkbox"/>
|
13
|
-
<label for=<%= dom_id p %>><%= p.description(:brief) %></label>
|
13
|
+
<label for=<%= dom_id p %>><%= p.description(:brief, :subject => current_subject) %></label>
|
14
14
|
<div class="clearfloat"></div>
|
15
15
|
</div>
|
16
16
|
</td>
|
@@ -28,7 +28,7 @@
|
|
28
28
|
<%= raw t('privacy.intro', :relation => h(@relation.name)) %>
|
29
29
|
|
30
30
|
<%= semantic_form_for @relation, :url => polymorphic_path(@relation, :section => 'rules'), :remote => true do |f| %>
|
31
|
-
<%= f.input :permissions, :as => :check_boxes, :collection => default_permissions.map{ |p| [p.description(:detailed, :relation => @relation.name, :subject => current_subject
|
31
|
+
<%= f.input :permissions, :as => :check_boxes, :collection => default_permissions.map{ |p| [p.description(:detailed, :relation => @relation.name, :subject => current_subject, :state => "positive"), p.id] } %>
|
32
32
|
<%= f.submit t('button.save'), :class => 'button' %>
|
33
33
|
<% end %>
|
34
34
|
</div>
|
@@ -1,7 +1,4 @@
|
|
1
1
|
//Display the new post
|
2
2
|
$("#wall").prepend("<%= escape_javascript(render @post.post_activity) %>");
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
unblock_all_forms();
|
7
|
-
|
4
|
+
SocialStream.Timeline.newActivity("<%= escape_javascript dom_id(@post.post_activity) %>");
|