social_stream 0.16.3 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. data/LICENSE +1 -1
  2. data/README.rdoc +1 -0
  3. data/base/LICENSE +1 -1
  4. data/base/README.rdoc +1 -1
  5. data/base/app/assets/stylesheets/header.css.scss +9 -7
  6. data/base/app/controllers/groups_controller.rb +3 -4
  7. data/base/app/controllers/settings_controller.rb +14 -3
  8. data/base/app/controllers/users_controller.rb +3 -4
  9. data/base/app/helpers/permissions_helper.rb +2 -1
  10. data/base/app/models/activity_object.rb +29 -28
  11. data/base/app/models/actor.rb +27 -19
  12. data/base/app/models/channel.rb +48 -0
  13. data/base/app/views/contacts/_pendings.html.erb +1 -1
  14. data/base/app/views/devise/registrations/_edit_user.html.erb +0 -25
  15. data/base/app/views/devise/registrations/edit.html.erb +1 -0
  16. data/base/app/views/layouts/_footer.html.erb +1 -1
  17. data/base/app/views/layouts/_header_dropdown_menu_sessions.html.erb +5 -2
  18. data/base/app/views/settings/_language.html.erb +32 -0
  19. data/base/app/views/settings/_notifications.html.erb +1 -1
  20. data/base/config/locales/en.yml +5 -0
  21. data/base/config/locales/es.yml +7 -0
  22. data/base/db/migrate/20120103103125_add_channels.rb +88 -0
  23. data/base/db/migrate/20120109081509_update_notify_permissions.rb +15 -0
  24. data/base/lib/social_stream-base.rb +7 -4
  25. data/base/lib/social_stream/base/engine.rb +10 -2
  26. data/base/lib/social_stream/base/version.rb +1 -1
  27. data/base/lib/social_stream/controllers/i18n_integration.rb +29 -0
  28. data/base/lib/social_stream/controllers/subjects.rb +19 -0
  29. data/base/lib/social_stream/models/object.rb +12 -26
  30. data/base/lib/social_stream/models/subject.rb +2 -24
  31. data/base/lib/social_stream/models/subtype.rb +80 -0
  32. data/base/lib/social_stream/models/supertype.rb +16 -3
  33. data/base/lib/social_stream/views/settings/base.rb +5 -0
  34. data/base/lib/tasks/db/populate.rake +1 -0
  35. data/base/spec/controllers/settings_controller_spec.rb +1 -1
  36. data/base/spec/spec_helper.rb +3 -0
  37. data/documents/app/assets/stylesheets/documents.css.scss +9 -0
  38. data/documents/app/controllers/documents_controller.rb +3 -2
  39. data/documents/app/models/document.rb +1 -1
  40. data/documents/app/views/documents/_new_activity_fields.html.erb +14 -0
  41. data/documents/app/views/videos/_video_show.html.erb +23 -19
  42. data/documents/config/locales/en.yml +6 -2
  43. data/documents/config/locales/es.yml +6 -2
  44. data/documents/db/migrate/20120109155431_document_object_type.rb +16 -0
  45. data/documents/lib/social_stream/documents/version.rb +1 -1
  46. data/documents/social_stream-documents.gemspec +2 -2
  47. data/documents/spec/dummy/Rakefile +1 -1
  48. data/documents/spec/dummy/app/assets/javascripts/application.js +9 -0
  49. data/documents/spec/dummy/app/assets/stylesheets/application.css +7 -0
  50. data/documents/spec/dummy/app/views/layouts/application.html.erb +3 -3
  51. data/documents/spec/dummy/config/application.rb +8 -8
  52. data/documents/spec/dummy/config/database.yml +3 -0
  53. data/documents/spec/dummy/config/environments/development.rb +7 -2
  54. data/documents/spec/dummy/config/environments/production.rb +23 -12
  55. data/documents/spec/dummy/config/environments/test.rb +5 -3
  56. data/documents/spec/dummy/config/initializers/secret_token.rb +1 -1
  57. data/documents/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  58. data/documents/spec/dummy/config/locales/en.yml +1 -1
  59. data/documents/spec/dummy/config/routes.rb +1 -1
  60. data/documents/spec/dummy/db/schema.rb +6 -0
  61. data/events/app/assets/stylesheets/events.css.scss +3 -0
  62. data/events/app/helpers/events_helper.rb +11 -1
  63. data/events/app/models/event.rb +12 -1
  64. data/events/lib/social_stream/events/models/actor.rb +6 -0
  65. data/events/lib/social_stream/events/version.rb +1 -1
  66. data/events/lib/social_stream/views/sidebar/events.rb +4 -2
  67. data/events/social_stream-events.gemspec +2 -2
  68. data/lib/generators/social_stream/install_generator.rb +1 -0
  69. data/lib/social_stream.rb +2 -0
  70. data/lib/social_stream/version.rb +1 -1
  71. data/lib/tasks/migrations.rake +14 -0
  72. data/linkser/app/assets/javascripts/linkser.js.erb +3 -3
  73. data/linkser/lib/social_stream/linkser/version.rb +1 -1
  74. data/linkser/social_stream-linkser.gemspec +2 -2
  75. data/presence/lib/social_stream/presence/version.rb +1 -1
  76. data/presence/social_stream-presence.gemspec +1 -1
  77. data/social_stream.gemspec +9 -6
  78. data/spec/dummy/config/application.rb +5 -5
  79. data/spec/dummy/config/environments/development.rb +3 -0
  80. data/spec/dummy/config/environments/production.rb +10 -4
  81. data/spec/dummy/config/initializers/secret_token.rb +1 -1
  82. data/spec/dummy/config/initializers/wrap_parameters.rb +5 -3
  83. data/spec/dummy/db/schema.rb +2 -8
  84. data/spec/dummy/script/rails +0 -0
  85. data/spec/spec_helper.rb +3 -0
  86. data/spec/support/db.rb +1 -1
  87. metadata +51 -31
  88. data/base/spec/dummy/app/helpers/application_helper.rb +0 -2
  89. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  90. data/spec/dummy/app/mailers/.gitkeep +0 -0
  91. data/spec/dummy/app/models/.gitkeep +0 -0
