social_stream 0.10.4 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. data/base/app/assets/javascripts/activities.js.erb +0 -2
  2. data/base/app/assets/javascripts/search.js.erb +0 -4
  3. data/base/app/assets/stylesheets/_colors.scss +22 -0
  4. data/base/app/assets/stylesheets/{activities.css → activities.css.scss} +20 -23
  5. data/base/app/assets/stylesheets/{base.css → base.css.scss} +43 -35
  6. data/base/app/assets/stylesheets/{contacts.css → contacts.css.scss} +5 -3
  7. data/base/app/assets/stylesheets/footer.css.scss +22 -0
  8. data/base/app/assets/stylesheets/{frontpage.css → frontpage.css.scss} +7 -13
  9. data/base/app/assets/stylesheets/{header.css → header.css.scss} +23 -20
  10. data/base/app/assets/stylesheets/search.css +15 -17
  11. data/base/app/assets/stylesheets/toolbar.css +7 -0
  12. data/base/app/controllers/invitations_controller.rb +2 -0
  13. data/base/app/controllers/search_controller.rb +27 -45
  14. data/base/app/helpers/contacts_helper.rb +1 -5
  15. data/base/app/helpers/search_helper.rb +4 -4
  16. data/base/app/models/actor.rb +1 -3
  17. data/base/app/views/activity_objects/_activity_object.html.erb +1 -1
  18. data/base/app/views/contacts/_link.html.erb +9 -0
  19. data/base/app/views/frontpage/_caracteristics.html.erb +23 -0
  20. data/base/app/views/frontpage/index.html.erb +3 -25
  21. data/base/app/views/groups/_index.html.erb +1 -1
  22. data/base/app/views/invitation_mailer/send_invitation.html.erb +3 -3
  23. data/base/app/views/invitation_mailer/send_invitation.text.erb +3 -2
  24. data/base/app/views/invitations/_new.html.erb +2 -2
  25. data/base/app/views/layouts/_header_dropdown_menu.html.erb +1 -1
  26. data/base/app/views/layouts/_header_dropdown_menu_sessions.html.erb +1 -1
  27. data/base/app/views/posts/_new_activity.html.erb +1 -1
  28. data/base/app/views/posts/_new_activity_fields.erb +6 -0
  29. data/base/app/views/search/_extended_search.html.erb +14 -0
  30. data/base/app/views/search/_form.html.erb +25 -13
  31. data/base/app/views/search/_header_search.html.erb +7 -13
  32. data/base/app/views/search/_index.html.erb +1 -6
  33. data/base/app/views/search/_index_frontpage.html.erb +2 -18
  34. data/base/app/views/search/index.js.erb +1 -1
  35. data/base/app/views/subjects/_subject_with_details.html.erb +1 -1
  36. data/base/app/views/toolbar/_home.html.erb +1 -1
  37. data/base/app/views/toolbar/_messages.html.erb +1 -1
  38. data/base/app/views/toolbar/_subject.html.erb +10 -0
  39. data/base/app/views/users/_index.html.erb +1 -1
  40. data/base/config/locales/en.yml +13 -22
  41. data/base/config/locales/es.yml +356 -0
  42. data/base/lib/generators/social_stream/base/templates/initializer.rb +6 -0
  43. data/base/lib/social_stream/base/version.rb +1 -1
  44. data/base/lib/social_stream/models/object.rb +7 -1
  45. data/base/lib/social_stream-base.rb +8 -0
  46. data/base/social_stream-base.gemspec +2 -0
  47. data/base/spec/controllers/invitations_controller_spec.rb +34 -0
  48. data/base/spec/dummy/config/initializers/social_stream.rb +6 -0
  49. data/base/spec/support/thinking-sphinx.rb +10 -0
  50. data/documents/app/models/audio.rb +10 -1
  51. data/documents/app/models/document.rb +11 -0
  52. data/documents/app/models/picture.rb +10 -1
  53. data/documents/app/models/video.rb +9 -0
  54. data/documents/app/views/audios/_audio_with_details.html.erb +3 -0
  55. data/documents/app/views/documents/_document_with_details.html.erb +13 -0
  56. data/documents/app/views/pictures/_picture_with_details.html.erb +2 -0
  57. data/documents/app/views/videos/_video_with_details.html.erb +2 -0
  58. data/documents/config/locales/en.yml +0 -7
  59. data/documents/config/locales/es.yml +38 -0
  60. data/documents/db/migrate/20111005112707_add_title_and_description_to_document.rb +11 -0
  61. data/documents/lib/social_stream/documents/version.rb +1 -1
  62. data/documents/social_stream-documents.gemspec +1 -1
  63. data/events/app/views/events/_new_activity_fields.html.erb +5 -0
  64. data/events/lib/social_stream/events/version.rb +1 -1
  65. data/events/social_stream-events.gemspec +1 -1
  66. data/lib/social_stream/version.rb +1 -1
  67. data/social_stream.gemspec +3 -3
  68. data/spec/support/components.rb +1 -1
  69. metadata +35 -24
  70. data/base/app/assets/stylesheets/footer.css +0 -26
  71. data/base/app/views/search/_focus_search.html.erb +0 -17
  72. data/base/app/views/search/_global_search.html.erb +0 -19
  73. data/events/app/views/events/_jquery.html.erb +0 -125
