social_stream-base 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +3 -3
- data/Rakefile +7 -0
- data/app/assets/images/big-logo.png +0 -0
- data/app/assets/javascripts/activities.js.erb +1 -0
- data/app/assets/javascripts/search.js.erb +6 -0
- data/app/assets/stylesheets/0_devise_sign.css +20 -0
- data/app/assets/stylesheets/base.css +4 -12
- data/app/assets/stylesheets/frontpage.css +3 -2
- data/app/assets/stylesheets/header.css +3 -0
- data/app/assets/stylesheets/search.css +84 -38
- data/app/controllers/search_controller.rb +22 -2
- data/app/helpers/search_helper.rb +7 -0
- data/app/views/activity_objects/_activity_object.html.erb +7 -1
- data/app/views/devise/registrations/edit.html.erb +0 -6
- data/app/views/devise/sessions/new.html.erb +4 -2
- data/app/views/frontpage/index.html.erb +2 -4
- data/app/views/groups/_group_with_details.html.erb +2 -0
- data/app/views/groups/_index.html.erb +11 -27
- data/app/views/layouts/_header.erb +6 -1
- data/app/views/layouts/_search.html.erb +16 -16
- data/app/views/layouts/frontpage.html.erb +1 -0
- data/app/views/notifications/index.html.erb +1 -1
- data/app/views/notifications/index.js.erb +1 -2
- data/app/views/search/_header_search.html.erb +18 -13
- data/app/views/search/_index.html.erb +35 -0
- data/app/views/search/index.html.erb +15 -0
- data/app/views/subjects/_subject_with_details.html.erb +17 -0
- data/app/views/users/_index.html.erb +7 -21
- data/app/views/users/_user_with_details.html.erb +2 -0
- data/config/locales/en.yml +4 -0
- data/lib/social_stream/base/version.rb +1 -1
- data/lib/social_stream/toolbar_config.rb +0 -5
- data/spec/dummy/script/rails +1 -1
- metadata +13 -7
- data/app/views/frontpage/_search.html.erb +0 -13
- data/bin/social_stream +0 -57
- data/bin/social_stream_heroku +0 -76
data/README.rdoc
CHANGED
@@ -45,7 +45,7 @@ Do not forget to migrate your database
|
|
45
45
|
|
46
46
|
== Actors and Activity Objects
|
47
47
|
|
48
|
-
{Social Stream Base}[https://github.com/ging/social_stream
|
48
|
+
{Social Stream Base}[https://github.com/ging/social_stream/tree/master/base] relies in
|
49
49
|
Devise[https://github.com/plataformatec/devise].
|
50
50
|
You have authenticated users support in your application by default.
|
51
51
|
|
@@ -60,9 +60,9 @@ initializer.
|
|
60
60
|
|
61
61
|
= Documentation
|
62
62
|
|
63
|
-
{Social Stream Base documentation is available at rdoc.info}[http://rubydoc.info/gems/social_stream
|
63
|
+
{Social Stream Base documentation is available at rdoc.info}[http://rubydoc.info/gems/social_stream/frames]
|
64
64
|
|
65
65
|
= Discussion
|
66
66
|
|
67
67
|
We are reaching beta phase of development.
|
68
|
-
Feel free to add an issue or send a message at github[https://github.com/ging/social_stream
|
68
|
+
Feel free to add an issue or send a message at github[https://github.com/ging/social_stream].
|
data/Rakefile
CHANGED
Binary file
|
@@ -8,6 +8,7 @@ $(function() {
|
|
8
8
|
$('#select_<%= SocialStream.activity_forms.first %>').addClass('selected');
|
9
9
|
$('#security').chosen();
|
10
10
|
$("#input_activities").Watermark("<%= I18n.t('activity.input') %>","#666");
|
11
|
+
$("#event_name").Watermark("<%= I18n.t('event.input') %>","#666");
|
11
12
|
});
|
12
13
|
|
13
14
|
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#center_body{
|
2
|
+
border: none;
|
3
|
+
width:100%;
|
4
|
+
}
|
5
|
+
|
6
|
+
#sidebar{
|
7
|
+
display:none;
|
8
|
+
}
|
9
|
+
|
10
|
+
#toolbar{
|
11
|
+
padding: 0;
|
12
|
+
}
|
13
|
+
|
14
|
+
#wrapper_body{
|
15
|
+
background-color: inherit;
|
16
|
+
background-image: url("/assets/big-logo.png");
|
17
|
+
background-repeat: no-repeat;
|
18
|
+
background-position: bottom left;
|
19
|
+
width:100%;
|
20
|
+
}
|
@@ -18,7 +18,7 @@ h2{padding-left:10px;}
|
|
18
18
|
body{font-size:1.0em; color:#2A3890; background-color:#ffffff; overflow-y: scroll;}
|
19
19
|
#wrapper { background-color: #f5f5f5; width: 100%; margin: 0px auto; }
|
20
20
|
#wrapper_body{min-height: 552px; width: 960px; margin:0px auto; margin-left: auto; margin-right: auto;
|
21
|
-
margin-top: auto; margin-bottom:auto;}
|
21
|
+
margin-top: auto; margin-bottom:auto; background-image:none;}
|
22
22
|
|
23
23
|
|
24
24
|
/*********** Notices SECTION *********************/
|
@@ -52,16 +52,6 @@ textarea.new_contact_text_area{ height: 100px; color: #2A3890;}
|
|
52
52
|
.select_relations select{ font-size: 12px; color: white; background-color:#1F4A75;}
|
53
53
|
|
54
54
|
/************ Forms - Buttons SECTION ***************************/
|
55
|
-
.myButton{ cursor:pointer;
|
56
|
-
background-image: -webkit-gradient(linear,left bottom,left top, color-stop(0.01, rgb(116,191,67)),
|
57
|
-
color-stop(0.51, rgb(117,189,68)),color-stop(0.76, rgb(195,222,171)));
|
58
|
-
background-image: -moz-linear-gradient(center bottom,rgb(116,191,67) 1%,rgb(117,189,68) 51%,
|
59
|
-
rgb(195,222,171) 76%);
|
60
|
-
border-radius: 0.2em; color: #fff; width: 88px; height: 26px; border: none;}
|
61
|
-
.myButton span { display: block; line-height: 14px; padding: 5px 0 5px 18px;}
|
62
|
-
.myButton:active { background-position: bottom right; color: #000; outline: none;}
|
63
|
-
.myButton:active span { background-position: bottom left; padding: 6px 0 4px 18px;}
|
64
|
-
|
65
55
|
.myButtonBlue{ cursor:pointer;
|
66
56
|
background-image: -webkit-gradient( linear, left bottom, left top,
|
67
57
|
color-stop(0.16, rgb(0,122,193)), color-stop(0.58, rgb(56,148,209)), color-stop(0.79, rgb(168,222,249)) );
|
@@ -83,7 +73,9 @@ textarea.new_contact_text_area{ height: 100px; color: #2A3890;}
|
|
83
73
|
.myButtonLarge:active { background-position: bottom right; color: #000; outline: none;}
|
84
74
|
.myButtonLarge:active span { background-position: bottom left; padding: 6px 0 4px 18px;}
|
85
75
|
|
86
|
-
.button{margin: 10px 0 10px
|
76
|
+
.button{margin: 10px 0 10px 0px;padding: 3px 20px 3px 20px;color:#FFFFFF;background-color: #1F4A75;
|
77
|
+
-moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px;
|
78
|
+
font-size: 13px;}
|
87
79
|
.optionHeader {
|
88
80
|
color: #fff;
|
89
81
|
overflow: hidden;
|
@@ -18,8 +18,9 @@ span.find{ padding-right:5px;}
|
|
18
18
|
#devise_links a{font-weight: bold;line-height: 15px; }
|
19
19
|
#login{ padding-top: 5px;}
|
20
20
|
.instructions{text-align: left; padding-bottom: 5px;}
|
21
|
-
#welcome{ margin: 50px auto 50px auto; width:330px; padding:20px; border:
|
22
|
-
text-align:center;
|
21
|
+
#welcome{ margin: 50px auto 50px auto; width:330px; padding:20px; border: 3px solid #BDC7D8;
|
22
|
+
text-align:center; background-color: white;-moz-border-radius: 20px;
|
23
|
+
-webkit-border-radius: 20px; border-radius: 20px;}
|
23
24
|
#wrapper_left{ vertical-align:top; width:49%; display:inline-block; padding-left: 20px;}
|
24
25
|
#wrapper_right{ vertical-align:top; width:48%; display:inline-block;}
|
25
26
|
|
@@ -20,6 +20,9 @@
|
|
20
20
|
.div_login .subtexto{ padding-top: 8px; height:12px; font-size: 11px; }
|
21
21
|
.div_login .a_border{ border-right:thin solid; padding-right:7px; text-decoration:underline; }
|
22
22
|
#new_representation { display: inline-block;}
|
23
|
+
#header_notifications{padding: 0px 5px 0px 5px !important;}
|
24
|
+
#header_notifications a{ color: white; background-color: #879eb5;-moz-border-radius: 6px; -webkit-border-radius: 6px;
|
25
|
+
border-radius: 6px; padding: 4px 9px 4px 9px;}
|
23
26
|
#representation { display: inline; padding-left:3px; padding-right:3px;}
|
24
27
|
.txt_config {color: #fff; vertical-align: top; display: inline; padding-top: 2px; border-right: thin solid;
|
25
28
|
padding-right: 3px;}
|
@@ -1,21 +1,28 @@
|
|
1
|
-
/******************** Search
|
1
|
+
/******************** Search css ***********************/
|
2
|
+
/********************************* Header **************/
|
2
3
|
#header_search {
|
3
4
|
float: left;
|
4
5
|
padding: 1px 10px 0 10px;
|
5
|
-
z-index:2001;
|
6
|
+
z-index: 2001;
|
6
7
|
}
|
7
|
-
|
8
|
-
|
9
|
-
width: 150px;
|
10
|
-
height: 16px;
|
11
|
-
border: solid 1px #dedede;
|
12
|
-
padding:0 3px 0 22px;
|
8
|
+
#header_search_input, #global_search_input {
|
9
|
+
padding: 0 3px 0 22px;
|
13
10
|
background: url('btn/search_icon.png') 5px 50% no-repeat white;
|
14
11
|
font-size: 11px;
|
15
12
|
color: #2A3890;
|
16
13
|
}
|
17
|
-
#
|
18
|
-
|
14
|
+
#header_search_input {
|
15
|
+
border: solid 1px #dedede;
|
16
|
+
height: 16px;
|
17
|
+
width: 150px;
|
18
|
+
}
|
19
|
+
#global_search_input {
|
20
|
+
border: solid 1px #aeaeae;
|
21
|
+
height: 25px;
|
22
|
+
width: 300px;
|
23
|
+
}
|
24
|
+
#header_search_display {
|
25
|
+
width: 225px;
|
19
26
|
display: none;
|
20
27
|
float: right;
|
21
28
|
margin-right: 35px;
|
@@ -26,50 +33,89 @@
|
|
26
33
|
position: absolute;
|
27
34
|
z-index: 2000;
|
28
35
|
background: whiteSmoke;
|
29
|
-
text-align:
|
36
|
+
text-align: left;
|
30
37
|
}
|
31
|
-
|
32
|
-
#global_search_display a {
|
38
|
+
#header_search_display a {
|
33
39
|
color: #2A3890;
|
34
40
|
text-decoration: none;
|
35
41
|
}
|
36
|
-
#
|
42
|
+
#header_search_display a:hover {
|
37
43
|
color: #2A3890;
|
38
|
-
text-decoration: none;
|
44
|
+
text-decoration: none;
|
39
45
|
font-weight: bold;
|
40
46
|
}
|
41
|
-
|
42
|
-
#global_search_display li {
|
47
|
+
#header_search_display li {
|
43
48
|
padding: 4px;
|
44
49
|
border-top: solid 1px #B9B9B9;
|
45
50
|
font-size: 10px;
|
46
51
|
height: 35px;
|
47
52
|
background: whiteSmoke;
|
48
53
|
overflow: hidden;
|
49
|
-
text-align: center;
|
50
54
|
}
|
51
|
-
#
|
52
|
-
|
53
|
-
|
55
|
+
#header_search_display li:hover {
|
56
|
+
background: #CFDEFF;
|
57
|
+
color: #2A3890;
|
58
|
+
}
|
59
|
+
#header_search_display li .logo {
|
60
|
+
float: left;
|
61
|
+
height: 35px;
|
62
|
+
width: 35px;
|
63
|
+
margin-right: 5px;
|
64
|
+
}
|
65
|
+
#header_search_display li .logo img {
|
66
|
+
height: 100%;
|
67
|
+
width: 100%;
|
68
|
+
}
|
69
|
+
#header_search_display li .name {
|
70
|
+
margin-top: 3px;
|
71
|
+
width: 175px;
|
72
|
+
overflow: hidden;
|
73
|
+
}
|
74
|
+
#header_search_display li .link {
|
75
|
+
display: none;
|
76
|
+
}
|
77
|
+
#header_search_display li.subject_result {
|
78
|
+
padding: 0px;
|
79
|
+
height: 45px;
|
54
80
|
}
|
55
|
-
|
56
|
-
#global_search_display li .name {
|
57
|
-
float:left;
|
58
|
-
width: 125px;
|
81
|
+
#header_search_display li.title {
|
59
82
|
overflow: hidden;
|
60
|
-
|
61
|
-
|
83
|
+
text-align: center;
|
84
|
+
background: #879EB5;
|
85
|
+
height: 15px;
|
86
|
+
color: whiteSmoke;
|
87
|
+
font-weight: bold;
|
62
88
|
}
|
63
|
-
|
64
|
-
|
65
|
-
#global_search_display li:hover {
|
66
|
-
background: #CFDEFF;
|
67
|
-
color: #2A3890;
|
89
|
+
#header_search_display li.loading {
|
90
|
+
text-align: center;
|
68
91
|
}
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
92
|
+
#header_search_display li.more, #header_search_display li.none {
|
93
|
+
height: 15px;
|
94
|
+
text-align: center;
|
95
|
+
}
|
96
|
+
#header_search_display li.title:hover, #header_search_display li.more:hover, #header_search_display li.none:hover {
|
97
|
+
}
|
98
|
+
#header_search_display .warning {
|
99
|
+
width: 100%;
|
100
|
+
}
|
101
|
+
/********************************* Global ******************/
|
102
|
+
.search_row {
|
103
|
+
text-align: center;
|
104
|
+
}
|
105
|
+
.subject_with_details {
|
106
|
+
padding: 5px;
|
107
|
+
}
|
108
|
+
.subject_search_results {
|
109
|
+
width: 270px;
|
110
|
+
float: left;
|
111
|
+
text-align: center;
|
112
|
+
margin: 3px;
|
113
|
+
}
|
114
|
+
.subject_search_results .title {
|
115
|
+
width: 260px;
|
116
|
+
margin: auto;
|
117
|
+
background-color: #E1EEF5;
|
118
|
+
padding: 5px;
|
119
|
+
font-weight: bold;
|
73
120
|
}
|
74
|
-
|
75
|
-
/******************** Search box css END ***********************/
|
121
|
+
/******************** Search css END ***********************/
|
@@ -4,12 +4,32 @@ class SearchController < ApplicationController
|
|
4
4
|
|
5
5
|
def index
|
6
6
|
if params[:mode].eql? "header_search"
|
7
|
-
@search_result =
|
7
|
+
@search_result = header_search params[:search_query]
|
8
8
|
render :partial => "header_search", :locals => {:search_result => @search_result}
|
9
9
|
return
|
10
10
|
else
|
11
|
-
@search_result =
|
11
|
+
@search_result = global_search params[:search_query]
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
+
|
16
|
+
|
17
|
+
private
|
18
|
+
def global_search query
|
19
|
+
return search query, params[:page].present? ? params[:page] : 1, 10
|
20
|
+
end
|
21
|
+
|
22
|
+
def header_search query
|
23
|
+
return search query, params[:page].present? ? params[:page] : 1, 3
|
24
|
+
end
|
25
|
+
|
26
|
+
def search query, page, per_page
|
27
|
+
result = Hash.new
|
28
|
+
SocialStream.subjects.each do |subject_sym|
|
29
|
+
result.update({subject_sym => ThinkingSphinx.search("*#{query}*", :page => page, :per_page => per_page, :classes => [subject_sym.to_s.classify.constantize])})
|
30
|
+
result.update({(subject_sym.to_s+"_total").to_sym => ThinkingSphinx.count("*#{query}*", :classes => [subject_sym.to_s.classify.constantize])})
|
31
|
+
end
|
32
|
+
return result
|
33
|
+
|
34
|
+
end
|
15
35
|
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
module SearchHelper
|
2
|
+
def subject_with_details subject
|
3
|
+
subject = subject.subject if subject.is_a? Actor
|
4
|
+
render :partial => subject.class.to_s.pluralize.downcase + '/' + subject.class.to_s.downcase + '_with_details',
|
5
|
+
:locals => {subject.class.to_s.downcase.to_sym => subject}
|
6
|
+
end
|
7
|
+
end
|
@@ -1 +1,7 @@
|
|
1
|
-
|
1
|
+
<% unless activity_object.object.is_a? Actor or activity_object.object.respond_to? :actor %>
|
2
|
+
<%= render activity_object.object %>
|
3
|
+
<% else %>
|
4
|
+
<div class="block">
|
5
|
+
<%= subject_with_details activity_object.object %>
|
6
|
+
</div>
|
7
|
+
<% end %>
|
@@ -49,9 +49,6 @@
|
|
49
49
|
</div>
|
50
50
|
<div class="form_row space_center">
|
51
51
|
<%= f.submit t('button.update'), :class => "button" %>
|
52
|
-
<button class="button" onclick="window.location.href='<%= polymorphic_path(current_subject) %>';">
|
53
|
-
<%= t('button.cancel')%>
|
54
|
-
</button>
|
55
52
|
</div>
|
56
53
|
<% end%>
|
57
54
|
</div>
|
@@ -83,9 +80,6 @@
|
|
83
80
|
</div>
|
84
81
|
<div class="form_row space_center">
|
85
82
|
<%= f.submit t('button.update'), :class => "button" %>
|
86
|
-
<button class="button" onclick="window.location.href='<%= polymorphic_path(current_subject) %>';">
|
87
|
-
<%= t('button.cancel')%>
|
88
|
-
</button>
|
89
83
|
</div>
|
90
84
|
<% end%>
|
91
85
|
</div>
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
<% content_for :headers do%>
|
2
|
+
<%= stylesheet_link_tag "0_devise_sign", :media => "screen, projection" %>
|
3
|
+
<%end%>
|
2
4
|
|
3
5
|
<div id="welcome">
|
4
6
|
<div id="login" class="block">
|
@@ -26,7 +28,7 @@
|
|
26
28
|
</div>
|
27
29
|
|
28
30
|
<div class="btn_login">
|
29
|
-
<%= f.submit t('action.send'), :class =>"
|
31
|
+
<%= f.submit t('action.send'), :class =>"button" %>
|
30
32
|
</div>
|
31
33
|
<% end %>
|
32
34
|
</div>
|
@@ -1,34 +1,18 @@
|
|
1
1
|
<% cont=0; %>
|
2
2
|
<% @groups.each do |group| %>
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
<div class="label">
|
8
|
-
<div class="logo">
|
9
|
-
<%= link_to (image_tag(group.logo.url , :size => "50x50", :alt => group.name )), group %>
|
10
|
-
</div>
|
11
|
-
<div class="sub-block">
|
12
|
-
<div class="name black" >
|
13
|
-
<%= link_to truncate_name(group.name), group %>
|
14
|
-
</div>
|
15
|
-
<div class="brief">
|
16
|
-
<%= t 'follower.n', :count => group.follower_count %>,
|
17
|
-
<%= t 'like.n', :count => group.like_count %>
|
18
|
-
</div>
|
19
|
-
<div class="link">
|
20
|
-
<%= contact_to(group) %>
|
21
|
-
</div>
|
22
|
-
</div>
|
23
|
-
</div>
|
24
|
-
<% if ((cont%2) == 0) %>
|
25
|
-
</div>
|
26
|
-
<% end %>
|
27
|
-
<% end %>
|
28
|
-
<% if ((cont%2) != 0) %>
|
3
|
+
<% if (cont%2) == 0 %>
|
4
|
+
<% cont+=1; %>
|
5
|
+
<div class="row">
|
6
|
+
<% end %>
|
29
7
|
<div class="label">
|
8
|
+
<%= subject_with_details group %>
|
30
9
|
</div>
|
31
|
-
|
10
|
+
<% if ((cont%2) == 0) %>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
<% end %>
|
14
|
+
<% if ((cont%2) != 0) %> <div class="label"></div>
|
15
|
+
</div>
|
32
16
|
<% end %>
|
33
17
|
<div class="row">
|
34
18
|
<%= paginate @groups %>
|
@@ -8,11 +8,16 @@
|
|
8
8
|
<div class="menu_list menu_white" id="menu_home">
|
9
9
|
<ul>
|
10
10
|
<li class="btn_menu_profile"><%= link_to(t('profile.one'), current_subject)%></li>
|
11
|
+
<li id="header_notifications">
|
12
|
+
<%= link_to( current_subject.mailbox.notifications.not_trashed.unread.count.to_s, notifications_path) %>
|
13
|
+
</li>
|
11
14
|
</ul>
|
12
15
|
</div>
|
13
16
|
<% end %>
|
14
17
|
</div>
|
15
|
-
|
18
|
+
<% if user_signed_in? %>
|
19
|
+
<%= render :partial => 'layouts/search' %>
|
20
|
+
<%end%>
|
16
21
|
<div id="header_right">
|
17
22
|
<% if user_signed_in? %>
|
18
23
|
<%= render :partial => 'layouts/representation' %>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<div id="header_search">
|
2
|
-
<form action="
|
3
|
-
|
2
|
+
<form action="<%=search_path%>" method="get">
|
3
|
+
<%= text_field_tag :search_query, nil,:autocomplete => :off, :id => :header_search_input %>
|
4
4
|
</form>
|
5
|
-
<div id="
|
6
|
-
|
5
|
+
<div id="header_search_display">
|
6
|
+
<ul><li class="loading"><%= image_tag('loading.gif', :class => :loading) %></li></ul>
|
7
7
|
</div>
|
8
8
|
</div>
|
9
9
|
<%= javascript_tag do %>
|
@@ -11,40 +11,40 @@ $(document).ready(function() {
|
|
11
11
|
var last_search = "";
|
12
12
|
|
13
13
|
$(document).click(function() {
|
14
|
-
$("#
|
14
|
+
$("#header_search_display").hide();
|
15
15
|
});
|
16
|
-
$('#
|
16
|
+
$('#header_search_input').click(function(e) {
|
17
17
|
e.stopPropagation();
|
18
18
|
});
|
19
|
-
$('#
|
19
|
+
$('#header_search_display').click(function(e) {
|
20
20
|
e.stopPropagation();
|
21
21
|
});
|
22
22
|
|
23
|
-
$("#
|
23
|
+
$("#header_search_input").Watermark("<%= escape_javascript(I18n.t('search.name')) %>");
|
24
24
|
|
25
|
-
$("#
|
25
|
+
$("#header_search_input").keyup(function() {
|
26
26
|
var searchstring = $(this).val();
|
27
27
|
if((searchstring=="")){
|
28
28
|
if (last_search!=searchstring){last_search=searchstring;}
|
29
|
-
$("#
|
29
|
+
$("#header_search_display").hide();
|
30
30
|
}
|
31
31
|
else if(searchstring.length < 2) {
|
32
32
|
if (last_search!=searchstring){last_search=searchstring;}
|
33
|
-
$("#
|
33
|
+
$("#header_search_display").html("<ul><li><%= escape_javascript(content_tag(:span,I18n.t('search.at_least'), :class => :warning)) %></li></ul>").show();
|
34
34
|
} else {
|
35
35
|
if (last_search!=searchstring){
|
36
36
|
last_search=searchstring;
|
37
|
-
$("#
|
37
|
+
$("#header_search_display").html("<ul><li class=\"loading\"><%= escape_javascript(image_tag('loading.gif', :class => :loading)) %></li></ul>").show();
|
38
38
|
$.ajax({
|
39
39
|
type : "GET",
|
40
|
-
url : "<%= search_url %>?
|
40
|
+
url : "<%= search_url %>?search_query=" + searchstring + "&mode=header_search",
|
41
41
|
success : function(html) {
|
42
|
-
if ($("#
|
43
|
-
$("#
|
42
|
+
if ($("#header_search_input").val()==searchstring){ //Only show if input value is still the same
|
43
|
+
$("#header_search_display").html(html);
|
44
44
|
}
|
45
45
|
},
|
46
46
|
error: function(){
|
47
|
-
$("#
|
47
|
+
$("#header_search_display").html("<ul><li><%= escape_javascript(content_tag(:span,I18n.t('search.wrong'), :class => :warning)) %></li></ul>");
|
48
48
|
}
|
49
49
|
});
|
50
50
|
}
|
@@ -7,6 +7,7 @@
|
|
7
7
|
<meta name="keywords" content="<%= yield(:keywords).empty? ? t('profile.tags.default') : yield(:keywords) %>" >
|
8
8
|
<meta name="description" content= "<%= yield(:description).empty? ? "Home" : yield(:description) %>" >
|
9
9
|
<%= stylesheet_link_tag "application" %>
|
10
|
+
<%= javascript_include_tag "application" %>
|
10
11
|
<%= favicon_link_tag "icons/favicon.ico" %>
|
11
12
|
|
12
13
|
<% if protect_against_forgery? %>
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<% end %>
|
8
8
|
|
9
9
|
<%= location(
|
10
|
-
link_to(
|
10
|
+
link_to(t('notification.other'), notifications_path,:remote => true) +' ('+@mailbox.notifications.not_trashed.unread.count.to_s+')'
|
11
11
|
) %>
|
12
12
|
|
13
13
|
<% toolbar %>
|
@@ -1,7 +1,6 @@
|
|
1
1
|
$("#content").html("<%=escape_javascript(render :partial => 'index') %>");
|
2
|
+
$("header").html("<%=escape_javascript(render :partial => 'layouts/header') %>");
|
2
3
|
|
3
4
|
<%= location(link_to(image_tag("btn/btn_notification.png", :class => "menu_icon")+t('notification.other'), notifications_path,:remote => true)) %>
|
4
5
|
|
5
|
-
<%= toolbar %>
|
6
|
-
|
7
6
|
$('.pagination a').attr('data-remote', 'true');
|
@@ -1,16 +1,21 @@
|
|
1
|
-
<% if search_result.empty? %>
|
2
|
-
<ul><li><%= content_tag(:span,I18n.t('search.actor.none'), :class => :warning) %></li></ul>
|
3
|
-
<% else %>
|
4
1
|
<ul>
|
5
|
-
<%
|
6
|
-
|
7
|
-
<li>
|
8
|
-
<%=
|
9
|
-
<%= content_tag(:span, truncate_name(subject.actor.name), :class => :name) %>
|
2
|
+
<% SocialStream.subjects.each do |subject_type| %>
|
3
|
+
|
4
|
+
<li class="title">
|
5
|
+
<%= subject_type.to_s.capitalize.pluralize %>
|
10
6
|
</li>
|
11
|
-
<%
|
12
|
-
|
7
|
+
<% if @search_result[subject_type].empty? %>
|
8
|
+
<li class="none">
|
9
|
+
<%= I18n.t('search.no_subject_found', :subject => subject_type.to_s) %>
|
10
|
+
</li>
|
11
|
+
<% else %>
|
12
|
+
<% @search_result[subject_type].each do |subject|%>
|
13
|
+
<li class="subject_result"><%= subject_with_details subject %></li>
|
14
|
+
<% end %>
|
15
|
+
<li class="more">
|
16
|
+
<%= I18n.t('search.all_subject_results', :subject => subject_type.to_s.pluralize, :count => @search_result[(subject_type.to_s+"_total").to_sym].to_s) %>
|
17
|
+
</li>
|
18
|
+
<% end %>
|
19
|
+
</li>
|
20
|
+
<% end %>
|
13
21
|
</ul>
|
14
|
-
<% end %>
|
15
|
-
|
16
|
-
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<%= location(link_to(t('search.name')))%>
|
2
|
+
<br class="clearfloat" />
|
3
|
+
<div class="space_center"></div>
|
4
|
+
<h2><%= t('search.name') %></h2>
|
5
|
+
<div class="space_center"></div>
|
6
|
+
<div id="search_form">
|
7
|
+
<form action="<%=search_path%>" method="get">
|
8
|
+
<div class="block">
|
9
|
+
<div class="form_row search_row">
|
10
|
+
<%= text_field_tag :search_query, params[:search_query].present? ? params[:search_query] : nil ,:autocomplete => :off, :id => :global_search_input %>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
</form>
|
14
|
+
</div>
|
15
|
+
<div id="search_results" class="block">
|
16
|
+
<% SocialStream.subjects.each do |subject_type| %>
|
17
|
+
<div class="subject_search_results" class="block">
|
18
|
+
<div class="title">
|
19
|
+
<%= subject_type.to_s.capitalize.pluralize %>
|
20
|
+
</div>
|
21
|
+
<% if @search_result[subject_type].empty? %>
|
22
|
+
<div class="subject_with_details">
|
23
|
+
<%= I18n.t('search.no_subject_found', :subject => subject_type.to_s) %>
|
24
|
+
</div>
|
25
|
+
<% else %>
|
26
|
+
<% @search_result[subject_type].each do |subject|%>
|
27
|
+
<%= subject_with_details subject %>
|
28
|
+
<% end %>
|
29
|
+
<div class="subject_with_details">
|
30
|
+
<%= I18n.t('search.all_subject_results', :subject => subject_type.to_s.pluralize, :count => @search_result[(subject_type.to_s+"_total").to_sym].to_s) %>
|
31
|
+
</div>
|
32
|
+
<% end %>
|
33
|
+
</div>
|
34
|
+
<% end %>
|
35
|
+
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<% content_for :title do %>
|
2
|
+
<%=t('search.name')%> <%= params[:search_query].present? ? ": #{params[:search_query]}" : ""%>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<% content_for :sidebar do %>
|
6
|
+
<%= render :partial => 'home/sidebar' %>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<% toolbar %>
|
10
|
+
|
11
|
+
<% content_for :javascript do %>
|
12
|
+
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<%= render :partial => 'index' %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div class="subject_with_details">
|
2
|
+
<div class="logo">
|
3
|
+
<%= link_to (image_tag(subject.logo.url , :size => "50x50", :alt => subject.name )), subject %>
|
4
|
+
</div>
|
5
|
+
<div class="sub-block">
|
6
|
+
<div class="name black" >
|
7
|
+
<%= link_to truncate_name(subject.name), subject %>
|
8
|
+
</div>
|
9
|
+
<div class="brief">
|
10
|
+
<%= t 'follower.n', :count => subject.follower_count %>,
|
11
|
+
<%= t 'like.n', :count => subject.like_count %>
|
12
|
+
</div>
|
13
|
+
<div class="link">
|
14
|
+
<%= contact_to(subject) %>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</div>
|
@@ -2,32 +2,18 @@
|
|
2
2
|
|
3
3
|
<% @users.each do |user| %>
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
<% if (cont%2) == 0 %>
|
6
|
+
<% cont+=1; %>
|
7
|
+
<div class="row">
|
8
8
|
<% end %>
|
9
|
-
|
10
9
|
<div class="label">
|
11
|
-
|
12
|
-
<%= link_to (image_tag(user.logo.url , :size => "50x50", :alt => user.name )),user %>
|
13
|
-
</div>
|
14
|
-
<div class="sub-block">
|
15
|
-
<div class="name black" >
|
16
|
-
<%=link_to(truncate_name(user.name), user)%>
|
17
|
-
</div>
|
18
|
-
<div class="link">
|
19
|
-
<%= contact_to(user) %>
|
20
|
-
</div>
|
21
|
-
</div>
|
10
|
+
<%= subject_with_details user %>
|
22
11
|
</div>
|
23
|
-
<% end %>
|
12
|
+
<% end %>
|
24
13
|
|
25
|
-
<% if ((cont%2) != 0) %>
|
26
|
-
|
27
|
-
</div>
|
28
|
-
</div>
|
14
|
+
<% if ((cont%2) != 0) %> <div class="label"></div>
|
15
|
+
</div>
|
29
16
|
<% end %>
|
30
|
-
|
31
17
|
<div class="row">
|
32
18
|
<%= paginate @users %>
|
33
19
|
</div>
|
data/config/locales/en.yml
CHANGED
@@ -328,6 +328,10 @@ en:
|
|
328
328
|
actor:
|
329
329
|
none: "Nothing found"
|
330
330
|
at_least: "Write at least two characters"
|
331
|
+
name: "Search"
|
332
|
+
no_subject_found: "No %{subject} was found."
|
333
|
+
all_subject_results: "Search all %{subject} (%{count})"
|
334
|
+
write: "Write your query ..."
|
331
335
|
wrong: "There seems to be a problem with the search engine"
|
332
336
|
settings:
|
333
337
|
error: "Some errors raised when saving your changes"
|
@@ -3,11 +3,6 @@ module SocialStream
|
|
3
3
|
#Prints the default home toolbar menu
|
4
4
|
def default_home_toolbar_menu
|
5
5
|
items = Array.new
|
6
|
-
#Notifications
|
7
|
-
items << {:key => :notifications,
|
8
|
-
:name => image_tag("btn/btn_notification.png")+t('notification.other')+' ('+ current_subject.mailbox.notifications.not_trashed.unread.count.to_s+')',
|
9
|
-
:url => notifications_path,
|
10
|
-
:options => {:link => {:id => "notifications_menu"}}}
|
11
6
|
|
12
7
|
#Messages
|
13
8
|
items << {:key => :messages,
|
data/spec/dummy/script/rails
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_stream-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 51
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 4
|
10
|
+
version: 0.9.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- GING - DIT - UPM
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-09-
|
19
|
+
date: 2011-09-16 00:00:00 +02:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -471,6 +471,7 @@ files:
|
|
471
471
|
- app/assets/images/HTML5_Semantics.png
|
472
472
|
- app/assets/images/HTML5_Styling.png
|
473
473
|
- app/assets/images/Jcrop.gif
|
474
|
+
- app/assets/images/big-logo.png
|
474
475
|
- app/assets/images/boxy/boxy-ne.png
|
475
476
|
- app/assets/images/boxy/boxy-nw.png
|
476
477
|
- app/assets/images/boxy/boxy-se.png
|
@@ -616,11 +617,13 @@ files:
|
|
616
617
|
- app/assets/javascripts/posts.js
|
617
618
|
- app/assets/javascripts/profiles.js
|
618
619
|
- app/assets/javascripts/relation_customs.js
|
620
|
+
- app/assets/javascripts/search.js.erb
|
619
621
|
- app/assets/javascripts/settings.js
|
620
622
|
- app/assets/javascripts/social_stream-base.js
|
621
623
|
- app/assets/javascripts/ties.js
|
622
624
|
- app/assets/javascripts/toolbar.js
|
623
625
|
- app/assets/javascripts/users.js
|
626
|
+
- app/assets/stylesheets/0_devise_sign.css
|
624
627
|
- app/assets/stylesheets/activities.css
|
625
628
|
- app/assets/stylesheets/base.css
|
626
629
|
- app/assets/stylesheets/contacts.css
|
@@ -688,6 +691,7 @@ files:
|
|
688
691
|
- app/helpers/notifications_helper.rb
|
689
692
|
- app/helpers/permissions_helper.rb
|
690
693
|
- app/helpers/profiles_helper.rb
|
694
|
+
- app/helpers/search_helper.rb
|
691
695
|
- app/helpers/subjects_helper.rb
|
692
696
|
- app/helpers/toolbar_helper.rb
|
693
697
|
- app/helpers/users_helper.rb
|
@@ -764,11 +768,11 @@ files:
|
|
764
768
|
- app/views/devise/registrations/new.html.erb
|
765
769
|
- app/views/devise/sessions/new.html.erb
|
766
770
|
- app/views/frontpage/_header.html.erb
|
767
|
-
- app/views/frontpage/_search.html.erb
|
768
771
|
- app/views/frontpage/_sponsor.html.erb
|
769
772
|
- app/views/frontpage/host_meta.xml.builder
|
770
773
|
- app/views/frontpage/index.html.erb
|
771
774
|
- app/views/groups/_group.html.erb
|
775
|
+
- app/views/groups/_group_with_details.html.erb
|
772
776
|
- app/views/groups/_index.html.erb
|
773
777
|
- app/views/groups/_new.html.erb
|
774
778
|
- app/views/groups/_sidebar_index.html.erb
|
@@ -850,6 +854,8 @@ files:
|
|
850
854
|
- app/views/relation/customs/index.html.erb
|
851
855
|
- app/views/relation/customs/update.js.erb
|
852
856
|
- app/views/search/_header_search.html.erb
|
857
|
+
- app/views/search/_index.html.erb
|
858
|
+
- app/views/search/index.html.erb
|
853
859
|
- app/views/settings/_api_key.html.erb
|
854
860
|
- app/views/settings/_index.html.erb
|
855
861
|
- app/views/settings/_notifications.html.erb
|
@@ -858,6 +864,7 @@ files:
|
|
858
864
|
- app/views/subjects/_contacts.html.erb
|
859
865
|
- app/views/subjects/_show.js.erb
|
860
866
|
- app/views/subjects/_subject.html.erb
|
867
|
+
- app/views/subjects/_subject_with_details.html.erb
|
861
868
|
- app/views/ties/index.html.erb
|
862
869
|
- app/views/toolbar/_home.html.erb
|
863
870
|
- app/views/toolbar/_logo.html.erb
|
@@ -866,14 +873,13 @@ files:
|
|
866
873
|
- app/views/users/_index.html.erb
|
867
874
|
- app/views/users/_sidebar_index.html.erb
|
868
875
|
- app/views/users/_user.html.erb
|
876
|
+
- app/views/users/_user_with_details.html.erb
|
869
877
|
- app/views/users/index.html.erb
|
870
878
|
- app/views/users/index.js.erb
|
871
879
|
- app/views/users/info.html.erb
|
872
880
|
- app/views/users/show.html.erb
|
873
881
|
- app/views/users/show.js.erb
|
874
882
|
- app/views/users/show.xml.builder
|
875
|
-
- bin/social_stream
|
876
|
-
- bin/social_stream_heroku
|
877
883
|
- config/locales/en.yml
|
878
884
|
- config/routes.rb
|
879
885
|
- db/migrate/20110610112023_create_social_stream.rb
|
@@ -1,13 +0,0 @@
|
|
1
|
-
<div class="div_busqueda menu_list">
|
2
|
-
<ul>
|
3
|
-
<li>
|
4
|
-
<%= link_to t('browse'), users_path %>
|
5
|
-
</li>
|
6
|
-
</ul>
|
7
|
-
<div id="form_busqueda">
|
8
|
-
<%= form_tag(users_path, :method => "get") do -%>
|
9
|
-
<%=text_field_tag'search' %>
|
10
|
-
<%=submit_tag(t('find'), :class => 'other_blue') %>
|
11
|
-
<% end %>
|
12
|
-
</div>
|
13
|
-
</div>
|
data/bin/social_stream
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
#Social_stream complete install
|
3
|
-
#Arguments:
|
4
|
-
#$1 --> Name of the folder to create the social_stream project
|
5
|
-
EXPECTED_ARGS=1
|
6
|
-
|
7
|
-
if [ $# -ne $EXPECTED_ARGS ]
|
8
|
-
then
|
9
|
-
echo "Usage: `basename $0` path/to/your/application"
|
10
|
-
exit 1
|
11
|
-
fi
|
12
|
-
|
13
|
-
|
14
|
-
#Linux packages
|
15
|
-
echo 'Installing Linux packages'
|
16
|
-
PACKAGES_COMMON='ruby ruby-dev rdoc irb libopenssl-ruby wget make curl aspell-es aspell-en libxml2-dev libxslt-dev libmagickcore-dev libmagickwand-dev libsqlite3-dev libmysqlclient-dev mysql-server rake'
|
17
|
-
PACKAGES_PRODUCTION='awstats logrotate nfs-common'
|
18
|
-
sudo apt-get install $PACKAGES_COMMON
|
19
|
-
sudo apt-get install $PACKAGES_PRODUCTION
|
20
|
-
echo 'Done'
|
21
|
-
|
22
|
-
#Rubygems
|
23
|
-
RUBY_GEMS_VERSION='1.3.7'
|
24
|
-
RUBY_GEMS_PACKAGE="rubygems-"${RUBY_GEMS_VERSION}".tgz"
|
25
|
-
RUBY_GEMS_DOWNLOAD="http://rubyforge.org/frs/download.php/70696/"${RUBY_GEMS_PACKAGE}
|
26
|
-
|
27
|
-
echo 'Installing Rubygems $RUBY_GEMS_VERSION'
|
28
|
-
|
29
|
-
cd /tmp && wget $RUBY_GEMS_DOWNLOAD
|
30
|
-
cd /tmp && tar zxf $RUBY_GEMS_PACKAGE
|
31
|
-
cd /tmp/rubygems-$RUBY_GEMS_VERSION && sudo /usr/bin/ruby setup.rb
|
32
|
-
|
33
|
-
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
|
34
|
-
echo 'Done'
|
35
|
-
|
36
|
-
#Gems
|
37
|
-
echo 'Installing Initial Gems'
|
38
|
-
sudo gem install rails
|
39
|
-
sudo gem install bundler
|
40
|
-
echo 'Done'
|
41
|
-
|
42
|
-
#Social Stream
|
43
|
-
echo 'Creating and Setting up your Social Stream basic application'
|
44
|
-
export PATH=$PATH:/var/lib/gems/1.8/bin
|
45
|
-
echo 'Creating rails project'
|
46
|
-
rails new $1
|
47
|
-
cd $1
|
48
|
-
echo 'gem "social_stream"' >> Gemfile
|
49
|
-
echo 'Updating bundle'
|
50
|
-
bundle update
|
51
|
-
echo 'Setting up the application'
|
52
|
-
rails generate social_stream:install -y
|
53
|
-
rake db:migrate
|
54
|
-
rake db:seed
|
55
|
-
echo 'Done'
|
56
|
-
|
57
|
-
echo 'Instalation complete. Run "rails server" in the application folder to start the server'
|
data/bin/social_stream_heroku
DELETED
@@ -1,76 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
#Social_stream_heroku complete install
|
3
|
-
#Arguments:
|
4
|
-
#$1 --> Name of the folder to create the social_stream project
|
5
|
-
EXPECTED_ARGS=1
|
6
|
-
|
7
|
-
if [ $# -ne $EXPECTED_ARGS ]
|
8
|
-
then
|
9
|
-
echo "Usage: `basename $0` path/to/your/application"
|
10
|
-
exit 1
|
11
|
-
fi
|
12
|
-
|
13
|
-
|
14
|
-
#Linux packages
|
15
|
-
echo 'Installing Linux packages'
|
16
|
-
PACKAGES_COMMON='ruby ruby-dev rdoc irb libopenssl-ruby wget make curl aspell-es aspell-en libxml2-dev libxslt-dev libmagickcore-dev libmagickwand-dev libsqlite3-dev libmysqlclient-dev mysql-server rake git-core'
|
17
|
-
PACKAGES_PRODUCTION='awstats logrotate nfs-common'
|
18
|
-
sudo apt-get install $PACKAGES_COMMON
|
19
|
-
sudo apt-get install $PACKAGES_PRODUCTION
|
20
|
-
echo 'Done'
|
21
|
-
|
22
|
-
#Rubygems
|
23
|
-
RUBY_GEMS_VERSION='1.3.7'
|
24
|
-
RUBY_GEMS_PACKAGE="rubygems-"${RUBY_GEMS_VERSION}".tgz"
|
25
|
-
RUBY_GEMS_DOWNLOAD="http://rubyforge.org/frs/download.php/70696/"${RUBY_GEMS_PACKAGE}
|
26
|
-
|
27
|
-
echo 'Installing Rubygems $RUBY_GEMS_VERSION'
|
28
|
-
|
29
|
-
cd /tmp && wget $RUBY_GEMS_DOWNLOAD
|
30
|
-
cd /tmp && tar zxf $RUBY_GEMS_PACKAGE
|
31
|
-
cd /tmp/rubygems-$RUBY_GEMS_VERSION && sudo /usr/bin/ruby setup.rb
|
32
|
-
|
33
|
-
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
|
34
|
-
echo 'Done'
|
35
|
-
|
36
|
-
#Gems
|
37
|
-
echo 'Installing Initial Gems'
|
38
|
-
sudo gem install rails
|
39
|
-
sudo gem install bundler
|
40
|
-
sudo gem install heroku
|
41
|
-
echo 'Done'
|
42
|
-
|
43
|
-
#Social Stream
|
44
|
-
echo 'Creating and Setting up your Social Stream basic application'
|
45
|
-
export PATH=$PATH:/var/lib/gems/1.8/bin
|
46
|
-
echo 'Creating rails project'
|
47
|
-
rails new $1
|
48
|
-
cd $1
|
49
|
-
echo 'gem "social_stream"' >> Gemfile
|
50
|
-
echo 'Updating bundle'
|
51
|
-
bundle update
|
52
|
-
echo 'Setting up the application'
|
53
|
-
rails generate social_stream:install -y
|
54
|
-
rake db:migrate
|
55
|
-
rake db:seed
|
56
|
-
echo 'Done'
|
57
|
-
|
58
|
-
#Git repository
|
59
|
-
echo 'Setting up your git repository'
|
60
|
-
git init
|
61
|
-
git add .
|
62
|
-
git commit -m 'first commit'
|
63
|
-
echo 'Done'
|
64
|
-
|
65
|
-
#Heroku deployment
|
66
|
-
echo '[!] Starting deploy to heroku, you will be asked your heroku username and password'
|
67
|
-
echo '[!] If you do not have one visit http://www.heroku.com'
|
68
|
-
echo '[!] You will also need properly configured SSH keys visit: '
|
69
|
-
echo '[!] http://help.github.com/linux-key-setup/'
|
70
|
-
read -p '[!] When both things are ready PRESS ANY KEY TO CONTINUE...'
|
71
|
-
heroku create
|
72
|
-
git push heroku master
|
73
|
-
heroku rake db:migrate
|
74
|
-
echo 'Done'
|
75
|
-
|
76
|
-
echo 'Instalation & deployment are now complete. Visit https://api.heroku.com/myapps'
|