@@ -2,9 +2,10 @@ require 'active_support/concern'
2
2
 
3
3
  module SocialStream #:nodoc:
4
4
  module Models
5
- # Common methods for models that have subtypes. Currently, there are two supertypes:
6
- # * Actor: participates in the social network and has ties with other actors. Its subtypes are subjects, like user or group
7
- # * ActivityObject: created and managed by actors in activities. Its subtypes are objects, like post or comment
5
+ # Common methods for models having many {SocialStream::Models::Subtype subtypes}.
6
+ # Currently, there are two {SocialStream::Models::Supertype supertypes}:
7
+ # * {Actor}: participates in the social network and has {Tie Ties} with other actors. Its subtypes are {SocialStream::Models::Subject subjects}, such as {User} or {Group}
8
+ # * {ActivityObject}: created and managed by {Actor Actors} in {Activity Activities}. Its subtypes are {SocialStream::Models::Object objects}, like {Post} or {Comment}
8
9
  module Supertype
9
10
  extend ActiveSupport::Concern
10
11
 
@@ -32,6 +33,18 @@ module SocialStream #:nodoc:
32
33
  end # end
33
34
  end
34
35
  end
36
+
37
+ module ActiveRecord
38
+ extend ActiveSupport::Concern
39
+
40
+ module ClassMethods
41
+ # This class is a supertype. Subtype classes are known as name
42
+ def supertype_of name
43
+ @subtypes_name = name
44
+ include SocialStream::Models::Supertype
45
+ end
46
+ end
47
+ end
35
48
  end
36
49
  end
37
50
  end
@@ -15,6 +15,11 @@ module SocialStream
15
15
  }
16
16
  end
17
17
 