@@ -36,7 +36,7 @@
36
36
  overflow: hidden;
37
37
  position: absolute;
38
38
  z-index: 2000;
39
- background: whiteSmoke;
39
+ background: #f5f5f5;
40
40
  text-align: left;
41
41
  }
42
42
  #header_search_display a {
@@ -53,7 +53,7 @@
53
53
  border-top: solid 1px #B9B9B9;
54
54
  font-size: 10px;
55
55
  height: 35px;
56
- background: whiteSmoke;
56
+ background: #f5f5f5;
57
57
  overflow: hidden;
58
58
  text-align: center;
59
59
  }
@@ -79,7 +79,7 @@
79
79
  #header_search_display li .link {
80
80
  display: none;
81
81
  }
82
- #header_search_display li.subject_result {
82
+ #header_search_display li.result {
83
83
  padding: 0px;
84
84
  height: 45px;
85
85
  text-align: left;
@@ -111,13 +111,23 @@
111
111
  .search_row {
112
112
  text-align: center;
113
113
  }
114
- .subject_with_details {
114
+ .model_with_details {
115
115
  padding: 5px;
116
116
  }
117
117
  .subject_search_results {
118
- width: 280px;
118
+ width: 186px;
119
119
  text-align: center;
120
120
  }
121
+ .subject_search_results img {
122
+ width: 48px;
123
+ height: 48px;
124
+ }
125
+ .subject_search_results .sub-block {
126
+ width: 62%;
127
+ word-wrap: break-word;
128
+ height: 50px;
129
+ overflow: hidden;
130
+ }
121
131
  #search_results {
122
132
  text-align: center;
123
133
  }
@@ -129,20 +139,8 @@
129
139
  float: right;
130
140
  padding: 0;
131
141
  }
132
- #search_results .title {
133
- width: 540px;
134
- margin: auto;
135
- background-color: #E1EEF5;
136
- padding: 5px;
137
- font-weight: bold;
138
- text-align: center;
139
- }
140
- #search_results .subject_search_results .title {
141
- width: 260px;
142
- }
143
142
  /********************************* Form and errors *********/
144
143
  #search_form .error {
145
144
  display: none;
146
145
  }
147
-
148
146
  /******************** Search css END ***********************/
@@ -1,3 +1,10 @@
1
1
  /*
2
2
  *= require menu
3
3
  */
4
+
5
+ #toolbar .model_with_details .sub-block{
6
+ width:62%;
7
+ word-wrap: break-word;
8
+ height: 50px;
9
+ overflow: hidden;
10
+ }
@@ -1,4 +1,6 @@
1
1
  class InvitationsController < ApplicationController
