social_stream-documents 0.4.8 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/stylesheets/show.css.scss +4 -0
- data/app/controllers/documents_controller.rb +2 -10
- data/app/views/audios/_audio_processed.html.erb +1 -1
- data/app/views/audios/_audio_processing.html.erb +1 -1
- data/app/views/common_documents/_document_info.html.erb +5 -0
- data/app/views/documents/_document.html.erb +1 -1
- data/app/views/pictures/_picture.html.erb +4 -4
- data/app/views/videos/_video_processed.html.erb +1 -1
- data/app/views/videos/_video_processing.html.erb +1 -1
- data/lib/social_stream/documents/version.rb +1 -1
- data/social_stream-documents.gemspec +1 -1
- data/spec/factories/document.rb +7 -6
- data/spec/factories/picture.rb +7 -6
- data/spec/spec_helper.rb +6 -1
- metadata +9 -14
- data/app/views/audios/_mediapreviews.html.erb +0 -0
- data/app/views/audios/index.js.erb +0 -1
- data/app/views/documents/index.js.erb +0 -1
- data/app/views/pictures/_mediapreviews.html.erb +0 -8
- data/app/views/pictures/index.js.erb +0 -1
@@ -1,13 +1,11 @@
|
|
1
|
-
class DocumentsController <
|
1
|
+
class DocumentsController < ApplicationController
|
2
2
|
include ActionView::Helpers::SanitizeHelper
|
3
|
-
|
3
|
+
include SocialStream::Controllers::Objects
|
4
4
|
|
5
5
|
belongs_to_subjects :optional => true
|
6
6
|
|
7
7
|
before_filter :profile_subject!, :only => :index
|
8
8
|
|
9
|
-
load_and_authorize_resource :except => :index
|
10
|
-
|
11
9
|
PER_PAGE=20
|
12
10
|
SEND_FILE_METHOD = :default
|
13
11
|
|
@@ -67,12 +65,6 @@ class DocumentsController < InheritedResources::Base
|
|
67
65
|
send_file(path, send_file_options)
|
68
66
|
end
|
69
67
|
|
70
|
-
def destroy
|
71
|
-
@post_activity = resource.post_activity
|
72
|
-
|
73
|
-
destroy!
|
74
|
-
end
|
75
|
-
|
76
68
|
private
|
77
69
|
|
78
70
|
def collection
|
@@ -1,4 +1,9 @@
|
|
1
1
|
<div id="document_info">
|
2
|
+
<% if document.description %>
|
3
|
+
<div id="description">
|
4
|
+
<%= document.description %>
|
5
|
+
</div>
|
6
|
+
<% end %>
|
2
7
|
<div id="actions">
|
3
8
|
<%= link_to content_tag(:span,image_tag("btn/btn_write.png") + t('document.actions.details'), :class => :action, :id => :document_details_action), "javascript:toggleDocumentMenu('details');" %>
|
4
9
|
<%= link_to content_tag(:span,image_tag("btn/download.png") + t('document.actions.download'), :class => :action), download_document_path(document) %>
|
@@ -4,15 +4,15 @@
|
|
4
4
|
<%= link_to thumb_for(picture, 16),
|
5
5
|
picture_path(picture),
|
6
6
|
:type => picture.type,
|
7
|
-
:title => picture.
|
7
|
+
:title => picture.title,
|
8
8
|
:path => document_path(picture) %>
|
9
9
|
</div>
|
10
10
|
|
11
11
|
<div class="attachment_text picture_summary_class picture_link">
|
12
12
|
<%= t('picture.msg') %>
|
13
|
-
<%= link_to "\""+picture.
|
13
|
+
<%= link_to "\""+picture.title+"\"",
|
14
14
|
picture_path(picture),
|
15
|
-
:alt => picture.
|
15
|
+
:alt => picture.title,
|
16
16
|
:type => picture.type,
|
17
17
|
:path => document_path(picture),
|
18
18
|
:class => "attachment_text_link" %>
|
@@ -22,7 +22,7 @@
|
|
22
22
|
<%= link_to thumb_for(picture, 130),
|
23
23
|
download_document_path(picture),
|
24
24
|
:type => picture.type,
|
25
|
-
:title => picture.
|
25
|
+
:title => picture.title,
|
26
26
|
:path => document_path(picture) %>
|
27
27
|
</div>
|
28
28
|
<% end %>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
:class => "" %>
|
6
6
|
</div>
|
7
7
|
<div class="attachment_text">
|
8
|
-
<%= t('video.msg') %><%= link_to "\""+video.
|
8
|
+
<%= t('video.msg') %><%= link_to "\""+video.title+"\"",
|
9
9
|
video,
|
10
10
|
:class => "attachment_text_link" %>
|
11
11
|
<div id="video_thumbnail_<%= video.id%>" class="video_thumbnail_class">
|
@@ -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.
|
15
|
+
s.add_runtime_dependency('social_stream-base', '~> 0.10.0')
|
16
16
|
s.add_runtime_dependency('paperclip-ffmpeg', '~> 0.7.0')
|
17
17
|
s.add_runtime_dependency('paperclip','2.3.11')
|
18
18
|
s.add_runtime_dependency('delayed_paperclip','>= 0.7.2')
|
data/spec/factories/document.rb
CHANGED
@@ -2,18 +2,19 @@ Factory.define :document do |d|
|
|
2
2
|
d.file { Rack::Test::UploadedFile.new(File.join(File.dirname(__FILE__), 'files', 'small.pdf'),
|
3
3
|
'application/pdf') }
|
4
4
|
|
5
|
-
d.
|
6
|
-
d.
|
5
|
+
d.author_id { Factory(:friend).receiver.id }
|
6
|
+
d.owner_id { |q| Actor.find(q.author_id).received_ties.first.sender.id }
|
7
|
+
d.user_author_id { |q| q.author_id }
|
7
8
|
end
|
8
9
|
|
9
10
|
Factory.define :public_document, :parent => :document do |d|
|
10
|
-
d.
|
11
|
-
d._relation_ids { |q| Array(
|
11
|
+
d.owner_id { |q| q.author_id }
|
12
|
+
d._relation_ids { |q| Array(q.author.relation_public.id) }
|
12
13
|
end
|
13
14
|
|
14
15
|
Factory.define :private_document, :parent => :document do |d|
|
15
16
|
d.file { Rack::Test::UploadedFile.new(File.join(File.dirname(__FILE__), 'files', 'small.pdf'),
|
16
17
|
'application/pdf') }
|
17
|
-
d.
|
18
|
-
d._relation_ids
|
18
|
+
d.owner_id { |q| q.author_id }
|
19
|
+
d._relation_ids { |q| Actor.find(q.author_id).relation_customs.sort.first.id }
|
19
20
|
end
|
data/spec/factories/picture.rb
CHANGED
@@ -2,19 +2,20 @@ Factory.define :picture do |p|
|
|
2
2
|
p.file { Rack::Test::UploadedFile.new(File.join(File.dirname(__FILE__), 'files', 'rails.png'),
|
3
3
|
'image/png') }
|
4
4
|
|
5
|
-
p.
|
6
|
-
p.
|
5
|
+
p.author_id { Factory(:friend).receiver.id }
|
6
|
+
p.owner_id { |q| Actor.find(q.author_id).received_ties.first.sender.id }
|
7
|
+
p.user_author_id { |q| q.author_id }
|
7
8
|
end
|
8
9
|
|
9
10
|
Factory.define :public_picture, :parent => :picture do |p|
|
10
|
-
p.
|
11
|
-
p._relation_ids { |q| Array(
|
11
|
+
p.owner_id { |q| q.author_id }
|
12
|
+
p._relation_ids { |q| Array(q.author.relation_public.id) }
|
12
13
|
end
|
13
14
|
|
14
15
|
Factory.define :private_picture, :parent => :picture do |p|
|
15
16
|
p.file { Rack::Test::UploadedFile.new(File.join(File.dirname(__FILE__), 'files', 'privado.png'),
|
16
17
|
'image/png') }
|
17
|
-
p.
|
18
|
-
p._relation_ids
|
18
|
+
p.owner_id { |q| q.author_id }
|
19
|
+
p._relation_ids { |q| Actor.find(q.author_id).relation_customs.sort.first.id }
|
19
20
|
end
|
20
21
|
|
data/spec/spec_helper.rb
CHANGED
@@ -23,7 +23,12 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
|
23
23
|
|
24
24
|
# Load Factories
|
25
25
|
require 'factory_girl'
|
26
|
-
|
26
|
+
|
27
|
+
if (Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.8.0'))
|
28
|
+
base_path = File.join(Gem::Specification.find_by_name('social_stream-base').full_gem_path, 'spec')
|
29
|
+
else
|
30
|
+
base_path = File.join(Gem::GemPathSearcher.new.find('social_stream-base').full_gem_path, 'spec')
|
31
|
+
end
|
27
32
|
[ base_path, File.dirname(__FILE__) ].each do |path|
|
28
33
|
Dir["#{path}/factories/*.rb"].each {|f| require f}
|
29
34
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_stream-documents
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 5
|
9
|
+
- 0
|
10
|
+
version: 0.5.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "V\xC3\xADctor S\xC3\xA1nchez Belmar"
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-11-
|
19
|
+
date: 2011-11-28 00:00:00 +01:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -27,12 +27,12 @@ dependencies:
|
|
27
27
|
requirements:
|
28
28
|
- - ~>
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
hash:
|
30
|
+
hash: 55
|
31
31
|
segments:
|
32
32
|
- 0
|
33
|
-
-
|
34
|
-
-
|
35
|
-
version: 0.
|
33
|
+
- 10
|
34
|
+
- 0
|
35
|
+
version: 0.10.0
|
36
36
|
type: :runtime
|
37
37
|
version_requirements: *id001
|
38
38
|
- !ruby/object:Gem::Dependency
|
@@ -250,11 +250,9 @@ files:
|
|
250
250
|
- app/views/audios/_audio_processing.html.erb
|
251
251
|
- app/views/audios/_audio_show.html.erb
|
252
252
|
- app/views/audios/_audio_with_details.html.erb
|
253
|
-
- app/views/audios/_mediapreviews.html.erb
|
254
253
|
- app/views/audios/_new.html.erb
|
255
254
|
- app/views/audios/destroy.js.erb
|
256
255
|
- app/views/audios/index.html.erb
|
257
|
-
- app/views/audios/index.js.erb
|
258
256
|
- app/views/audios/show.html.erb
|
259
257
|
- app/views/common_documents/_document_info.html.erb
|
260
258
|
- app/views/common_documents/_edit_form.html.erb
|
@@ -270,9 +268,7 @@ files:
|
|
270
268
|
- app/views/documents/_new_activity_fields.html.erb
|
271
269
|
- app/views/documents/destroy.js.erb
|
272
270
|
- app/views/documents/index.html.erb
|
273
|
-
- app/views/documents/index.js.erb
|
274
271
|
- app/views/documents/show.html.erb
|
275
|
-
- app/views/pictures/_mediapreviews.html.erb
|
276
272
|
- app/views/pictures/_new.html.erb
|
277
273
|
- app/views/pictures/_picture.html.erb
|
278
274
|
- app/views/pictures/_picture_focus_search.html.erb
|
@@ -281,7 +277,6 @@ files:
|
|
281
277
|
- app/views/pictures/_picture_with_details.html.erb
|
282
278
|
- app/views/pictures/destroy.js.erb
|
283
279
|
- app/views/pictures/index.html.erb
|
284
|
-
- app/views/pictures/index.js.erb
|
285
280
|
- app/views/pictures/show.html.erb
|
286
281
|
- app/views/videos/_new.html.erb
|
287
282
|
- app/views/videos/_video.html.erb
|
File without changes
|
@@ -1 +0,0 @@
|
|
1
|
-
$('#media_wall').html("<%= escape_javascript(render :partial =>"audios/mediapreviews") %>");
|
@@ -1 +0,0 @@
|
|
1
|
-
$('#media_wall').html("<%= escape_javascript(render :partial =>"documents/mediapreviews") %>");
|
@@ -1,8 +0,0 @@
|
|
1
|
-
<% @document_activities.each do |a| %>
|
2
|
-
<% document = a.activity_objects.first.document %>
|
3
|
-
<div class="media_preview picture">
|
4
|
-
<img src="<%= link_for_wall(document) %>" class="media_preview_image" />
|
5
|
-
<div class="media_preview_title"><%= document.file_file_name %></div>
|
6
|
-
<div class="media_preview_detail">some detail</div>
|
7
|
-
</div>
|
8
|
-
<% end %>
|
@@ -1 +0,0 @@
|
|
1
|
-
$('#media_wall').html("<%= escape_javascript(render :partial =>"pictures/mediapreviews") %>");
|