18
+ items << {
19
+ :key => 'language',
20
+ :html => render(:partial => "language")
21
+ }
22
+
18
23
  items << {
19
24
  :key => 'notifications',
20
25
  :html => render(:partial => "notifications")
@@ -9,6 +9,7 @@ namespace :db do
9
9
 
10
10
  desc "Create populate data"
11
11
  task :create => :environment do
12
+ require 'forgery'
12
13
 
13
14
  LOGOS_PATH = File.join(Rails.root, 'lib', 'logos')
14
15
  USERS = (ENV["USERS"] || 9).to_i
@@ -17,7 +17,7 @@ describe SettingsController do
17
17
 
18
18
  it "should render index after update_all" do
19
19
  put :update_all
20
- assert_response :success
20
+ response.should redirect_to(:settings)
21
21
  end
22
22
 
23
23
  describe "Notification settings" do
@@ -1,6 +1,9 @@
1
1
  # Configure Rails Envinronment
2
2
  ENV["RAILS_ENV"] ||= "test"
3
3
 
4
+ # Do not check ImageMagick<=>Rmagick versions
5
+ RMAGICK_BYPASS_VERSION_TEST = true
6
+
4
7
  require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
8
  require "rspec/rails"
6
9
 
@@ -57,6 +57,15 @@
57
57
  text-align: left;
58
58
  }
59
59
 
60
+ #new_document_title_wrapper {
61
+ margin-top: 5px;
62
+ }
63
+
64
+ #new_document_title_wrapper input[type="text"] {
65
+ display: inline;
66
+ width: 30%;
67
+ }
68
+
60
69
  .attachment_tile{
61
70
  margin: 5px;
62
71
  width: 90px;
@@ -39,8 +39,9 @@ class DocumentsController < ApplicationController
39
39
  path = resource.file.path(params[:style] || params[:format])
40
40
 
41
41
  send_file path,
42
- :filename => resource.file_file_name,
43
- :disposition => "inline"
42
+ :filename => resource.file_file_name,
43
+ :disposition => "inline",
44
+ :type => request.format
44
45
  }
45
46
  end
46
47
  end
@@ -72,7 +72,7 @@ class Document < ActiveRecord::Base
72
72
  protected
73
73
 
74
74
  def set_title
75
- self.title = self.file_file_name
75
+ self.title ||= self.file_file_name
76
76
  end
77
77
 
78
78
  end
@@ -1 +1,15 @@
1
1
  <%= f.file_field :file %>
2
+
3
+ <div id="new_document_title_wrapper">
4
+ <%= f.label :title %> <%= f.text_field :title %>
5
+ </div>
6
+
7
+ <%= javascript_tag do %>
8
+ $(function() {
9
+ $('#new_document_title_wrapper').hide();
10
+ $('#document_file').change(function(){
11
+ $('#new_document_title_wrapper').show();
12
+ $("#document_title").val($(this).val().replace(/C:\\fakepath\\/i, ''));
13
+ });
14
+ });
15
+ <% end %>
@@ -1,21 +1,3 @@
1
- <% content_for :javascript do %>
2
-
3
- $("#jpId<%=video.id%>").jPlayer( {
4
- ready: function () {
5
- $(this).jPlayer("setMedia", {
6
- webmv: "<%= video_url(video, :format => 'webm' ) %>", // Defines the webm url
7
- flv: "<%= video_url(video, :format => 'flv') %>"
8
- });
9
- },
10
- solution:"flash, html",
11
- preload: "none",
12
- supplied: "webmv, flv",
13
- swfPath: "assets",
14
- cssSelectorAncestor: "#jp_interface_<%=video.id%>"
15
- });
16
-
17
- <% end %>
18
-
19
1
  <%= div_for video, :class => 'content_size' do %>
20
2
  <div class="video_show">
21
3
  <% if video.file_processing %>
@@ -58,7 +40,29 @@
58
40
  </div>
59
41
  <div id="jp_playlist_<%= video.id%>" class="jp-playlist"></div>
60
42
  </div>
43
+ <div id="inspector"></div>
61
44
  </div>
62
45
  <% end %>
63
46
  </div>
64
- <% end %>
47
+ <% end %>
48
+
49
+ <%= javascript_tag do %>
50
+ $(function() {
51
+ <% unless video.file_processing %>
52
+ $("#jpId<%=video.id%>").jPlayer( {
53
+ ready: function () {
54
+ $(this).jPlayer("setMedia", {
55
+ webmv: "<%= video_url(video, :format => 'webm' ) %>", // Defines the webm url
56
+ flv: "<%= video_url(video, :format => 'flv') %>"
57
+ });
58
+ },
59
+ solution:"flash, html",
60
+ preload: "none",
61
+ supplied: "webmv, flv",
62
+ swfPath: "assets",
63
+ cssSelectorAncestor: "#jp_interface_<%=video.id%>"
64
+ });
65
+ <% end %>
66
+ });
67
+ <% end %>
68
+
@@ -1,4 +1,8 @@
1
1
  en:
2
+ activerecord:
3
+ attributes:
4
+ document:
5
+ title: "Title"
2
6
  audio:
3
7
  confirm_delete: "Delete audio?"
4
8
  title: "Audios"
@@ -7,7 +11,7 @@ en:
7
11
  name: "audio"
8
12
  not_mine: "Audios"
9
13
  one: "an audio"
10
- processing: "Processing audio clip"
14
+ processing: "Processing audio clip. Please wait..."
11
15
  document:
12
16
  actions:
13
17
  delete: "Delete"
@@ -64,4 +68,4 @@ en:
64
68
  name: "video"
65
69
  not_mine: "Videos"
66
70
  one: "a video"
67
- processing: "Processing video"
71
+ processing: "Processing video. Please, wait..."
@@ -1,4 +1,8 @@
1
1
  es:
2
+ activerecord:
3
+ attributes:
4
+ document:
5
+ title: "Título"
2
6
  audio:
3
7
  confirm_delete: "¿Borrar audios?"
4
8
  title: "Audios"
@@ -7,7 +11,7 @@ es:
7
11
  name: "archivo de audio"
8
12
  not_mine: "Audios"
9
13
  one: "un archivo de audio"
10
- processing: "Procesando fichero de audio..."
14
+ processing: "Procesando fichero de audio. Espere, por favor..."
11
15
  document:
12
16
  actions:
13
17
  delete: "Borrar"
@@ -64,4 +68,4 @@ es:
64
68
  name: "vídeo"
65
69
  not_mine: "Vídeos"
66
70
  one: "un vídeo"
67
- processing: "Procesando vídeo..."
71
+ processing: "Procesando vídeo. Espere, por favor..."
@@ -0,0 +1,16 @@
1
+ class DocumentObjectType < ActiveRecord::Migration
2
+ class ActivityObjectMigration < ActiveRecord::Base
3
+ self.record_timestamps = false
4
+ set_table_name "activity_objects"
5
+ end
6
+
7
+ def up
8
+ ActivityObjectMigration.where(:object_type => %w( Picture Audio Video )).each do |a|
9
+ a.object_type = "Document"
10
+ a.save!
11
+ end
12
+ end
13
+
14
+ def down
15
+ end
16
+ end
@@ -1,5 +1,5 @@
1
1
  module SocialStream
2
2
  module Documents
3
- VERSION = "0.6.1".freeze
3
+ VERSION = "0.7.0".freeze
4
4
  end
5
5
  end
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.files = `git ls-files`.split("\n")
13
13
 
14
14
  # Gem dependencies
15
- s.add_runtime_dependency('social_stream-base', '~> 0.11.1')
15
+ s.add_runtime_dependency('social_stream-base', '~> 0.12.0')
16
16
  s.add_runtime_dependency('paperclip-ffmpeg', '~> 0.7.0')
17
17
  # Waiting for version > 2.4.5, which fixes:
18
18
  # https://github.com/thoughtbot/paperclip/issues/293
@@ -25,6 +25,6 @@ Gem::Specification.new do |s|
25
25
  end
26
26
  s.add_development_dependency('rspec-rails', '~> 2.6.0')
27
27
  s.add_development_dependency('factory_girl', '~> 1.3.2')
28
- s.add_development_dependency('forgery', '~> 0.3.6')
28
+ s.add_development_dependency('forgery', '~> 0.4.2')
29
29
  s.add_development_dependency('capybara', '~> 0.3.9')
30
30
  end
@@ -1,7 +1,7 @@
1
+ #!/usr/bin/env rake
1
2
  # Add your own tasks in files placed in lib/tasks ending in .rake,
2
3
  # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
4
 
4
5
  require File.expand_path('../config/application', __FILE__)
5
- require 'rake'
6
6
 
7
7
  Dummy::Application.load_tasks
@@ -0,0 +1,9 @@
1
+ // This is a manifest file that'll be compiled into including all the files listed below.
2
+ // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
+ // be included in the compiled file accessible from http://example.com/assets/application.js
4
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ // the compiled file.
6
+ //
7
+ //= require jquery
8
+ //= require jquery_ujs
9
+ //= require_tree .
@@ -0,0 +1,7 @@
1
+ /*
2
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
3
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
5
+ *= require_self
6
+ *= require_tree .
7
+ */
@@ -2,9 +2,9 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>Dummy</title>
5
- <%= stylesheet_link_tag :all %>
6
- <%= javascript_include_tag :defaults %>
7
- <%= csrf_meta_tag %>
5
+ <%= stylesheet_link_tag "application" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
8
  </head>