2
+ before_filter :authenticate_user!
3
+
2
4
  def new
3
5
 
4
6
  end
@@ -1,24 +1,24 @@
1
1
  class SearchController < ApplicationController
2
2
  include ActionView::Helpers::SanitizeHelper
3
+
4
+ helper_method :get_search_query
3
5
 
4
- #before_filter :authenticate_user! #??
5
-
6
- FOCUS_SEARCH_PER_PAGE=16
6
+ RESULTS_SEARCH_PER_PAGE=15
7
7
  MIN_QUERY=2
8
+
8
9
  def index
9
- @search_class_sym = params[:focus].singularize.to_sym unless params[:focus].blank?
10
10
  if params[:search_query].blank? or too_short_query
11
- @search_result = nil_search
11
+ @search_result = []
12
12
  else
13
13
  if params[:mode].eql? "header_search"
14
- @search_result = header_search
15
- render :partial => "header_search", :locals => {:search_result => @search_result}
14
+ @search_result = search :quick
15
+ render :partial => "header_search"
16
16
  return
17
17
  else
18
18
  if params[:focus].present?
19
19
  @search_result = focus_search
20
20
  else
21
- @search_result = global_search
21
+ @search_result = search :extended
22
22
  end
23
23
  end
24
24
  end
@@ -30,6 +30,25 @@ class SearchController < ApplicationController
30
30
 
31
31
  private
32
32
 
33
+ def search mode
34
+ models = SocialStream.extended_search_models
35
+ models = SocialStream.quick_search_models if mode.to_s.eql? "quick"
36
+ models.map! {|model_sym| model_sym.to_s.classify.constantize}
37
+ result = ThinkingSphinx.search(get_search_query, :classes => models)
38
+ if mode.to_s.eql? "quick"
39
+ result.page(1).per(7)
40
+ else
41
+ result.page(params[:page]).per(RESULTS_SEARCH_PER_PAGE)
42
+ end
43
+ return result
44
+ end
45
+
46
+ def focus_search
47
+ @search_class_sym = params[:focus].singularize.to_sym unless params[:focus].blank?
48
+ search_class = @search_class_sym.to_s.classify.constantize
49
+ ThinkingSphinx.search(get_search_query, :classes => [search_class]).page(params[:page]).per(RESULTS_SEARCH_PER_PAGE)
50
+ end
51
+
33
52
  def too_short_query
34
53
  bare_query = strip_tags(params[:search_query]) unless bare_query.html_safe?
35
54
  return bare_query.strip.size < MIN_QUERY
@@ -45,41 +64,4 @@ class SearchController < ApplicationController
45
64
  end
46
65
  return search_query.strip
47
66
  end
48
-
49
- def global_search
50
- return search 6
51
- end
52
-
53
- def header_search
54
- return search 3
55
- end
56
-
57
- def search max_results
58
- result = Hash.new
59
- total_shown = 0
60
- SocialStream.subjects.each do |subject_sym|
61
- result.update({subject_sym => ThinkingSphinx.search(get_search_query, :classes => [subject_sym.to_s.classify.constantize]).page(1).per(max_results)})
62
- result.update({(subject_sym.to_s+"_total").to_sym => ThinkingSphinx.count(get_search_query, :classes => [subject_sym.to_s.classify.constantize])})
63
- end
64
- return result
65
- end
66
-
67
- def focus_search
68
- string_class = params[:focus].singularize
69
- search_class = string_class.classify.constantize
70
- return ThinkingSphinx.search(get_search_query, :classes => [search_class]).page(params[:page]).per(FOCUS_SEARCH_PER_PAGE)
71
- end
72
-
73
- def nil_search
74
- if params[:focus].present?
75
- result = []
76
- else
77
- result = Hash.new
78
- SocialStream.subjects.each do |subject_sym|
79
- result.update({subject_sym => []})
80
- result.update({(subject_sym.to_s+"_total").to_sym => 0})
81
- end
82
- end
83
- return result
84
- end
85
67
  end
