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
@@ -11,7 +11,7 @@
|
|
11
11
|
<%= form_for(@user, :remote => true) do |f| %>
|
12
12
|
<% if @user.errors.any? %>
|
13
13
|
<div id="error_explanation">
|
14
|
-
<h2><%= pluralize(@user.errors.count, "error") %>prohibited this user from being saved:</h2>
|
14
|
+
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
|
15
15
|
<ul>
|
16
16
|
<% @user.errors.full_messages.each do |msg| %>
|
17
17
|
<li>
|
@@ -28,8 +28,7 @@
|
|
28
28
|
$("#contact_info").addClass('section_normal');
|
29
29
|
$("#experience_info").addClass('section_normal');
|
30
30
|
$("#personal_info").addClass('section_normal');
|
31
|
-
|
32
|
-
$(".space_profile").addClass('section_normal');
|
31
|
+
|
33
32
|
|
34
33
|
$("#edit_user_1").validate();
|
35
34
|
|
@@ -47,9 +46,10 @@
|
|
47
46
|
<%= f.text_field :name, :class => "required" %>
|
48
47
|
|
49
48
|
<br/>
|
49
|
+
|
50
50
|
<script type="text/javascript">
|
51
51
|
|
52
|
-
$(function() {
|
52
|
+
$(function () {
|
53
53
|
$( "#user_profile_attributes_birthday" ).datepicker({ yearRange: '1900:<%= Time.now.utc.to_date.year%>',
|
54
54
|
changeYear: true, maxDate: '+0d', defaultDate: '-30y'});
|
55
55
|
|
@@ -60,20 +60,22 @@
|
|
60
60
|
|
61
61
|
</script>
|
62
62
|
<%= f.fields_for :profile do |profile_form| %>
|
63
|
+
|
63
64
|
<div class="editField">
|
64
|
-
<%= profile_form.label :
|
65
|
+
<%= profile_form.label :organization %>
|
65
66
|
<br/>
|
66
|
-
|
67
|
-
<%= profile_form.text_field :
|
67
|
+
</div>
|
68
|
+
<%= profile_form.text_field :organization %>
|
68
69
|
<br/>
|
69
|
-
|
70
|
-
|
71
70
|
<div class="editField">
|
72
|
-
<%= profile_form.label :
|
71
|
+
<%= profile_form.label :birthday %>
|
73
72
|
<br/>
|
74
73
|
</div>
|
75
|
-
<%= profile_form.text_field :
|
74
|
+
<%= profile_form.text_field( :birthday , :class => "date") %>
|
76
75
|
<br/>
|
76
|
+
|
77
|
+
|
78
|
+
|
77
79
|
<div class="editField">
|
78
80
|
<%= profile_form.label :city %>
|
79
81
|
<br/>
|
@@ -114,19 +116,19 @@
|
|
114
116
|
<%= profile_form.label :phone %>
|
115
117
|
<br/>
|
116
118
|
</div>
|
117
|
-
<%= profile_form.text_field :phone, :class => "
|
119
|
+
<%= profile_form.text_field :phone, :class => "phone" %>
|
118
120
|
<br/>
|
119
121
|
<div class="editField">
|
120
122
|
<%= profile_form.label :mobile %>
|
121
123
|
<br/>
|
122
124
|
</div>
|
123
|
-
<%= profile_form.text_field :mobile, :class => "
|
125
|
+
<%= profile_form.text_field :mobile, :class => "phone" %>
|
124
126
|
<br/>
|
125
127
|
<div class="editField">
|
126
128
|
<%= profile_form.label :fax %>
|
127
129
|
<br/>
|
128
130
|
</div>
|
129
|
-
<%= profile_form.text_field :fax, :class => "
|
131
|
+
<%= profile_form.text_field :fax, :class => "phone" %>
|
130
132
|
<br/>
|
131
133
|
<div class="editField">
|
132
134
|
<%= profile_form.label :address %>
|
@@ -164,6 +166,9 @@
|
|
164
166
|
<% end %>
|
165
167
|
<% end %>
|
166
168
|
</div>
|
169
|
+
<% if params[:section].present? %>
|
170
|
+
<%= hidden_field_tag("section", params[:section]) %>
|
171
|
+
<% end %>
|
167
172
|
<div class="actions">
|
168
173
|
<%= f.submit "Update" %> <button onclick="window.location.href='<%= user_url(@user) %>';">Cancel</button>
|
169
174
|
</div>
|
@@ -1,3 +1,6 @@
|
|
1
|
+
<% content_for :head, stylesheet_link_tag("users") %>
|
2
|
+
|
3
|
+
|
1
4
|
<% content_for :middle do %>
|
2
5
|
<%= render :partial => "users/middle_index" %>
|
3
6
|
<% end %>
|
@@ -15,52 +18,30 @@
|
|
15
18
|
<div class="space_center">
|
16
19
|
</div>
|
17
20
|
|
18
|
-
<div class="space_center">
|
19
|
-
</div>
|
20
|
-
|
21
21
|
<div id="my_conferences">
|
22
22
|
<div id="tabconference_browse" class="widget content_size">
|
23
23
|
<ul class="tabconference_browse">
|
24
24
|
<li>
|
25
|
-
<a href="
|
25
|
+
<a href="/users"><%= t('user.all')%> (<%=User.count%>) </a>
|
26
26
|
</li>
|
27
27
|
</ul>
|
28
28
|
<div id="contacts" class="tabconference_browse">
|
29
29
|
<div class="space_center">
|
30
30
|
</div>
|
31
|
+
<div><input type="text" value="Search by name" id="search_field" class="search_input" /><%= image_tag("btn/search.png",:size=>"20x20",:id=>"search_button") %></div>
|
32
|
+
<div class="space_center">
|
33
|
+
</div>
|
31
34
|
<div class="letters" class="content_size">
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
<a href="#">D</a>
|
36
|
-
<a href="#">E</a>
|
37
|
-
<a href="#">F</a>
|
38
|
-
<a href="#">G</a>
|
39
|
-
<a href="#">H</a>
|
40
|
-
<a href="#">I</a>
|
41
|
-
<a href="#">J</a>
|
42
|
-
<a href="#">K</a>
|
43
|
-
<a href="#">L</a>
|
44
|
-
<a href="#">M</a>
|
45
|
-
<a href="#">N</a>
|
46
|
-
<a href="#">O</a>
|
47
|
-
<a href="#">P</a>
|
48
|
-
<a href="#">Q</a>
|
49
|
-
<a href="#">R</a>
|
50
|
-
<a href="#">S</a>
|
51
|
-
<a href="#">T</a>
|
52
|
-
<a href="#">U</a>
|
53
|
-
<a href="#">V</a>
|
54
|
-
<a href="#">W</a>
|
55
|
-
<a href="#">X</a>
|
56
|
-
<a href="#">Y</a>
|
57
|
-
<a href="#">Z</a>
|
35
|
+
<% for char in 'A'..'Z' %>
|
36
|
+
<%= link_to char,{:letter => char,:page => 1},:class => "user_letter_link" %>
|
37
|
+
<% end %>
|
58
38
|
</div>
|
59
39
|
<div class="space_center" class="content_size">
|
60
40
|
|
61
41
|
</div>
|
62
|
-
|
63
|
-
|
42
|
+
<div id="list_users_ajax">
|
43
|
+
<%= render :partial => "users/index"%>
|
44
|
+
</div>
|
64
45
|
<div class="space_center">
|
65
46
|
</div>
|
66
47
|
</div>
|
@@ -73,4 +54,4 @@
|
|
73
54
|
<br class="clearfloat" />
|
74
55
|
<div class="space_center">
|
75
56
|
</div>
|
76
|
-
|
57
|
+
<%= javascript_include_tag "ajax.paginate" %>
|
@@ -0,0 +1 @@
|
|
1
|
+
$('#list_users_ajax').html("<%= escape_javascript(render :partial => "users/index") %>");
|
@@ -1,19 +1,41 @@
|
|
1
1
|
|
2
|
-
<% if @user.valid? %>
|
3
|
-
|
4
|
-
|
5
2
|
if ($("#notice").length == 0){
|
6
|
-
|
7
|
-
$("#content").prepend('<div id="notice"></div>');
|
8
|
-
|
9
|
-
}
|
10
|
-
$("#notice").html("<h2>Form Submitted!</h2>");
|
11
3
|
|
4
|
+
$("#content").prepend('<div id="notice"></div>');
|
5
|
+
|
6
|
+
}
|
7
|
+
|
8
|
+
<% if @user.valid? %>
|
9
|
+
|
10
|
+
$("#notice").html("<h2>Form Submitted!</h2><br/>");
|
11
|
+
$("#notice").removeClass('error_explanation');
|
12
|
+
$("#notice").addClass('confirmed');
|
12
13
|
$("#middleContent").replaceWith("<%= escape_javascript(render(:partial => 'middle_show'))%>");
|
13
14
|
|
15
|
+
$("#contact_info").addClass('section_normal');
|
16
|
+
$("#experience_info").addClass('section_normal');
|
17
|
+
$("#personal_info").addClass('section_normal');
|
18
|
+
|
19
|
+
<% if !params[:section].present? or params[:section].eql?("about_me") %>
|
20
|
+
$("#personal_info").removeClass('section_normal');
|
21
|
+
$("#personal_info").addClass('section_highlight');
|
22
|
+
<%end%>
|
23
|
+
|
24
|
+
<% if !params[:section].present? or params[:section].eql?("contact_info") %>
|
25
|
+
$("#contact_info").removeClass('section_normal');
|
26
|
+
$("#contact_info").addClass('section_highlight');
|
27
|
+
<%end%>
|
28
|
+
|
29
|
+
<% if !params[:section].present? or params[:section].eql?("my_experience") %>
|
30
|
+
$("#experience_info").removeClass('section_normal');
|
31
|
+
$("#experience_info").addClass('section_highlight');
|
32
|
+
<%end%>
|
33
|
+
|
14
34
|
<% else %>
|
15
|
-
|
16
|
-
|
35
|
+
$("#notice").html("<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>"
|
36
|
+
+"<ul><% @user.errors.full_messages.each do |msg| %><li><%= msg %></li><% end %></ul><br/>");
|
37
|
+
$("#notice").removeClass('confirmed');
|
38
|
+
$("#notice").addClass('error_explanation');
|
17
39
|
|
18
40
|
<% end %>
|
19
41
|
|
data/config/locales/en.yml
CHANGED
@@ -52,7 +52,12 @@ en:
|
|
52
52
|
by: "By groups"
|
53
53
|
last: "Last groups"
|
54
54
|
my: "My groups"
|
55
|
-
new:
|
55
|
+
new:
|
56
|
+
action: "New group"
|
57
|
+
name: "Name"
|
58
|
+
description: "Description"
|
59
|
+
participants: "Participants"
|
60
|
+
cloud: "Group tag cloud"
|
56
61
|
popular:
|
57
62
|
most: "Most popular"
|
58
63
|
voted:
|
@@ -93,4 +98,5 @@ en:
|
|
93
98
|
by: "By Users"
|
94
99
|
one: "User"
|
95
100
|
other: "Users"
|
101
|
+
all: "All users"
|
96
102
|
|
data/config/routes.rb
CHANGED
Binary file
|
Binary file
|
@@ -0,0 +1,53 @@
|
|
1
|
+
$(function(){
|
2
|
+
|
3
|
+
$('#search_field').live('click',function(){
|
4
|
+
if(this.value=="Search by name"){
|
5
|
+
this.value="";
|
6
|
+
}
|
7
|
+
});
|
8
|
+
|
9
|
+
$('#search_field').keypress(function(event){
|
10
|
+
if(event.keyCode == '13'){
|
11
|
+
$('#list_users_ajax').html("<div id='ajax_loader_icon'><img src='../images/loader.gif'></div>");
|
12
|
+
$.getScript(window.location.pathname+"?search="+this.value+"");
|
13
|
+
}
|
14
|
+
});
|
15
|
+
|
16
|
+
$('#search_button').click(function(){
|
17
|
+
e = $.Event('keypress');
|
18
|
+
e.keyCode = 13;
|
19
|
+
$('#search_field').trigger(e);
|
20
|
+
});
|
21
|
+
|
22
|
+
$('.pagination a').live('click',function(){
|
23
|
+
$('#list_users_ajax').html("<div id='ajax_loader_icon'><img src='../images/loader.gif'></div>");
|
24
|
+
$.setFragment({ "page" : $.queryString(this.href).page });
|
25
|
+
$.getScript(this.href);
|
26
|
+
return false;
|
27
|
+
});
|
28
|
+
|
29
|
+
$('.user_letter_link').live('click',function(){
|
30
|
+
$('#list_users_ajax').html("<div id='ajax_loader_icon'><img src='../images/loader.gif'></div>");
|
31
|
+
$.setFragment({ "page" : $.queryString(this.href).page });
|
32
|
+
$.setFragment({ "letter" : $.queryString(this.href).letter });
|
33
|
+
$.getScript(this.href);
|
34
|
+
return false;
|
35
|
+
});
|
36
|
+
|
37
|
+
$.fragmentChange(true);
|
38
|
+
$(document).bind("fragmentChange.page", function() {
|
39
|
+
$.getScript($.queryString(document.location.href, { "page" : $.fragment().page,
|
40
|
+
"letter": $.fragment().letter}));
|
41
|
+
});
|
42
|
+
$(document).bind("fragmentChange.letter", function() {
|
43
|
+
$.getScript($.queryString(document.location.href, { "page" : $.fragment().page,
|
44
|
+
"letter": $.fragment().letter}));
|
45
|
+
});
|
46
|
+
|
47
|
+
if ($.fragment().page) {
|
48
|
+
$(document).trigger("fragmentChange.page");
|
49
|
+
}
|
50
|
+
if ($.fragment().letter) {
|
51
|
+
$(document).trigger("fragmentChange.letter");
|
52
|
+
}
|
53
|
+
});
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/*
|
2
|
+
* jQCloud Plugin for jQuery
|
3
|
+
*
|
4
|
+
* Version 0.1.3
|
5
|
+
*
|
6
|
+
* Copyright 2011, Luca Ongaro
|
7
|
+
* Licensed under the MIT license.
|
8
|
+
*
|
9
|
+
* Date: Wed Feb 16 11:41:32 2011 +0100
|
10
|
+
*/
|
11
|
+
(function(a){a.fn.jQCloud=function(c,e){var d=this;var b=function(){var g=function(o,m){var l=function(q,p){if(Math.abs(2*q.offsetLeft+q.offsetWidth-2*p.offsetLeft-p.offsetWidth)<q.offsetWidth+p.offsetWidth){if(Math.abs(2*q.offsetTop+q.offsetHeight-2*p.offsetTop-p.offsetHeight)<q.offsetHeight+p.offsetHeight){return true}}return false};var n=0;for(n=0;n<m.length;n++){if(l(o,m[n])){return true}}return false};c.sort(function(m,l){if(m.weight<l.weight){return 1}else{if(m.weight>l.weight){return -1}else{return 0}}});var i=2;var f=[];var h=d.width()/d.height();var k=d.width()/2;var j=d.height()/2;a.each(c,function(q,l){var o=6.28*Math.random();var r=0;var p=Math.round((l.weight-c[c.length-1].weight)/(c[0].weight-c[c.length-1].weight)*9)+1;var u=l.url!==undefined?"<a href='"+l.url+"'>"+l.text+"</a></span>":l.text;d.append("<span id='word_"+q+"' class='w"+p+"' title='"+(l.title||"")+"'>"+u+"</span>");var m=a("#word_"+q).width();var t=a("#word_"+q).height();var n=k-m/2;var s=j-t/2;a("#word_"+q).css("position","absolute");a("#word_"+q).css("left",n+"px");a("#word_"+q).css("top",s+"px");while(g(document.getElementById("word_"+q),f)){r+=i;o+=(q%2===0?1:-1)*i;n=k+(r*Math.cos(o)-(m/2))*h;s=j+r*Math.sin(o)-(t/2);a("#word_"+q).css("left",n+"px");a("#word_"+q).css("top",s+"px")}f.push(document.getElementById("word_"+q))});if(typeof e==="function"){e.call(this)}};setTimeout(function(){b()},100);return this}})(jQuery);
|