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.
@@ -41,6 +41,10 @@
41
41
  float: left;
42
42
  margin-left: 30px;
43
43
  }
44
+ #document_info #description{
45
+ margin: 15px 40px;
46
+ text-align: justify;
47
+ }
44
48
  #document_info #actions{
45
49
  margin-top: 10px;
46
50
  margin-left: 30px;
@@ -1,13 +1,11 @@
1
- class DocumentsController < InheritedResources::Base
1
+ class DocumentsController < ApplicationController
2
2
  include ActionView::Helpers::SanitizeHelper
3
- respond_to :html, :js
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
@@ -4,7 +4,7 @@
4
4
  :class => "" %>
5
5
  </div>
6
6
  <div class="attachment_text">
7
- <%= t('audio.msg') %><%= link_to "\""+audio.file_file_name+"\"",
7
+ <%= t('audio.msg') %><%= link_to "\""+audio.title+"\"",
8
8
  audio_path(audio),
9
9
  :class => "attachment_text_link" %>
10
10
  </div>
@@ -2,6 +2,6 @@
2
2
  <%= thumb_for(audio, 16) %>
3
3
  </div>
4
4
  <div class="attachment_text">
5
- <%= t('audio.msg') %><%= "\""+audio.file_file_name+"\"" %>
5
+ <%= t('audio.msg') %><%= "\""+audio.title+"\"" %>
6
6
  <div class="processing_text"><%= t('audio.processing')%></div>
7
7
  </div>
@@ -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) %>
@@ -7,7 +7,7 @@
7
7
  </div>
8
8
 
9
9
  <div class="attachment_text">
10
- <%= t('document.msg') %><%= link_to "\""+document.file_file_name+"\"",
10
+ <%= t('document.msg') %><%= link_to "\""+document.title+"\"",
11
11
  document,
12
12
  :class => "attachment_text_link" %>
13
13
  </div>
@@ -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.file_file_name,
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.file_file_name+"\"",
13
+ <%= link_to "\""+picture.title+"\"",
14
14
  picture_path(picture),
15
- :alt => picture.file_file_name,
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.file_file_name,
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.file_file_name+"\"",
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">
@@ -2,6 +2,6 @@
2
2
  <%= thumb_for(video, 16) %>
3
3
  </div>
4
4
  <div class="attachment_text">
5
- <%= t('video.msg') %><%= "\""+video.file_file_name+"\"" %>
5
+ <%= t('video.msg') %><%= "\""+video.title+"\"" %>
6
6
  <div class="processing_text"><%= t('video.processing')%></div>
7
7
  </div>
@@ -1,5 +1,5 @@
1
1
  module SocialStream
2
2
  module Documents
3
- VERSION = "0.4.8".freeze
3
+ VERSION = "0.5.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.9.36')
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')
@@ -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._contact_id { Factory(:friend).contact_id }
6
- d._relation_ids { |q| Array(Contact.find(q._contact_id).sender.relation_customs.sort.first.id) }
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._contact_id { Factory(:self_contact).id }
11
- d._relation_ids { |q| Array(Contact.find(q._contact_id).sender.relation_public.id) }
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._contact_id { Factory(:self_contact).id }
18
- d._relation_ids { |q| Array(Contact.find(q._contact_id).sender.relation_customs.sort.first.id) }
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
@@ -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._contact_id { Factory(:friend).contact_id }
6
- p._relation_ids { |q| Array(Contact.find(q._contact_id).sender.relation_customs.sort.first.id) }
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._contact_id { Factory(:self_contact).id }
11
- p._relation_ids { |q| Array(Contact.find(q._contact_id).sender.relation_public.id) }
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._contact_id { Factory(:self_contact).id }
18
- p._relation_ids { |q| Array(Contact.find(q._contact_id).sender.relation_customs.sort.first.id) }
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
- base_path = File.join(Gem::GemPathSearcher.new.find('social_stream-base').full_gem_path, 'spec')
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: 31
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 4
9
- - 8
10
- version: 0.4.8
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-21 00:00:00 +01:00
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: 115
30
+ hash: 55
31
31
  segments:
32
32
  - 0
33
- - 9
34
- - 36
35
- version: 0.9.36
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") %>");