@@ -7,11 +7,7 @@ module ContactsHelper
7
7
  if c.reflexive?
8
8
  t('subject.this_is_you')
9
9
  else
10
- link_to(c.status,
11
- edit_contact_path(c),
12
- :title => t("contact.#{ c.action }.title", :name => c.receiver.name)) +
13
- "<br/>".html_safe +
14
- link_to(t('actor.delete'), contact_path(c), :action => :destroy, :confirm => t('actor.confirm_delete'), :remote => true)
10
+ render :partial => 'contacts/link', :locals => { :contact => c }
15
11
  end
16
12
 
17
13
  end
@@ -1,8 +1,8 @@
1
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}
2
+ def model_with_details model
3
+ model = model.model if model.is_a? Actor
4
+ render :partial => model.class.to_s.pluralize.downcase + '/' + model.class.to_s.downcase + '_with_details',
5
+ :locals => {model.class.to_s.downcase.to_sym => model}
6
6
  end
7
7
 
8
8
  def focus_search_link text, search_class, query
@@ -15,8 +15,6 @@ class Actor < ActiveRecord::Base
15
15
  include SocialStream::Models::Supertype
16
16
  include SocialStream::Models::Object
17
17
 
18
- delegate :tag_list, :tag_list=, :tagged_with, :tag_counts, :to => :activity_object
19
-
20
18
  validates_presence_of :name, :subject_type
21
19
 
22
20
  acts_as_messageable
@@ -159,7 +157,7 @@ class Actor < ActiveRecord::Base
159
157
  when String
160
158
  emails << receiver_emails
161
159
  when Array
162
- receveir_emails.each do |receveir_email|
160
+ receiver_emails.each do |receiver_email|
163
161
  emails << receiver_email
164
162
  end
165
163
  end
@@ -2,6 +2,6 @@
2
2
  <%= render activity_object.object %>
3
3
  <% else %>
4
4
  <div class="block">
5
- <%= subject_with_details activity_object.object %>
5
+ <%= model_with_details activity_object.object %>
6
6
  </div>
7
7
  <% end %>
@@ -0,0 +1,9 @@
1
+ <%= link_to(contact.status, edit_contact_path(contact),
2
+ :title => t("contact.#{ contact.action }.title", :name => contact.receiver.name)) %>
3
+
4
+ <% if controller.controller_name == "contacts" %>
5
+
6
+ <br/>
7
+ <%= link_to(t('contact.delete'), contact_path(contact), :action => :destroy, :confirm => t('contact.confirm_delete'), :remote => true) %>
8
+
9
+ <% end %>
@@ -0,0 +1,23 @@
1
+ <div id="caracteristics">
2
+ <ul>
3
+ <li class="participants">
4
+ <%= t('frontpage.elements.participants') %>
5
+ </li>
6
+ <li class="organizers">
7
+ <%= t('frontpage.elements.organizers') %>
8
+ </li>
9
+ <li class="spaces">
10
+ <%= t('frontpage.elements.groups') %>
11
+ </li>
12
+ <li class="comments">
13
+ <%= t('frontpage.elements.comments') %>
14
+ </li>
15
+ <li class="tags">
16
+ <%= t('frontpage.elements.tags') %>
17
+ </li>
18
+ <li class="networks">
19
+ <%= t('frontpage.elements.networks') %>
20
+ </li>
21
+ </ul>
22
+ </div>
23
+
@@ -1,5 +1,5 @@
1
1
  <% content_for :title do%>
2
- <%= t('welcome') %>
2
+ <%= t('welcome', :site => t('site.name')) %>
3
3
  <%end%>
4
4
 
5
5
  <div class="banner_busqueda">
@@ -40,6 +40,7 @@
40
40
  <div class="sentences">
