social_stream-documents 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. data/.gitignore +9 -0
  2. data/Gemfile +3 -0
  3. data/MIT-LICENSE +20 -0
  4. data/README.rdoc +6 -0
  5. data/Rakefile +29 -0
  6. data/app/assets/images/btn/document.png +0 -0
  7. data/app/assets/images/formats/default.png +0 -0
  8. data/app/assets/images/formats/mp3.png +0 -0
  9. data/app/assets/images/formats/msexcel.png +0 -0
  10. data/app/assets/images/formats/msword.png +0 -0
  11. data/app/assets/images/formats/pdf.png +0 -0
  12. data/app/assets/images/formats/plain.png +0 -0
  13. data/app/assets/images/formats/rar.png +0 -0
  14. data/app/assets/images/formats/vnd.ms-powerpoint.png +0 -0
  15. data/app/assets/images/formats/zip.png +0 -0
  16. data/app/assets/javascripts/documents.js +42 -0
  17. data/app/assets/stylesheets/documents.css +96 -0
  18. data/app/controllers/audios_controller.rb +19 -0
  19. data/app/controllers/documents_controller.rb +42 -0
  20. data/app/controllers/pictures_controller.rb +18 -0
  21. data/app/controllers/videos_controller.rb +22 -0
  22. data/app/helpers/documents_helper.rb +28 -0
  23. data/app/models/audio.rb +3 -0
  24. data/app/models/document.rb +35 -0
  25. data/app/models/picture.rb +6 -0
  26. data/app/models/video.rb +15 -0
  27. data/app/views/audios/_audio.html.erb +23 -0
  28. data/app/views/audios/_index.html.erb +22 -0
  29. data/app/views/audios/index.html.erb +20 -0
  30. data/app/views/documents/_document.html.erb +19 -0
  31. data/app/views/documents/_index.html.erb +22 -0
  32. data/app/views/documents/_new.html.erb +5 -0
  33. data/app/views/documents/index.html.erb +20 -0
  34. data/app/views/pictures/_index.html.erb +22 -0
  35. data/app/views/pictures/_picture.html.erb +19 -0
  36. data/app/views/pictures/index.html.erb +20 -0
  37. data/app/views/toolbar/_home_menu_options.html.erb +33 -0
  38. data/app/views/toolbar/_uploads_menu.html.erb +21 -0
  39. data/app/views/videos/_index.html.erb +22 -0
  40. data/app/views/videos/_video.html.erb +23 -0
  41. data/app/views/videos/index.html.erb +20 -0
  42. data/app/worker/videoencoder.rb +7 -0
  43. data/config/locales/en.yml +22 -0
  44. data/config/routes.rb +9 -0
  45. data/db/migrate/20110615143707_create_social_stream_documents.rb +24 -0
  46. data/lib/generators/social_stream/documents/install_generator.rb +11 -0
  47. data/lib/social_stream/documents/engine.rb +18 -0
  48. data/lib/social_stream-documents.rb +10 -0
  49. data/social_stream-documents.gemspec +24 -0
  50. data/spec/dummy/Rakefile +7 -0
  51. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  52. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  53. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  54. data/spec/dummy/config/application.rb +45 -0
  55. data/spec/dummy/config/boot.rb +10 -0
  56. data/spec/dummy/config/database.yml +22 -0
  57. data/spec/dummy/config/environment.rb +5 -0
  58. data/spec/dummy/config/environments/development.rb +26 -0
  59. data/spec/dummy/config/environments/production.rb +49 -0
  60. data/spec/dummy/config/environments/test.rb +35 -0
  61. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  62. data/spec/dummy/config/initializers/inflections.rb +10 -0
  63. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  64. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  65. data/spec/dummy/config/initializers/session_store.rb +8 -0
  66. data/spec/dummy/config/locales/en.yml +5 -0
  67. data/spec/dummy/config/routes.rb +58 -0
  68. data/spec/dummy/config.ru +4 -0
  69. data/spec/dummy/public/404.html +26 -0
  70. data/spec/dummy/public/422.html +26 -0
  71. data/spec/dummy/public/500.html +26 -0
  72. data/spec/dummy/public/favicon.ico +0 -0
  73. data/spec/dummy/public/javascripts/application.js +2 -0
  74. data/spec/dummy/public/javascripts/controls.js +965 -0
  75. data/spec/dummy/public/javascripts/dragdrop.js +974 -0
  76. data/spec/dummy/public/javascripts/effects.js +1123 -0
  77. data/spec/dummy/public/javascripts/prototype.js +6001 -0
  78. data/spec/dummy/public/javascripts/rails.js +191 -0
  79. data/spec/dummy/public/stylesheets/.gitkeep +0 -0
  80. data/spec/dummy/script/rails +6 -0
  81. data/spec/integration/navigation_spec.rb +9 -0
  82. data/spec/socialstream_documents_spec.rb +7 -0
  83. data/spec/spec_helper.rb +33 -0
  84. metadata +296 -0
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ .bundle/
2
+ log/*.log
3
+ pkg/
4
+ spec/dummy/db/*.sqlite3
5
+ spec/dummy/log/*.log
6
+ spec/dummy/tmp/
7
+ *.DS_Store
8
+ Gemfile.lock
9
+ .project
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2011 VÍCTOR SÁNCHEZ BELMAR
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,6 @@
1
+ = Social Stream Attachments
2
+
3
+ Social Stream Attachments provides with files support to
4
+ {Social Stream}[http://social-stream.dit.upm.es/], the core for building social
5
+ network websites. This gem allows actor to upload files as other activity type.
6
+
data/Rakefile ADDED
@@ -0,0 +1,29 @@
1
+ # encoding: UTF-8
2
+ require 'rubygems'
3
+ begin
4
+ require 'bundler/setup'
5
+ rescue LoadError
6
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
7
+ end
8
+
9
+ require 'rake'
10
+ require 'rake/rdoctask'
11
+
12
+ require 'rspec/core'
13
+ require 'rspec/core/rake_task'
14
+
15
+ require 'bundler'
16
+
17
+ RSpec::Core::RakeTask.new(:spec)
18
+
19
+ task :default => :spec
20
+
21
+ Rake::RDocTask.new(:rdoc) do |rdoc|
22
+ rdoc.rdoc_dir = 'rdoc'
23
+ rdoc.title = 'Socialstream-files'
24
+ rdoc.options << '--line-numbers' << '--inline-source'
25
+ rdoc.rdoc_files.include('README.rdoc')
26
+ rdoc.rdoc_files.include('lib/**/*.rb')
27
+ end
28
+
29
+ Bundler::GemHelper.install_tasks
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,42 @@
1
+ $('.attachment_tile a').live("click",function(e){
2
+ e.preventDefault();
3
+
4
+ var download_link = this;
5
+
6
+ if($('.player').length > 0 && $('.attachment_tile.selected').length==1){
7
+ removePlayers();
8
+ return;
9
+ }
10
+ if(this.type == "Audio"){
11
+ removePlayers();
12
+ $(this).parent().parent().addClass("selected");
13
+ $('body').append("<audio class='player' autoplay='autoplay' id='audio_player' src='"+this+"' controls='controls'></audio>");
14
+ $('body').append("<a href='"+download_link+"'><img id='downloadButton' src='assets/formats/default.png' /></a>");
15
+ return;
16
+ }
17
+ if(this.type == "Video"){
18
+ removePlayers();
19
+ $(this).parent().parent().addClass("selected");
20
+ var show = (this+"").split('/download')[0];
21
+ show = show.replace("documents","videos");
22
+ $('body').append("<video class='player' autoplay='autoplay' id='video_player' src='"+show+"?style=webm' controls='controls'></video>");
23
+ $('body').append("<a href='"+download_link+"'><img id='downloadButton' src='assets/formats/default.png' /></a>");
24
+ return;
25
+ }
26
+ if(this.type == "Picture"){
27
+ removePlayers();
28
+ $(this).parent().parent().addClass("selected");
29
+ $('body').append("<img class='player' id='picture_player' src='"+download_link+"' />");
30
+ $('body').append("<a href='"+download_link+"'><img id='downloadButton' src='assets/formats/default.png' /></a>");
31
+ }
32
+ });
33
+
34
+ function removePlayers(){
35
+ $('.attachment_tile').removeClass("selected");
36
+ $('.player').remove();
37
+ $('#downloadButton').remove();
38
+ }
39
+
40
+ $('#closeButton').live("click",function(){
41
+ removePlayers();
42
+ });
@@ -0,0 +1,96 @@
1
+ .attachment
2
+ {
3
+ padding-top: 10px;
4
+ }
5
+
6
+ .attachment_text
7
+ {
8
+ position: relative;
9
+ width: 90%;
10
+ vertical-align: middle;
11
+ line-height: 20px;
12
+ height: auto;
13
+ float:left;
14
+ font-size:13px;
15
+ }
16
+
17
+ .attachment_text a
18
+ {
19
+ color: #2A3890;
20
+ padding-left: 10px;
21
+ }
22
+
23
+ .attachment_text audio
24
+ {
25
+ position:relative;
26
+ }
27
+
28
+ .attachment_text video
29
+ {
30
+ position:relative;
31
+ height: 180px;
32
+ }
33
+
34
+ .attachment_thumb
35
+ {
36
+ position: relative;
37
+ width: 10%;
38
+ float: left;
39
+ height: 50px;
40
+ vertical-align: middle;
41
+ }
42
+
43
+ #new_document{
44
+ margin-top: 10px;
45
+ margin-left: 15px;
46
+ margin-bottom: 10px;
47
+ clear: both;
48
+ }
49
+
50
+ .attachment_tile{
51
+ margin: 4px;
52
+ margin-bottom: 8px;
53
+ width: 80px;
54
+ height: 65px;
55
+ border-bottom: 2px solid transparent;
56
+ float: left;
57
+ text-align: center;
58
+ overflow: hidden;
59
+ }
60
+
61
+ .attachment_tile:hover{
62
+ background-color: #e0edf2;
63
+ border-bottom: 2px solid #2A3890;
64
+ }
65
+
66
+ .attachment_tile.selected{
67
+ background-color: #e0edf2;
68
+ border-bottom: 2px solid green;
69
+ }
70
+
71
+ .attachment_section_header{
72
+ margin-top: 15px;
73
+ margin-bottom: 5px;
74
+ padding-left: 10px;
75
+ position: relative;
76
+ width:90%;
77
+ border-left: 3px solid #2A3890;
78
+ background-color: #e0edf2;
79
+ }
80
+
81
+ .player{
82
+ position: absolute;
83
+ border-left: 24px solid #2A3890;
84
+ border-right: 24px solid #2A3890;
85
+ background-color: #e0edf2;
86
+ bottom: 0px;
87
+ right: 0px;
88
+ max-height: 300px;
89
+ }
90
+
91
+ #downloadButton{
92
+ position: absolute;
93
+ bottom: 5px;
94
+ right: 0px;
95
+ width: 24px;
96
+ }
@@ -0,0 +1,19 @@
1
+ class AudiosController < InheritedResources::Base
2
+ load_and_authorize_resource
3
+
4
+ def show
5
+ path = @audio.file.path(params[:style])
6
+ respond_to do |format|
7
+ format.all {send_file path,
8
+ :type => @audio.file_content_type,
9
+ :disposition => "inline"}
10
+ end
11
+ end
12
+
13
+ def index
14
+ @document_activities = current_subject.wall(:profile,
15
+ :for => current_subject,
16
+ :object_type => :Audio).all;
17
+ end
18
+
19
+ end
@@ -0,0 +1,42 @@
1
+ class DocumentsController < InheritedResources::Base
2
+ load_and_authorize_resource
3
+
4
+ respond_to :html,:js,:png,:jpeg,:bmp,:gif
5
+
6
+ SEND_FILE_METHOD = :default
7
+
8
+ def show
9
+ path = @document.file.path(params[:style])
10
+ respond_to do |format|
11
+ format.all {send_file path,
12
+ :type => @document.file_content_type,
13
+ :disposition => "inline"}
14
+ end
15
+ end
16
+
17
+ def download
18
+ path = @document.file.path(params[:style])
19
+ head(:bad_request) and return unless File.exist?(path)
20
+ send_file_options = {}
21
+
22
+ case SEND_FILE_METHOD
23
+ when :apache then send_file_options[:x_sendfile] = true
24
+ when :nginx then head(:x_accel_redirect => path.gsub(Rails.root, ''))
25
+ end
26
+
27
+ send_file(path, send_file_options)
28
+ end
29
+
30
+ def index
31
+ @document_activities = current_subject.wall(:profile,
32
+ :for => current_subject,
33
+ :object_type => [:Audio,:Video,:Picture,:Document]).all;
34
+ end
35
+
36
+ def create
37
+ super do |format|
38
+ format.all {redirect_to documents_path}
39
+ end
40
+ end
41
+
42
+ end
@@ -0,0 +1,18 @@
1
+ class PicturesController < InheritedResources::Base
2
+ load_and_authorize_resource
3
+
4
+ def show
5
+ path = @picture.file.path(params[:style])
6
+ respond_to do |format|
7
+ format.all {send_file path,
8
+ :type => @picture.file_content_type,
9
+ :disposition => "inline"}
10
+ end
11
+ end
12
+
13
+ def index
14
+ @document_activities = current_subject.wall(:profile,
15
+ :for => current_subject,
16
+ :object_type => :Picture).all;
17
+ end
18
+ end
@@ -0,0 +1,22 @@
1
+ class VideosController < InheritedResources::Base
2
+ load_and_authorize_resource
3
+
4
+ def show
5
+ path = @video.file.path(params[:style])
6
+ if(params[:style].present?)
7
+ path = path.split('.')[0]+'.'+params[:style]
8
+ end
9
+ respond_to do |format|
10
+ format.all {send_file path,
11
+ :type => @video.file_content_type,
12
+ :disposition => "inline"}
13
+ end
14
+ end
15
+
16
+ def index
17
+ @document_activities = current_subject.wall(:profile,
18
+ :for => current_subject,
19
+ :object_type => :Video).all;
20
+ end
21
+
22
+ end
@@ -0,0 +1,28 @@
1
+ module DocumentsHelper
2
+
3
+ FORMATS = ["msword","vnd.ms-powerpoint","msexcel","rar","zip","mp3","plain","pdf"]
4
+
5
+ def thumb_for(document)
6
+ format = document.file_content_type
7
+ if FORMATS.include?(format.split('/')[1])
8
+ image_tag 'formats/'+format.split('/')[1]+'.png'
9
+ else
10
+ if is_image?(document)
11
+ image_tag document.file.url(:thumb)+"?style=thumb"
12
+ else
13
+ image_tag 'formats/default.png'
14
+ end
15
+ end
16
+ end
17
+
18
+ def wrap_file_name(name)
19
+ name
20
+ if(name.length > 12)
21
+ name[0,12]+"..."
22
+ end
23
+ end
24
+
25
+ def is_image?(document)
26
+ !(document.file_content_type =~ /^image.*/).nil?
27
+ end
28
+ end
@@ -0,0 +1,3 @@
1
+ class Audio < Document
2
+
3
+ end
@@ -0,0 +1,35 @@
1
+ class Document < ActiveRecord::Base
2
+ has_attached_file :file,
3
+ :url => '/:class/:id.:extension',
4
+ :path => ':rails_root/documents/:class/:id_partition/:style.:extension'
5
+
6
+ validates_attachment_presence :file
7
+
8
+ class << self
9
+ def new(*args)
10
+ if !(self.name == "Document")
11
+ return super
12
+ end
13
+ doc = super
14
+
15
+ if(doc.file_content_type.nil?)
16
+ return doc
17
+ end
18
+
19
+ if !(doc.file_content_type =~ /^image.*/).nil?
20
+ return Picture.new *args
21
+ end
22
+
23
+ if !(doc.file_content_type =~ /^audio.*/).nil?
24
+ return Audio.new *args
25
+ end
26
+
27
+ if !(doc.file_content_type =~ /^video.*/).nil?
28
+ return Video.new *args
29
+ end
30
+
31
+ return doc
32
+ end
33
+ end
34
+
35
+ end
@@ -0,0 +1,6 @@
1
+ class Picture < Document
2
+ has_attached_file :file,
3
+ :url => '/:class/:id.:extension',
4
+ :path => ':rails_root/documents/:class/:id_partition/:style.:extension',
5
+ :styles => {:thumb => ["48x48#", :png]}
6
+ end
@@ -0,0 +1,15 @@
1
+ class Video < Document
2
+ after_save :videoprocess
3
+
4
+ has_attached_file :file,
5
+ :url => '/:class/:id.:extension',
6
+ :path => ':rails_root/documents/:class/:id_partition/:style.:extension',
7
+ :styles => {:webm => {:format => 'webm'},
8
+ :thumb => {:geometry => "48x48#", :format => 'png', :time => 5}
9
+ },:processors => [:ffmpeg]
10
+
11
+ def videoprocess
12
+ Resque.enqueue(Videoencoder, self.id)
13
+ end
14
+
15
+ end
@@ -0,0 +1,23 @@
1
+ <% content_for :headers do %>
2
+ <%= stylesheet_link_tag "documents" %>
3
+ <% end %>
4
+
5
+ <%= div_for audio, :class => 'content_size' do %>
6
+
7
+ <div class="attachment_thumb">
8
+ <%= link_to thumb_for(audio),
9
+ {:controller => "documents", :action => "download", :id => audio},
10
+ :class => "" %>
11
+ </div>
12
+
13
+ <div class="attachment_text">
14
+ <%= t('audio.msg') %><%= link_to audio.file_file_name,
15
+ {:controller => "documents", :action => "download", :id => audio},
16
+ :class => "" %>
17
+
18
+ <audio src="<%= download_document_path(audio) %>" controls="controls">
19
+ Your browser does not support the audio element.
20
+ </audio>
21
+ </div>
22
+
23
+ <% end %>
@@ -0,0 +1,22 @@
1
+ <div class="attachment_section_header">
2
+ <h3><%= t('audio.mine') %></h3>
3
+ </div>
4
+ <% @document_activities.each do |a| %>
5
+ <% document = a.activity_objects.first.document %>
6
+ <div class="attachment_tile">
7
+ <div class="attachment_tile_thumb">
8
+ <%= link_to thumb_for(document),
9
+ {:controller => "documents", :action => "download", :id => document},
10
+ :type => document.type,
11
+ :path => document_path(document) %>
12
+ </div>
13
+
14
+ <div class="attachment_tile_text">
15
+ <%= link_to document.file_file_name,
16
+ {:controller => "documents", :action => "download", :id => document},
17
+ :alt => document.file_file_name,
18
+ :type => document.type,
19
+ :path => document_path(document) %>
20
+ </div>
21
+ </div>
22
+ <% end %>
@@ -0,0 +1,20 @@
1
+ <% content_for :title do %>
2
+ <%= current_subject.name %>
3
+ <% end %>
4
+
5
+ <% content_for :sidebar do %>
6
+ <%= render :partial => 'home/sidebar' %>
7
+ <% end %>
8
+
9
+ <% content_for :headers do %>
10
+ <%= stylesheet_link_tag "documents" %>
11
+ <%= javascript_include_tag 'documents' %>
12
+ <% end %>
13
+
14
+ <%= location(
15
+ link_to(image_tag("btn/btn_outline.png", :class => "menu_icon")+t('audio.title'), audios_path,:remote => true)
16
+ ) %>
17
+
18
+ <% toolbar %>
19
+
20
+ <%= render :partial => 'index' %>
@@ -0,0 +1,19 @@
1
+ <% content_for :headers do %>
2
+ <%= stylesheet_link_tag "documents" %>
3
+ <% end %>
4
+
5
+ <%= div_for document, :class => 'content_size' do %>
6
+
7
+ <div class="attachment_thumb">
8
+ <%= link_to thumb_for(document),
9
+ {:controller => "documents", :action => "download", :id => document},
10
+ :class => "" %>
11
+ </div>
12
+
13
+ <div class="attachment_text">
14
+ <%= t('document.msg') %><%= link_to document.file_file_name,
15
+ {:controller => "documents", :action => "download", :id => document},
16
+ :class => "" %>
17
+ </div>
18
+
19
+ <% end %>
@@ -0,0 +1,22 @@
1
+ <div class="attachment_section_header">
2
+ <h3><%= t('document.mine') %></h3>
3
+ </div>
4
+ <% @document_activities.each do |a| %>
5
+ <% document = a.activity_objects.first.document %>
6
+ <div class="attachment_tile">
7
+ <div class="attachment_tile_thumb">
8
+ <%= link_to thumb_for(document),
9
+ {:controller => "documents", :action => "download", :id => document},
10
+ :type => document.type,
11
+ :path => document_path(document) %>
12
+ </div>
13
+
14
+ <div class="attachment_tile_text">
15
+ <%= link_to document.file_file_name,
16
+ {:controller => "documents", :action => "download", :id => document},
17
+ :alt => document.file_file_name,
18
+ :type => document.type,
19
+ :path => document_path(document) %>
20
+ </div>
21
+ </div>
22
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= form_for Document.new(:_activity_tie_id => a_tie_id),
2
+ :html => { :multipart => true } do |form| %>
3
+ <%= form.hidden_field :_activity_tie_id %>
4
+ <%= form.file_field :file %>
5
+ <% end %>
@@ -0,0 +1,20 @@
1
+ <% content_for :title do %>
2
+ <%= current_subject.name %>
3
+ <% end %>
4
+
5
+ <% content_for :sidebar do %>
6
+ <%= render :partial => 'home/sidebar' %>
7
+ <% end %>
8
+
9
+ <% content_for :headers do %>
10
+ <%= stylesheet_link_tag "documents" %>
11
+ <%= javascript_include_tag 'documents' %>
12
+ <% end %>
13
+
14
+ <%= location(
15
+ link_to(image_tag("btn/document.png", :class => "menu_icon")+t('document.title'), documents_path,:remote => true)
16
+ ) %>
17
+
18
+ <% toolbar %>
19
+
20
+ <%= render :partial => 'index' %>
@@ -0,0 +1,22 @@
1
+ <div class="attachment_section_header">
2
+ <h3><%= t('picture.mine') %></h3>
3
+ </div>
4
+ <% @document_activities.each do |a| %>
5
+ <% document = a.activity_objects.first.document %>
6
+ <div class="attachment_tile">
7
+ <div class="attachment_tile_thumb">
8
+ <%= link_to thumb_for(document),
9
+ {:controller => "documents", :action => "download", :id => document},
10
+ :type => document.type,
11
+ :path => document_path(document) %>
12
+ </div>
13
+
14
+ <div class="attachment_tile_text">
15
+ <%= link_to document.file_file_name,
16
+ {:controller => "documents", :action => "download", :id => document},
17
+ :alt => document.file_file_name,
18
+ :type => document.type,
19
+ :path => document_path(document) %>
20
+ </div>
21
+ </div>
22
+ <% end %>
@@ -0,0 +1,19 @@
1
+ <% content_for :headers do %>
2
+ <%= stylesheet_link_tag "documents" %>
3
+ <% end %>
4
+
5
+ <%= div_for picture, :class => 'content_size' do %>
6
+
7
+ <div class="attachment_thumb">
8
+ <%= link_to thumb_for(picture),
9
+ {:controller => "documents", :action => "download", :id => picture},
10
+ :class => "" %>
11
+ </div>
12
+
13
+ <div class="attachment_text">
14
+ <%= t('picture.msg') %><%= link_to picture.file_file_name,
15
+ {:controller => "documents", :action => "download", :id => picture},
16
+ :class => "" %>
17
+ </div>
18
+
19
+ <% end %>
@@ -0,0 +1,20 @@
1
+ <% content_for :title do %>
2
+ <%= current_subject.name %>
3
+ <% end %>
4
+
5
+ <% content_for :sidebar do %>
6
+ <%= render :partial => 'home/sidebar' %>
7
+ <% end %>
8
+
9
+ <% content_for :headers do %>
10
+ <%= stylesheet_link_tag "documents" %>
11
+ <%= javascript_include_tag 'documents' %>
12
+ <% end %>
13
+
14
+ <%= location(
15
+ link_to(image_tag("btn/btn_gallery.png", :class => "menu_icon")+t('picture.title'), pictures_path,:remote => true)
16
+ ) %>
17
+
18
+ <% toolbar %>
19
+
20
+ <%= render :partial => 'index' %>