social_stream-documents 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
data/spec/dummy/Rakefile CHANGED
@@ -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
 
@@ -7,7 +7,11 @@ Dummy::Application.configure do
7
7
  # and recreated between test runs. Don't rely on the data there!
8
8
  config.cache_classes = true
9
9
 
10
- # Log error messages when you accidentally call methods on nil.
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
11
15
  config.whiny_nils = true
12
16
 
13
17
  # Show full error reports and disable caching
@@ -32,6 +36,4 @@ Dummy::Application.configure do
32
36
 
33
37
  # Print deprecation notices to the stderr
34
38
  config.active_support.deprecation = :stderr
35
-
36
- config.assets.enabled = true
37
39
  end
@@ -4,4 +4,4 @@
4
4
  # If you change this key, all old signed cookies will become invalid!
5
5
  # Make sure the secret is at least 30 characters and all random,
6
6
  # no regular words or you'll be exposed to dictionary attacks.
7
- Dummy::Application.config.secret_token = 'a85ff3866549e818069e088bed435487038449bae9d3a31ca266f7b2670751908ea358d3120c787b2b86d9de39bb833b10a108b7b3d3460c4469e75f58be0259'
7
+ Dummy::Application.config.secret_token = '64ac9e68eea7ea0f6e41cd784aee79f12fa53b11e86b46e04d7e38cfb460df7156d5fbc09626fe621c9b3a0bd40b53f74404060639a71d630edf538f638026d4'
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -1,5 +1,5 @@
1
1
  # Sample localization file for English. Add more files in this directory for other locales.
2
- # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
3
 
4
4
  en:
5
5
  hello: "Hello world"
@@ -50,7 +50,7 @@ Dummy::Application.routes.draw do
50
50
 
51
51
  # You can have the root of your site routed with "root"
52
52
  # just remember to delete public/index.html.
53
- # root :to => "welcome#index"
53
+ # root :to => 'welcome#index'
54
54
 
55
55
  # See how all your routes lay out with "rake routes"
56
56
 
@@ -0,0 +1,6 @@
1
+ require 'social_stream/migrations/documents'
2
+
3
+ ActiveRecord::Schema.define(:version => 0) do
4
+ SocialStream::Migrations::Base.new.up
5
+ SocialStream::Migrations::Documents.new.up
6
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_stream-documents
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,22 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-12-22 00:00:00.000000000Z
13
+ date: 2012-01-11 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: social_stream-base
17
- requirement: &83246290 !ruby/object:Gem::Requirement
17
+ requirement: &70784500 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
21
21
  - !ruby/object:Gem::Version
22
- version: 0.11.1
22
+ version: 0.12.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *83246290
25
+ version_requirements: *70784500
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: paperclip-ffmpeg
28
- requirement: &83245710 !ruby/object:Gem::Requirement
28
+ requirement: &70783900 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 0.7.0
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *83245710
36
+ version_requirements: *70783900
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: paperclip
39
- requirement: &83235780 !ruby/object:Gem::Requirement
39
+ requirement: &70783600 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - =
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 2.3.11
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *83235780
47
+ version_requirements: *70783600
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: delayed_paperclip
50
- requirement: &83235460 !ruby/object:Gem::Requirement
50
+ requirement: &70783320 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - =
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: 0.7.2
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *83235460
58
+ version_requirements: *70783320
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: sqlite3-ruby
61
- requirement: &83234990 !ruby/object:Gem::Requirement
61
+ requirement: &70783090 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: '0'
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *83234990
69
+ version_requirements: *70783090
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rspec-rails
72
- requirement: &83234550 !ruby/object:Gem::Requirement
72
+ requirement: &70782730 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ~>
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: 2.6.0
78
78
  type: :development
79
79
  prerelease: false
80
- version_requirements: *83234550
80
+ version_requirements: *70782730
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: factory_girl
83
- requirement: &83234060 !ruby/object:Gem::Requirement
83
+ requirement: &70782400 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ~>
@@ -88,21 +88,21 @@ dependencies:
88
88
  version: 1.3.2
89
89
  type: :development
90
90
  prerelease: false
91
- version_requirements: *83234060
91
+ version_requirements: *70782400
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: forgery
94
- requirement: &83233680 !ruby/object:Gem::Requirement
94
+ requirement: &70782100 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
97
  - - ~>
98
98
  - !ruby/object:Gem::Version
99
- version: 0.3.6
99
+ version: 0.4.2
100
100
  type: :development
101
101
  prerelease: false
102
- version_requirements: *83233680
102
+ version_requirements: *70782100
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: capybara
105
- requirement: &83233350 !ruby/object:Gem::Requirement
105
+ requirement: &70781840 !ruby/object:Gem::Requirement
106
106
  none: false
107
107
  requirements:
108
108
  - - ~>
@@ -110,7 +110,7 @@ dependencies:
110
110
  version: 0.3.9
111
111
  type: :development
112
112
  prerelease: false
113
- version_requirements: *83233350
113
+ version_requirements: *70781840
114
114
  description: ! 'Social Stream is a Ruby on Rails engine providing your application
115
115
  with social networking features and activity streams.
116
116
 
@@ -229,6 +229,7 @@ files:
229
229
  - db/migrate/20110615143707_create_social_stream_documents.rb
230
230
  - db/migrate/20110922173707_add_file_processing_to_document.rb
231
231
  - db/migrate/20111005112707_add_title_and_description_to_document.rb
232
+ - db/migrate/20120109155431_document_object_type.rb
232
233
  - lib/generators/social_stream/documents/install_generator.rb
233
234
  - lib/social_stream-documents.rb
234
235
  - lib/social_stream/documents/engine.rb
@@ -240,6 +241,8 @@ files:
240
241
  - spec/controllers/pictures_controller_spec.rb
241
242
  - spec/dummy/.gitignore
242
243
  - spec/dummy/Rakefile
244
+ - spec/dummy/app/assets/javascripts/application.js
245
+ - spec/dummy/app/assets/stylesheets/application.css
243
246
  - spec/dummy/app/controllers/application_controller.rb
244
247
  - spec/dummy/app/helpers/application_helper.rb
245
248
  - spec/dummy/app/views/layouts/application.html.erb
@@ -257,11 +260,13 @@ files:
257
260
  - spec/dummy/config/initializers/mime_types.rb
258
261
  - spec/dummy/config/initializers/secret_token.rb
259
262
  - spec/dummy/config/initializers/session_store.rb
263
+ - spec/dummy/config/initializers/wrap_parameters.rb
260
264
  - spec/dummy/config/locales/en.yml
261
265
  - spec/dummy/config/navigation.rb
262
266
  - spec/dummy/config/relations.yml
263
267
  - spec/dummy/config/routes.rb
264
268
  - spec/dummy/db/.gitkeep
269
+ - spec/dummy/db/schema.rb
265
270
  - spec/dummy/public/404.html
266
271
  - spec/dummy/public/422.html
267
272
  - spec/dummy/public/500.html