41
41
  <ul>
42
42
  <li class="green"><%= t('frontpage.meet.sentence1') %></li>
43
+ <li class="green"><%= t('frontpage.meet.sentence2') %></li>
43
44
  </ul>
44
45
  </div>
45
46
  </div>
@@ -65,30 +66,7 @@
65
66
  </div>
66
67
 
67
68
  <div id="wrapper_right">
68
- <div id="caracteristics">
69
- <ul>
70
- <li class="participants">
71
- <%= t('frontpage.elements.participants') %>
72
- </li>
73
- <li class="organizers">
74
- <%= t('frontpage.elements.organizers') %>
75
- </li>
76
- <li class="spaces">
77
- <%= t('frontpage.elements.groups') %>
78
- </li>
79
- <li class="comments">
80
- <%= t('frontpage.elements.comments') %>
81
- </li>
82
- <li class="tags">
83
- <%= t('frontpage.elements.tags') %>
84
- </li>
85
- <li class="networks">
86
- <%= t('frontpage.elements.networks') %>
87
- </li>
88
- </ul>
89
- </div>
69
+ <%= render :partial => 'frontpage/caracteristics' %>
90
70
  </div>
91
71
 
92
72
  <div id="espacio_body_bottom"></div>
93
-
94
-
@@ -5,7 +5,7 @@
5
5
  <div class="row">
6
6
  <% end %>
7
7
  <div class="label">
8
- <%= subject_with_details group %>
8
+ <%= model_with_details group %>
9
9
  </div>
10
10
  <% if ((cont%2) == 0) %>
11
11
  </div>
@@ -7,11 +7,11 @@
7
7
  <div>
8
8
  <div>
9
9
  <div style="padding: 10px 5px 5px 5px;">
10
- <span id="name" style="font-weight: bold;"><%= @sender.name %></span> has invited you to <%= link_to( t('site.name'), new_user_registration_url)%>
10
+ <%= raw t('invitation.invited', :sender => "<span id=\"name\" style=\"font-weight: bold;\">#{ h @sender.name}</span>", :site => link_to(t('site.name'), new_user_registration_url)) %>
11
11
  </div>
12
12
  <div style="position: static;padding: 5px; border: #2A3890 solid 2px; background-color: #E1EEF5; margin:10px; min-height: 125px; width: 500px;">
13
13
  <div style="float:left; margin-right:7px; border: thin solid #D4E4EA; background-color: white; max-height: 119px;">
14
- <img src="http://<%= ActionMailer::Base.default_url_options[:host] +@sender.logo.url(:profile)%>" alt="<%=@sender.name%>">
14
+ <img src="<%= root_url + @sender.logo.url(:profile)%>" alt="<%=@sender.name%>">
15
15
  </div>
16
16
  <div style=" margin: 5px 5px 5px 5px;">
17
17
  <p style="font-weight: bold; "><%= @sender.name %>
@@ -20,7 +20,7 @@
20
20
  <% end %>
21
21
  </p>
22
22
  <% if @message.blank? %>
23
- <p style="text-align: justify;"><%= t('invitation.join_me')%></p>
23
+ <p style="text-align: justify;"><%= t('invitation.join_me', :site => t('site.name'))%></p>
24
24
  <%else%>
25
25
  <p style="text-align: justify; font-style: italic;">"<%= @message%>"</p>
26
26
  <%end%>
@@ -1,7 +1,7 @@
1
- <%= @sender.name %> has invited you to <%= t('site.name')%>: <%= new_user_registration_url%>
1
+ <%= t('invitation.invited', :sender => @sender.name, :site => t('site.name')) %>: <%= new_user_registration_url%>
2
2
 
3
3
  <% if @message.blank? %>
4
- <%= t('invitation.join_me')%>
4
+ <%= t('invitation.join_me', :site => t('site.name'))%>
5
5
  <%else%>
6
6
  "<%= @message%>"
7
7
  <%end%>
