social_stream 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/Rakefile +2 -0
- data/app/controllers/contacts_controller.rb +28 -0
- data/app/controllers/groups_controller.rb +11 -0
- data/app/controllers/users_controller.rb +11 -0
- data/app/helpers/contacts_helper.rb +2 -0
- data/app/models/group.rb +21 -2
- data/app/models/profile.rb +26 -0
- data/app/views/contacts/index.html.erb +2 -0
- data/app/views/groups/_index.html.erb +2 -4
- data/app/views/groups/_middle_index.html.erb +74 -0
- data/app/views/groups/_new.html.erb +22 -3
- data/app/views/groups/_right_index.html.erb +19 -0
- data/app/views/groups/_right_show.html.erb +3 -3
- data/app/views/groups/index.html.erb +15 -51
- data/app/views/groups/index.js.erb +1 -0
- data/app/views/home/_options.html.erb +1 -1
- data/app/views/layouts/application.html.erb +5 -10
- data/app/views/users/_index.html.erb +2 -4
- data/app/views/users/_middle_index.html.erb +6 -0
- data/app/views/users/_profile.html.erb +60 -10
- data/app/views/users/_right_index.html.erb +19 -0
- data/app/views/users/edit.html.erb +19 -14
- data/app/views/users/index.html.erb +14 -33
- data/app/views/users/index.js.erb +1 -0
- data/app/views/users/update.js.erb +32 -10
- data/config/locales/en.yml +7 -1
- data/config/routes.rb +1 -1
- data/lib/generators/social_stream/templates/migration.rb +1 -0
- data/lib/generators/social_stream/templates/public/images/btn/search.png +0 -0
- data/lib/generators/social_stream/templates/public/images/fcbkcomplete/close.gif +0 -0
- data/lib/generators/social_stream/templates/public/images/loader.gif +0 -0
- data/lib/generators/social_stream/templates/public/javascripts/ajax.paginate.js +53 -0
- data/lib/generators/social_stream/templates/public/javascripts/jqcloud-0.1.3.min.js +11 -0
- data/lib/generators/social_stream/templates/public/javascripts/jquery.ba-url.js +1091 -0
- data/lib/generators/social_stream/templates/public/javascripts/jquery.fcbkcomplete.min.js +77 -0
- data/lib/generators/social_stream/templates/public/javascripts/jquery.js +640 -344
- data/lib/generators/social_stream/templates/public/javascripts/jquery.min.js +16 -0
- data/lib/generators/social_stream/templates/public/javascripts/jquery.validate.js +31 -19
- data/lib/generators/social_stream/templates/public/javascripts/rails.js +157 -146
- data/lib/generators/social_stream/templates/public/stylesheets/edit_user.css +14 -3
- data/lib/generators/social_stream/templates/public/stylesheets/fcbkComplete.css +36 -0
- data/lib/generators/social_stream/templates/public/stylesheets/jqcloud.css +62 -0
- data/lib/generators/social_stream/templates/public/stylesheets/social_stream.css +3 -0
- data/lib/generators/social_stream/templates/public/stylesheets/users.css +22 -0
- data/lib/social_stream/models/subject.rb +2 -1
- data/lib/social_stream/version.rb +1 -1
- data/social_stream.gemspec +2 -1
- data/spec/controllers/contacts_controller_spec.rb +12 -0
- metadata +40 -7
@@ -1,146 +1,157 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
}
|
1
|
+
/**
|
2
|
+
* Unobtrusive scripting adapter for jQuery
|
3
|
+
*
|
4
|
+
* Requires jQuery 1.4.3 or later.
|
5
|
+
* https://github.com/rails/jquery-ujs
|
6
|
+
*/
|
7
|
+
|
8
|
+
(function($) {
|
9
|
+
// Make sure that every Ajax request sends the CSRF token
|
10
|
+
function CSRFProtection(xhr) {
|
11
|
+
var token = $('meta[name="csrf-token"]').attr('content');
|
12
|
+
if (token) xhr.setRequestHeader('X-CSRF-Token', token);
|
13
|
+
}
|
14
|
+
if ('ajaxPrefilter' in $) $.ajaxPrefilter(function(options, originalOptions, xhr){ CSRFProtection(xhr) });
|
15
|
+
else $(document).ajaxSend(function(e, xhr){ CSRFProtection(xhr) });
|
16
|
+
|
17
|
+
// Triggers an event on an element and returns the event result
|
18
|
+
function fire(obj, name, data) {
|
19
|
+
var event = new $.Event(name);
|
20
|
+
obj.trigger(event, data);
|
21
|
+
return event.result !== false;
|
22
|
+
}
|
23
|
+
|
24
|
+
// Submits "remote" forms and links with ajax
|
25
|
+
function handleRemote(element) {
|
26
|
+
var method, url, data,
|
27
|
+
dataType = element.attr('data-type') || ($.ajaxSettings && $.ajaxSettings.dataType);
|
28
|
+
|
29
|
+
if (element.is('form')) {
|
30
|
+
method = element.attr('method');
|
31
|
+
url = element.attr('action');
|
32
|
+
data = element.serializeArray();
|
33
|
+
// memoized value from clicked submit button
|
34
|
+
var button = element.data('ujs:submit-button');
|
35
|
+
if (button) {
|
36
|
+
data.push(button);
|
37
|
+
element.data('ujs:submit-button', null);
|
38
|
+
}
|
39
|
+
} else {
|
40
|
+
method = element.attr('data-method');
|
41
|
+
url = element.attr('href');
|
42
|
+
data = null;
|
43
|
+
}
|
44
|
+
|
45
|
+
$.ajax({
|
46
|
+
url: url, type: method || 'GET', data: data, dataType: dataType,
|
47
|
+
// stopping the "ajax:beforeSend" event will cancel the ajax request
|
48
|
+
beforeSend: function(xhr, settings) {
|
49
|
+
if (settings.dataType === undefined) {
|
50
|
+
xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
|
51
|
+
}
|
52
|
+
return fire(element, 'ajax:beforeSend', [xhr, settings]);
|
53
|
+
},
|
54
|
+
success: function(data, status, xhr) {
|
55
|
+
element.trigger('ajax:success', [data, status, xhr]);
|
56
|
+
},
|
57
|
+
complete: function(xhr, status) {
|
58
|
+
element.trigger('ajax:complete', [xhr, status]);
|
59
|
+
},
|
60
|
+
error: function(xhr, status, error) {
|
61
|
+
element.trigger('ajax:error', [xhr, status, error]);
|
62
|
+
}
|
63
|
+
});
|
64
|
+
}
|
65
|
+
|
66
|
+
// Handles "data-method" on links such as:
|
67
|
+
// <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a>
|
68
|
+
function handleMethod(link) {
|
69
|
+
var href = link.attr('href'),
|
70
|
+
method = link.attr('data-method'),
|
71
|
+
csrf_token = $('meta[name=csrf-token]').attr('content'),
|
72
|
+
csrf_param = $('meta[name=csrf-param]').attr('content'),
|
73
|
+
form = $('<form method="post" action="' + href + '"></form>'),
|
74
|
+
metadata_input = '<input name="_method" value="' + method + '" type="hidden" />';
|
75
|
+
|
76
|
+
if (csrf_param !== undefined && csrf_token !== undefined) {
|
77
|
+
metadata_input += '<input name="' + csrf_param + '" value="' + csrf_token + '" type="hidden" />';
|
78
|
+
}
|
79
|
+
|
80
|
+
form.hide().append(metadata_input).appendTo('body');
|
81
|
+
form.submit();
|
82
|
+
}
|
83
|
+
|
84
|
+
function disableFormElements(form) {
|
85
|
+
form.find('input[data-disable-with]').each(function() {
|
86
|
+
var input = $(this);
|
87
|
+
input.data('ujs:enable-with', input.val())
|
88
|
+
.val(input.attr('data-disable-with'))
|
89
|
+
.attr('disabled', 'disabled');
|
90
|
+
});
|
91
|
+
}
|
92
|
+
|
93
|
+
function enableFormElements(form) {
|
94
|
+
form.find('input[data-disable-with]').each(function() {
|
95
|
+
var input = $(this);
|
96
|
+
input.val(input.data('ujs:enable-with')).removeAttr('disabled');
|
97
|
+
});
|
98
|
+
}
|
99
|
+
|
100
|
+
function allowAction(element) {
|
101
|
+
var message = element.attr('data-confirm');
|
102
|
+
return !message || (fire(element, 'confirm') && confirm(message));
|
103
|
+
}
|
104
|
+
|
105
|
+
function requiredValuesMissing(form) {
|
106
|
+
var missing = false;
|
107
|
+
form.find('input[name][required]').each(function() {
|
108
|
+
if (!$(this).val()) missing = true;
|
109
|
+
});
|
110
|
+
return missing;
|
111
|
+
}
|
112
|
+
|
113
|
+
$('a[data-confirm], a[data-method], a[data-remote]').live('click.rails', function(e) {
|
114
|
+
var link = $(this);
|
115
|
+
if (!allowAction(link)) return false;
|
116
|
+
|
117
|
+
if (link.attr('data-remote') != undefined) {
|
118
|
+
handleRemote(link);
|
119
|
+
return false;
|
120
|
+
} else if (link.attr('data-method')) {
|
121
|
+
handleMethod(link);
|
122
|
+
return false;
|
123
|
+
}
|
124
|
+
});
|
125
|
+
|
126
|
+
$('form').live('submit.rails', function(e) {
|
127
|
+
var form = $(this), remote = form.attr('data-remote') != undefined;
|
128
|
+
if (!allowAction(form)) return false;
|
129
|
+
|
130
|
+
// skip other logic when required values are missing
|
131
|
+
if (requiredValuesMissing(form)) return !remote;
|
132
|
+
|
133
|
+
if (remote) {
|
134
|
+
handleRemote(form);
|
135
|
+
return false;
|
136
|
+
} else {
|
137
|
+
// slight timeout so that the submit button gets properly serialized
|
138
|
+
setTimeout(function(){ disableFormElements(form) }, 13);
|
139
|
+
}
|
140
|
+
});
|
141
|
+
|
142
|
+
$('form input[type=submit], form button[type=submit], form button:not([type])').live('click.rails', function() {
|
143
|
+
var button = $(this);
|
144
|
+
if (!allowAction(button)) return false;
|
145
|
+
// register the pressed submit button
|
146
|
+
var name = button.attr('name'), data = name ? {name:name, value:button.val()} : null;
|
147
|
+
button.closest('form').data('ujs:submit-button', data);
|
148
|
+
});
|
149
|
+
|
150
|
+
$('form').live('ajax:beforeSend.rails', function(event) {
|
151
|
+
if (this == event.target) disableFormElements($(this));
|
152
|
+
});
|
153
|
+
|
154
|
+
$('form').live('ajax:complete.rails', function(event) {
|
155
|
+
if (this == event.target) enableFormElements($(this));
|
156
|
+
});
|
157
|
+
})( jQuery );
|
@@ -23,16 +23,27 @@
|
|
23
23
|
float: left;
|
24
24
|
}
|
25
25
|
|
26
|
-
|
26
|
+
#personal_info {
|
27
27
|
padding-right: 4px;
|
28
|
-
padding-top:
|
29
|
-
text-align: center;
|
28
|
+
padding-top: 30px;
|
30
29
|
}
|
31
30
|
|
32
31
|
/*Edit*/
|
32
|
+
.confirmed{
|
33
|
+
color: #009933;
|
34
|
+
padding-left: 5%;
|
35
|
+
}
|
33
36
|
.editField{
|
34
37
|
padding-top: 5px;
|
35
38
|
}
|
39
|
+
.error{
|
40
|
+
color: #A2042B;
|
41
|
+
font-weight: bold;
|
42
|
+
}
|
43
|
+
.error_explanation{
|
44
|
+
color: #A2042B;
|
45
|
+
padding-left: 5%;
|
46
|
+
}
|
36
47
|
.section_highlight{
|
37
48
|
border-left: none;
|
38
49
|
border-bottom: thin solid #D4E4EA;
|
@@ -0,0 +1,36 @@
|
|
1
|
+
/* TextboxList sample CSS */
|
2
|
+
ul.holder { margin: 0; border: 1px solid #999; overflow: hidden; height: auto !important; height: 1%; padding: 4px 5px 0; }
|
3
|
+
*:first-child+html ul.holder { padding-bottom: 2px; } * html ul.holder { padding-bottom: 2px; } /* ie7 and below */
|
4
|
+
ul.holder li { float: left; list-style-type: none; margin: 0 5px 4px 0; white-space:nowrap;}
|
5
|
+
ul.holder li.bit-box, ul.holder li.bit-input input { font: 11px "Lucida Grande", "Verdana"; }
|
6
|
+
ul.holder li.bit-box { -moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; border: 1px solid #CAD8F3; background: #DEE7F8; padding: 1px 5px 2px; }
|
7
|
+
ul.holder li.bit-box-focus { border-color: #598BEC; background: #598BEC; color: #fff; }
|
8
|
+
ul.holder li.bit-input input { width: auto; overflow:visible; margin: 0; border: 0px; outline: 0; padding: 3px 0px 2px; } /* no left/right padding here please */
|
9
|
+
ul.holder li.bit-input input.smallinput { width: 20px; }
|
10
|
+
|
11
|
+
/* Facebook demo CSS */
|
12
|
+
ul.holder { width: 500px; }
|
13
|
+
ul.holder { margin: 0 !important }
|
14
|
+
ul.holder li.bit-box, #apple-list ul.holder li.bit-box { padding-right: 15px; position: relative; z-index:1000;}
|
15
|
+
#apple-list ul.holder li.bit-input { margin: 0; }
|
16
|
+
#apple-list ul.holder li.bit-input input.smallinput { width: 5px; }
|
17
|
+
ul.holder li.bit-hover { background: #BBCEF1; border: 1px solid #6D95E0; }
|
18
|
+
ul.holder li.bit-box-focus { border-color: #598BEC; background: #598BEC; color: #fff; }
|
19
|
+
ul.holder li.bit-box a.closebutton { position: absolute; right: 4px; top: 5px; display: block; width: 7px; height: 7px; font-size: 1px; background: url('../images/fcbkcomplete/close.gif'); }
|
20
|
+
ul.holder li.bit-box a.closebutton:hover { background-position: 7px; }
|
21
|
+
ul.holder li.bit-box-focus a.closebutton, ul.holder li.bit-box-focus a.closebutton:hover { background-position: bottom; }
|
22
|
+
|
23
|
+
/* Autocompleter */
|
24
|
+
|
25
|
+
.facebook-auto { display: none; position: absolute; width: 512px; background: #eee; z-index:1001;}
|
26
|
+
.facebook-auto .default { padding: 5px 7px; border: 1px solid #ccc; border-width: 0 1px 1px;font-family:"Lucida Grande","Verdana"; font-size:11px; }
|
27
|
+
.facebook-auto ul { display: none; margin: 0; padding: 0; overflow: auto; position:absolute; z-index:9999}
|
28
|
+
.facebook-auto ul li { padding: 5px 12px; z-index: 1000; cursor: pointer; margin: 0; list-style-type: none; border: 1px solid #ccc; border-width: 0 1px 1px; font: 11px "Lucida Grande", "Verdana"; background-color: #eee }
|
29
|
+
.facebook-auto ul li em { font-weight: bold; font-style: normal; background: #ccc; }
|
30
|
+
.facebook-auto ul li.auto-focus { background: #4173CC; color: #fff; }
|
31
|
+
.facebook-auto ul li.auto-focus em { background: none; }
|
32
|
+
.deleted { background-color:#4173CC !important; color:#ffffff !important;}
|
33
|
+
.hidden { display:none;}
|
34
|
+
|
35
|
+
#demo ul.holder li.bit-input input { padding: 2px 0 1px; border: 1px solid #999; }
|
36
|
+
.ie6fix {height:1px;width:1px; position:absolute;top:0px;left:0px;z-index:1;}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
div#wordcloud {
|
2
|
+
font-family: "Helvetica", "Arial", sans-serif;
|
3
|
+
color: #09f;
|
4
|
+
overflow: hidden;
|
5
|
+
position: relative;
|
6
|
+
width: 200px;
|
7
|
+
height: 200px;
|
8
|
+
}
|
9
|
+
|
10
|
+
div#wordcloud a {
|
11
|
+
color: inherit;
|
12
|
+
text-decoration: none;
|
13
|
+
}
|
14
|
+
div#wordcloud a:hover {
|
15
|
+
color: #0df;
|
16
|
+
}
|
17
|
+
div#wordcloud a:hover {
|
18
|
+
color: #0cf;
|
19
|
+
}
|
20
|
+
div#wordcloud span {
|
21
|
+
padding: 0;
|
22
|
+
}
|
23
|
+
div#wordcloud span.w10 {
|
24
|
+
font-size: 44px;
|
25
|
+
color: #0cf;
|
26
|
+
}
|
27
|
+
div#wordcloud span.w9 {
|
28
|
+
font-size: 40px;
|
29
|
+
color: #0cf;
|
30
|
+
}
|
31
|
+
div#wordcloud span.w8 {
|
32
|
+
font-size: 34px;
|
33
|
+
color: #0cf;
|
34
|
+
}
|
35
|
+
div#wordcloud span.w7 {
|
36
|
+
font-size: 30px;
|
37
|
+
color: #39d;
|
38
|
+
}
|
39
|
+
div#wordcloud span.w6 {
|
40
|
+
font-size: 24px;
|
41
|
+
color: #90c5f0;
|
42
|
+
}
|
43
|
+
div#wordcloud span.w5 {
|
44
|
+
font-size: 20px;
|
45
|
+
color: #90a0dd;
|
46
|
+
}
|
47
|
+
div#wordcloud span.w4 {
|
48
|
+
font-size: 14px;
|
49
|
+
color: #90c5f0;
|
50
|
+
}
|
51
|
+
div#wordcloud span.w3 {
|
52
|
+
font-size: 10px;
|
53
|
+
color: #a0ddff;
|
54
|
+
}
|
55
|
+
div#wordcloud span.w2 {
|
56
|
+
font-size: 4px;
|
57
|
+
color: #99ccee;
|
58
|
+
}
|
59
|
+
div#wordcloud span.w1 {
|
60
|
+
font-size: 1px;
|
61
|
+
color: #aab5f0;
|
62
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#ajax_loader_icon, .pagination{
|
2
|
+
text-align:center;
|
3
|
+
padding-top: 20px;
|
4
|
+
}
|
5
|
+
|
6
|
+
.letters{
|
7
|
+
text-align:center;
|
8
|
+
padding-bottom: 20px;
|
9
|
+
}
|
10
|
+
|
11
|
+
.search_input{
|
12
|
+
border-color: #0656a4;
|
13
|
+
color: #2A3890;
|
14
|
+
margin-left: 5px;
|
15
|
+
padding: 2px 2px 2px 2px;
|
16
|
+
border:1px solid #BDC7D8;
|
17
|
+
}
|
18
|
+
|
19
|
+
#search_button{
|
20
|
+
cursor: pointer;
|
21
|
+
margin-top: 2px;
|
22
|
+
}
|
@@ -32,7 +32,8 @@ module SocialStream
|
|
32
32
|
validates_presence_of :name
|
33
33
|
|
34
34
|
scope :alphabetic, includes(:actor).order('actors.name')
|
35
|
-
|
35
|
+
scope :search, lambda{|param|
|
36
|
+
joins(:actor).where('actors.name like ?',param)}
|
36
37
|
scope :with_sent_ties, joins(:actor => :sent_ties)
|
37
38
|
scope :with_received_ties, joins(:actor => :received_ties)
|
38
39
|
end
|
data/social_stream.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.add_runtime_dependency('atd-ancestry', '1.3.0')
|
13
13
|
s.add_runtime_dependency('nested_set', '~> 1.5.3')
|
14
14
|
s.add_runtime_dependency('foreigner', '~> 0.9.1')
|
15
|
-
s.add_runtime_dependency('devise', '~> 1.1.
|
15
|
+
s.add_runtime_dependency('devise', '~> 1.1.7')
|
16
16
|
s.add_runtime_dependency('inherited_resources', '~> 1.1.2')
|
17
17
|
s.add_runtime_dependency('stringex', '~> 1.2.0')
|
18
18
|
s.add_runtime_dependency('paperclip', '~> 2.3.4')
|
@@ -28,4 +28,5 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.add_development_dependency('rspec-rails', '~> 2.4.1')
|
29
29
|
s.add_development_dependency('factory_girl', '~> 1.3.2')
|
30
30
|
s.add_development_dependency('forgery', '~> 0.3.6')
|
31
|
+
s.add_development_dependency('ci_reporter', '~> 1.6.4')
|
31
32
|
end
|