9
9
  <body>
10
10
 
@@ -1,10 +1,6 @@
1
1
  require File.expand_path('../boot', __FILE__)
2
2
 
3
- require "active_model/railtie"
4
- require "active_record/railtie"
5
- require "action_controller/railtie"
6
- require "action_view/railtie"
7
- require "action_mailer/railtie"
3
+ require 'rails/all'
8
4
 
9
5
  Bundler.require
10
6
  require "social_stream-documents"
@@ -33,13 +29,17 @@ module Dummy
33
29
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
34
30
  # config.i18n.default_locale = :de
35
31
 
36
- # JavaScript files you want as :defaults (application.js is always included).
37
- # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
38
-
39
32
  # Configure the default encoding used in templates for Ruby 1.9.
40
33
  config.encoding = "utf-8"
41
34
 
42
35
  # Configure sensitive parameters which will be filtered from the log file.
43
36
  config.filter_parameters += [:password]
37
+
38
+ # Enable the asset pipeline
39
+ config.assets.enabled = true
40
+
41
+ # Version of your assets, change this if you want to expire all your assets
42
+ config.assets.version = '1.0'
44
43
  end
45
44
  end
45
+
@@ -1,5 +1,8 @@
1
1
  # SQLite version 3.x
2
2
  # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
3
6
  development:
4
7
  adapter: sqlite3
5
8
  database: db/development.sqlite3
@@ -3,7 +3,7 @@ Dummy::Application.configure do
3
3
 
4
4
  # In the development environment your application's code is reloaded on
5
5
  # every request. This slows down response time but is perfect for development
6
- # since you don't have to restart the webserver when you make code changes.
6
+ # since you don't have to restart the web server when you make code changes.
7
7
  config.cache_classes = false
8
8
 
9
9
  # Log error messages when you accidentally call methods on nil.
@@ -21,5 +21,10 @@ Dummy::Application.configure do
21
21
 
22
22
  # Only use best-standards-support built into browsers
23
23
  config.action_dispatch.best_standards_support = :builtin
24
- end
25
24
 
25
+ # Do not compress assets
26
+ config.assets.compress = false
27
+
28
+ # Expands the lines which load the assets
29
+ config.assets.debug = true
30
+ end
@@ -1,7 +1,6 @@
1
1
  Dummy::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/application.rb
3
3
 
4
- # The production environment is meant for finished, "live" apps.
5
4
  # Code is not reloaded between requests
6
5
  config.cache_classes = true
7
6
 
@@ -9,14 +8,27 @@ Dummy::Application.configure do
9
8
  config.consider_all_requests_local = false
10
9
  config.action_controller.perform_caching = true
11
10
 
12
- # Specifies the header that your server uses for sending files
13
- config.action_dispatch.x_sendfile_header = "X-Sendfile"
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
14
22
 
15
- # For nginx:
16
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
23
+ # Defaults to Rails.root.join("public/assets")
24
+ # config.assets.manifest = YOUR_PATH
17
25
 
18
- # If you have no front-end server that supports something like X-Sendfile,
19
- # just comment this out and Rails will serve the files
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
20
32
 
21
33
  # See everything in the log (default is :info)
22
34
  # config.log_level = :debug
@@ -27,13 +39,12 @@ Dummy::Application.configure do
27
39
  # Use a different cache store in production
28
40
  # config.cache_store = :mem_cache_store
29
41
 
30
- # Disable Rails's static asset server
31
- # In production, Apache or nginx will already do this
32
- config.serve_static_assets = false
33
-
34
- # Enable serving of images, stylesheets, and javascripts from an asset server
42
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
35
43
  # config.action_controller.asset_host = "http://assets.example.com"
36
44
 
45
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
46
+ # config.assets.precompile += %w( search.js )
47
+
37
48
  # Disable delivery errors, bad email addresses will be ignored
38
49
  # config.action_mailer.raise_delivery_errors = false
39
50