@@ -14,6 +14,7 @@
14
14
 
15
15
  <%= t('frontpage.meet.default')%>:
16
16
  <%= t('frontpage.meet.sentence1') %>
17
+ <%= t('frontpage.meet.sentence2') %>
17
18
 
18
19
  <%= t('frontpage.collaborate.default')%>:
19
20
  <%= t('frontpage.collaborate.sentence1') %>
@@ -10,7 +10,7 @@
10
10
 
11
11
  <%= form_tag invitations_path, :method=> :post, :class => "invitation_form", :remote => true do %>
12
12
  <div class="block">
13
- <h3 class= "form_row"><%=t('invitation.join')%></h3>
13
+ <h3 class= "form_row"><%=t('invitation.join', :site => t('site.name'))%></h3>
14
14
  <div class="form_row form_label ">
15
15
  <%= label_tag t('invitation.e-mails')%>
16
16
  <span class= "form_comment">(Separated by commas)</span>
@@ -30,4 +30,4 @@
30
30
  <div class="form_row space_center">
31
31
  <%= submit_tag t('action.send'), :class => "button" %>
32
32
  </div>
33
- <%end%>
33
+ <%end%>
@@ -1,7 +1,7 @@
1
1
  <div id="header_dropdown_menu">
2
2
  <ul class="sf-menu" >
3
3
  <li class="header_dropdown_li">
4
- <a href="#" class="sf-with-ul" id="current_subject_avatar_img" style="background: transparent url('<%= image_path current_subject.logo.url(:representation)%>') no-repeat left top;"><%= truncate_name current_subject.name %><span class="sf-sub-indicator"> »</span></a>
4
+ <a href="#" class="sf-with-ul" id="current_subject_avatar_img" style="background: transparent url('<%= image_path current_subject.logo.url(:representation)%>') no-repeat left top;"><%= truncate_name current_subject.name, :length => 15 %><span class="sf-sub-indicator"> »</span></a>
5
5
  <ul>
6
6
  <%= render :partial => 'layouts/header_dropdown_menu_sessions'%>
7
7
  <li>
@@ -5,7 +5,7 @@
5
5
  <ul>
6
6
  <% representations.each do |representation| %>
7
7
  <li>
8
- <%= link_to truncate_name(representation.name), { :s => representation.slug }, { :style => "background: transparent url('#{ image_path representation.logo.url(:representation)}') no-repeat left center;margin-left:2px;" } %>
8
+ <%= link_to truncate_name(representation.name, :length => 15), { :s => representation.slug }, { :style => "background: transparent url('#{ image_path representation.logo.url(:representation)}') no-repeat left center;margin-left:2px;" } %>
9
9
  </li>
10
10
  <% end %>
11
11
  </ul>
@@ -1 +1 @@
1
- <%= render :partial => 'objects/new_activity', :locals => {:receiver => receiver, :object => Post.new(:text => t('activity.input')), :remote => true} %>
1
+ <%= render :partial => 'objects/new_activity', :locals => {:receiver => receiver, :object => Post.new, :remote => true} %>
@@ -1 +1,7 @@
1
1
  <%= f.text_field :text, :id => "input_activities", :size => 85 %>
2
+
3
+ <%= javascript_tag do %>
4
+ $(function() {
5
+ $("#input_activities").Watermark("<%= I18n.t('post.input') %>","#666");
6
+ });
7
+ <% end %>
@@ -0,0 +1,14 @@
1
+ <% if @search_result.empty? %>
2
+ <div class="model_with_details">
3
+ <%= I18n.t('search.nothing') %>
4
+ </div>
5
+ <% else %>
6
+ <% total = 0 %>
7
+ <% @search_result.each do |model|%>
8
+ <div class="subject_search_results block left">
9
+ <%= model_with_details model %>
10
+ </div>
11
+ <% end %>
12
+ <br class="clearfloat">
13
+ <%= paginate @search_result %>
14
+ <% end %>