social_stream-documents 1.1.4 → 2.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/icons/attach.png +0 -0
- data/app/assets/javascripts/{social_stream.audio.js.erb → social_stream/audio.js.erb} +7 -3
- data/app/assets/javascripts/social_stream/document.js +27 -0
- data/app/assets/javascripts/social_stream/documents.timeline.js +11 -0
- data/app/assets/javascripts/social_stream/documents.wall.js +48 -0
- data/app/assets/javascripts/{social_stream.video.js.erb → social_stream/video.js.erb} +11 -8
- data/app/assets/javascripts/social_stream-documents.js +1 -1
- data/{spec/dummy/config/navigation.rb → app/assets/stylesheets/social_stream/documents/_toolbar.css.sass} +0 -0
- data/app/assets/stylesheets/social_stream/documents/aside/_documents.css.sass +4 -0
- data/app/assets/stylesheets/social_stream/documents/aside/layout/_documents.css.sass +30 -0
- data/{spec/dummy/db/.gitkeep → app/assets/stylesheets/social_stream/documents/create/_new.css.sass} +0 -0
- data/app/assets/stylesheets/social_stream/documents/create/layout/_new.css.sass +32 -0
- data/app/assets/stylesheets/social_stream/documents/documents/_documents.css.sass +4 -0
- data/app/assets/stylesheets/social_stream/documents/documents/layout/_documents.css.sass +52 -0
- data/app/assets/stylesheets/social_stream/documents/explore/_explore-documents.css.sass +12 -0
- data/app/assets/stylesheets/social_stream/documents/explore/layout/_explore-documents.css.sass +20 -0
- data/app/assets/stylesheets/social_stream/documents/responsive/_responsive-1200px-min.css.sass +21 -0
- data/app/assets/stylesheets/social_stream/documents/responsive/_responsive-767px-max.css.sass +58 -0
- data/app/assets/stylesheets/social_stream/documents/responsive/_responsive-768px-979px.css.sass +54 -0
- data/app/assets/stylesheets/social_stream/documents/search/_header.css.sass +25 -0
- data/app/assets/stylesheets/social_stream/documents/search/layout/_header.css.sass +33 -0
- data/app/assets/stylesheets/social_stream/documents/show/_show.css.sass +72 -0
- data/app/assets/stylesheets/social_stream/documents/show/layout/_show.css.sass +112 -0
- data/app/assets/stylesheets/social_stream/documents/timeline/_audios.css.sass +21 -0
- data/app/assets/stylesheets/social_stream/documents/timeline/_wallinput.css.sass +10 -0
- data/app/assets/stylesheets/social_stream/documents/timeline/layout/_audios.css.sass +67 -0
- data/app/assets/stylesheets/social_stream/documents/timeline/layout/_wallinput.css.sass +10 -0
- data/app/assets/stylesheets/social_stream-documents.css.sass +49 -0
- data/app/controllers/documents_controller.rb +16 -5
- data/app/decorators/social_stream/base/activity_object_decorator.rb +1 -0
- data/app/helpers/documents_helper.rb +35 -18
- data/app/models/audio.rb +1 -6
- data/app/models/document.rb +23 -28
- data/app/models/picture.rb +0 -19
- data/app/models/video.rb +0 -5
- data/app/views/audios/_audio.html.erb +2 -11
- data/app/views/audios/_audio_processed.html.erb +28 -23
- data/app/views/audios/_audio_processing.html.erb +5 -5
- data/app/views/audios/_quick_search_result.html.erb +3 -0
- data/app/views/audios/_search_result.html.erb +1 -0
- data/app/views/audios/_timeline.html.erb +11 -0
- data/app/views/audios/index.html.erb +3 -1
- data/app/views/common_documents/_document.html.erb +18 -0
- data/app/views/common_documents/_filter.html.erb +1 -0
- data/app/views/common_documents/_form.html.erb +44 -0
- data/app/views/common_documents/_index.html.erb +27 -63
- data/app/views/common_documents/_info.html.erb +50 -0
- data/app/views/common_documents/_list.html.erb +2 -0
- data/app/views/common_documents/_new.modal.html.erb +13 -0
- data/app/views/common_documents/_new_button.html.erb +11 -0
- data/app/views/common_documents/_quick_search_result.html.erb +19 -0
- data/app/views/common_documents/_show.html.erb +76 -27
- data/app/views/documents/_document.html.erb +2 -26
- data/app/views/documents/_document_show.html.erb +2 -4
- data/app/views/documents/_new_activity.html.erb +3 -1
- data/app/views/documents/_quick_search_result.html.erb +3 -0
- data/app/views/documents/_search_result.html.erb +1 -0
- data/app/views/documents/_timeline.html.erb +15 -0
- data/app/views/documents/index.html.erb +7 -1
- data/app/views/documents/new.html.erb +9 -0
- data/app/views/documents/search.html.erb +1 -1
- data/app/views/pictures/_picture.html.erb +2 -41
- data/app/views/pictures/_picture_show.html.erb +1 -16
- data/app/views/pictures/_quick_search_result.html.erb +3 -0
- data/app/views/pictures/_search_result.html.erb +1 -0
- data/app/views/pictures/_timeline.html.erb +17 -0
- data/app/views/pictures/index.html.erb +3 -1
- data/app/views/videos/_quick_search_result.html.erb +3 -0
- data/app/views/videos/_search_result.html.erb +1 -0
- data/app/views/videos/_timeline.html.erb +9 -0
- data/app/views/videos/_video.html.erb +2 -11
- data/app/views/videos/_video_processed.html.erb +11 -15
- data/app/views/videos/_video_processing.html.erb +6 -5
- data/app/views/videos/_video_show.html.erb +1 -1
- data/app/views/videos/index.html.erb +3 -1
- data/config/locales/en.yml +25 -12
- data/config/locales/es.yml +23 -12
- data/lib/generators/social_stream/documents/install_generator.rb +2 -3
- data/lib/generators/social_stream/documents/templates/initializer.rb +37 -9
- data/lib/social_stream/documents/dependencies.rb +1 -0
- data/lib/social_stream/documents/engine.rb +5 -14
- data/lib/social_stream/documents/models/activity_object.rb +18 -0
- data/lib/social_stream/documents/version.rb +1 -1
- data/lib/social_stream-documents.rb +56 -13
- data/lib/tasks/db/populate.rake +21 -0
- data/social_stream-documents.gemspec +4 -1
- data/spec/controllers/documents_controller_spec.rb +15 -9
- data/spec/controllers/pictures_controller_spec.rb +8 -8
- data/spec/socialstream_documents_spec.rb +6 -0
- data/vendor/assets/stylesheets/jplayer.blue.monday.css +2 -1
- metadata +71 -74
- data/app/assets/javascripts/social_stream.repository.js.erb +0 -27
- data/app/assets/stylesheets/documents.css.scss +0 -302
- data/app/assets/stylesheets/show.css.scss +0 -111
- data/app/assets/stylesheets/social_stream-documents.css +0 -6
- data/app/views/audios/_audio_focus_search.html.erb +0 -3
- data/app/views/audios/_audio_global_search.html.erb +0 -3
- data/app/views/audios/_audio_with_details.html.erb +0 -3
- data/app/views/common_documents/_document_info.html.erb +0 -48
- data/app/views/common_documents/_edit_form.html.erb +0 -57
- data/app/views/common_documents/_headers.html.erb +0 -77
- data/app/views/documents/_document_focus_search.html.erb +0 -2
- data/app/views/documents/_document_global_search.html.erb +0 -2
- data/app/views/documents/_document_with_details.html.erb +0 -13
- data/app/views/documents/_new_activity_fields.html.erb +0 -15
- data/app/views/pictures/_picture_focus_search.html.erb +0 -2
- data/app/views/pictures/_picture_global_search.html.erb +0 -2
- data/app/views/pictures/_picture_with_details.html.erb +0 -2
- data/app/views/videos/_video_focus_search.html.erb +0 -2
- data/app/views/videos/_video_global_search.html.erb +0 -2
- data/app/views/videos/_video_with_details.html.erb +0 -2
- data/config/locales/de.yml +0 -78
- data/config/locales/fr.yml +0 -78
- data/config/locales/hu.yml +0 -77
- data/config/locales/nl.yml +0 -78
- data/lib/social_stream/views/toolbar/documents.rb +0 -28
- data/lib/tasks/db/populate_documents.rake +0 -19
- data/spec/dummy/.gitignore +0 -1
- data/spec/dummy/Rakefile +0 -7
- data/spec/dummy/app/assets/javascripts/application.js +0 -9
- data/spec/dummy/app/assets/stylesheets/application.css +0 -7
- data/spec/dummy/app/controllers/application_controller.rb +0 -3
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy/config/application.rb +0 -45
- data/spec/dummy/config/boot.rb +0 -10
- data/spec/dummy/config/database.yml +0 -25
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -30
- data/spec/dummy/config/environments/production.rb +0 -60
- data/spec/dummy/config/environments/test.rb +0 -39
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/devise.rb +0 -176
- data/spec/dummy/config/initializers/inflections.rb +0 -10
- data/spec/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy/config/initializers/secret_token.rb +0 -7
- data/spec/dummy/config/initializers/session_store.rb +0 -8
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy/config/locales/en.yml +0 -5
- data/spec/dummy/config/relations.yml +0 -39
- data/spec/dummy/config/routes.rb +0 -60
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/db/schema.rb +0 -6
- data/spec/dummy/public/404.html +0 -26
- data/spec/dummy/public/422.html +0 -26
- data/spec/dummy/public/500.html +0 -26
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/javascripts/application.js +0 -2
- data/spec/dummy/public/javascripts/controls.js +0 -965
- data/spec/dummy/public/javascripts/dragdrop.js +0 -974
- data/spec/dummy/public/javascripts/effects.js +0 -1123
- data/spec/dummy/public/javascripts/prototype.js +0 -6001
- data/spec/dummy/public/javascripts/rails.js +0 -191
- data/spec/dummy/public/stylesheets/.gitkeep +0 -0
- data/spec/dummy/script/rails +0 -6
data/config/locales/en.yml
CHANGED
@@ -3,6 +3,8 @@ en:
|
|
3
3
|
attributes:
|
4
4
|
document:
|
5
5
|
title: "Title"
|
6
|
+
models:
|
7
|
+
document: "File"
|
6
8
|
audio:
|
7
9
|
confirm_delete: "Delete audio?"
|
8
10
|
title: "Audios"
|
@@ -10,6 +12,7 @@ en:
|
|
10
12
|
name: "audio"
|
11
13
|
not_mine: "Audios"
|
12
14
|
one: "an audio"
|
15
|
+
other: "audios"
|
13
16
|
processing: "Processing audio clip. Please wait..."
|
14
17
|
title:
|
15
18
|
one: "Audio"
|
@@ -23,25 +26,39 @@ en:
|
|
23
26
|
download: "Download"
|
24
27
|
edit: "Edit"
|
25
28
|
all: "All files"
|
29
|
+
by: "by %{author}"
|
26
30
|
confirm_delete: "Delete file?"
|
31
|
+
description:
|
32
|
+
input: "Add a description here"
|
33
|
+
filter: "filter"
|
27
34
|
form:
|
28
35
|
title: "File"
|
29
36
|
info:
|
37
|
+
author: "Author"
|
30
38
|
date:
|
31
39
|
created_at: "Created at"
|
32
40
|
updated_at: "Updated at"
|
33
|
-
description:
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
title:
|
38
|
-
title: "Title"
|
41
|
+
description: "Description"
|
42
|
+
file: "File"
|
43
|
+
size: "Size"
|
44
|
+
tags: "Tags"
|
45
|
+
title: "Title"
|
39
46
|
mine: "My files"
|
40
47
|
name: "file"
|
48
|
+
new:
|
49
|
+
link: "Add file"
|
50
|
+
title: "New file"
|
51
|
+
new_activity:
|
52
|
+
attach: "Attach file"
|
41
53
|
not_mine: "Files"
|
42
54
|
one: "a file"
|
55
|
+
other: "files"
|
56
|
+
scope:
|
57
|
+
network: "Network"
|
58
|
+
own: "Own"
|
43
59
|
simple_all: "All"
|
44
60
|
title:
|
61
|
+
input: "File title"
|
45
62
|
one: "File"
|
46
63
|
other: "Files"
|
47
64
|
picture:
|
@@ -50,15 +67,10 @@ en:
|
|
50
67
|
name: "picture"
|
51
68
|
not_mine: "Pictures"
|
52
69
|
one: "a picture"
|
70
|
+
other: "pictures"
|
53
71
|
title:
|
54
72
|
one: "Picture"
|
55
73
|
other: "Pictures"
|
56
|
-
repository:
|
57
|
-
title: "Files"
|
58
|
-
order:
|
59
|
-
by: "Order by"
|
60
|
-
last_modified: "Last modified"
|
61
|
-
most_popular: "Most popular"
|
62
74
|
resource:
|
63
75
|
all: "All Resources"
|
64
76
|
confirm_delete: "Delete resource?"
|
@@ -71,6 +83,7 @@ en:
|
|
71
83
|
name: "video"
|
72
84
|
not_mine: "Videos"
|
73
85
|
one: "a video"
|
86
|
+
other: "videos"
|
74
87
|
processing: "Processing video. Please, wait..."
|
75
88
|
title:
|
76
89
|
one: "Video"
|
data/config/locales/es.yml
CHANGED
@@ -3,12 +3,15 @@ es:
|
|
3
3
|
attributes:
|
4
4
|
document:
|
5
5
|
title: "Título"
|
6
|
+
models:
|
7
|
+
document: "Fichero"
|
6
8
|
audio:
|
7
9
|
confirm_delete: "¿Borrar audios?"
|
8
10
|
mine: "Mis audios"
|
9
11
|
name: "archivo de audio"
|
10
12
|
not_mine: "Audios"
|
11
13
|
one: "un archivo de audio"
|
14
|
+
other: "audios"
|
12
15
|
processing: "Procesando fichero de audio. Espere, por favor..."
|
13
16
|
title:
|
14
17
|
one: "Audio"
|
@@ -22,25 +25,37 @@ es:
|
|
22
25
|
download: "Descargar"
|
23
26
|
edit: "Editar"
|
24
27
|
all: "Todos los ficheros"
|
28
|
+
by: "por %{author}"
|
25
29
|
confirm_delete: "¿Borrar fichero?"
|
30
|
+
description:
|
31
|
+
input: "Añade una descripción aquí"
|
32
|
+
filter: "filtrar"
|
26
33
|
form:
|
27
34
|
title: "Fichero"
|
28
35
|
info:
|
36
|
+
author: "Autor"
|
29
37
|
date:
|
30
38
|
created_at: "Creado"
|
31
39
|
updated_at: "Última modificación"
|
32
|
-
description:
|
33
|
-
|
34
|
-
|
35
|
-
title: "Subir"
|
36
|
-
title:
|
37
|
-
title: "Título"
|
40
|
+
description: "Descripción"
|
41
|
+
file: "Fichero"
|
42
|
+
title: "Título"
|
38
43
|
mine: "Mis ficheros"
|
39
44
|
name: "fichero"
|
45
|
+
new:
|
46
|
+
link: "Añadir fichero"
|
47
|
+
title: "Nuevo fichero"
|
48
|
+
new_activity:
|
49
|
+
attach: "Adjuntar fichero"
|
40
50
|
not_mine: "Ficheros"
|
41
51
|
one: "un fichero"
|
52
|
+
other: "ficheros"
|
53
|
+
scope:
|
54
|
+
network: "Red"
|
55
|
+
own: "Propios"
|
42
56
|
simple_all: "Todos"
|
43
57
|
title:
|
58
|
+
input: "Título del fichero"
|
44
59
|
one: "Fichero"
|
45
60
|
other: "Ficheros"
|
46
61
|
picture:
|
@@ -49,15 +64,10 @@ es:
|
|
49
64
|
name: "imagen"
|
50
65
|
not_mine: "Imágenes"
|
51
66
|
one: "una imagen"
|
67
|
+
other: "imagenes"
|
52
68
|
title:
|
53
69
|
one: "Imagen"
|
54
70
|
other: "Imágenes"
|
55
|
-
repository:
|
56
|
-
title: "Ficheros"
|
57
|
-
order:
|
58
|
-
by: "Ordenar por"
|
59
|
-
last_modified: "Última modificación"
|
60
|
-
most_popular: "Popularidad"
|
61
71
|
resource:
|
62
72
|
all: "Todos los recursos"
|
63
73
|
confirm_delete: "¿Borrar recursos?"
|
@@ -70,6 +80,7 @@ es:
|
|
70
80
|
name: "vídeo"
|
71
81
|
not_mine: "Vídeos"
|
72
82
|
one: "un vídeo"
|
83
|
+
other: "videos"
|
73
84
|
processing: "Procesando vídeo. Espere, por favor..."
|
74
85
|
title:
|
75
86
|
one: "Vídeo"
|
@@ -21,8 +21,7 @@ class SocialStream::Documents::InstallGenerator < Rails::Generators::Base
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def require_stylesheets
|
24
|
-
|
25
|
-
|
26
|
-
:before => ' *= require_tree .'
|
24
|
+
append_file 'app/assets/stylesheets/social_stream.css.sass',
|
25
|
+
"@import social_stream-documents\n"
|
27
26
|
end
|
28
27
|
end
|
@@ -2,16 +2,30 @@ SocialStream::Documents.setup do |config|
|
|
2
2
|
# Configure picture thumbnails
|
3
3
|
#
|
4
4
|
# config.picture_styles = {
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
# :preview => ["500>"]
|
5
|
+
# :"170x127#" => ["170x127#"],
|
6
|
+
# # this one preserves A4 proportion: 210x297
|
7
|
+
# :"80x113#" => ["80x113#"],
|
8
|
+
# :"500" => ["500>"]
|
10
9
|
# }
|
11
10
|
|
12
11
|
# Configure audio thumbnails
|
13
12
|
#
|
14
|
-
# config.audio_styles = {
|
13
|
+
# config.audio_styles = {
|
14
|
+
# webma: {
|
15
|
+
# format: 'webm',
|
16
|
+
# processors: [ :ffmpeg ]
|
17
|
+
# },
|
18
|
+
# waveform: {
|
19
|
+
# format: :png,
|
20
|
+
# convert_options: {
|
21
|
+
# color: :transparent,
|
22
|
+
# background_color: 'ffffff',
|
23
|
+
# width: 460,
|
24
|
+
# height: 75
|
25
|
+
# },
|
26
|
+
# processors: [ :waveform ]
|
27
|
+
# }
|
28
|
+
# }
|
15
29
|
|
16
30
|
# Configure video thumbnails
|
17
31
|
#
|
@@ -19,8 +33,22 @@ SocialStream::Documents.setup do |config|
|
|
19
33
|
# :webm => { :format => 'webm' },
|
20
34
|
# :flv => { :format => 'flv' },
|
21
35
|
# :mp4 => { :format => 'mp4' },
|
22
|
-
# :
|
23
|
-
#
|
24
|
-
|
36
|
+
# :"170x127#" => { :geometry => "170x127#", :format => 'png', :time => 5 }
|
37
|
+
# }
|
38
|
+
|
39
|
+
# List of mime types that have an icon defined
|
40
|
+
# config.icon_mime_types = {
|
41
|
+
# default: :default,
|
42
|
+
# types: [
|
43
|
+
# :text, :image, :audio, :video
|
44
|
+
# ],
|
45
|
+
# subtypes: [
|
46
|
+
# :txt, :ps, :pdf, :sla,
|
47
|
+
# :odt, :odp, :ods, :doc, :ppt, :xls, :rtf,
|
48
|
+
# :rar, :zip,
|
49
|
+
# :jpeg, :gif, :png, :bmp, :xcf,
|
50
|
+
# :wav, :ogg, :webma, :mpeg,
|
51
|
+
# :flv, :webm, :mp4
|
52
|
+
# ]
|
25
53
|
# }
|
26
54
|
end
|
@@ -9,7 +9,7 @@ module SocialStream
|
|
9
9
|
Mime::Type.register "application/postscript", :ps, [ "application/ps" ]
|
10
10
|
Mime::Type.register "application/vnd.oasis.opendocument.text", :odt
|
11
11
|
Mime::Type.register "application/vnd.oasis.opendocument.presentation", :odp
|
12
|
-
Mime::Type.register "application/vnd.oasis.opendocument.
|
12
|
+
Mime::Type.register "application/vnd.oasis.opendocument.spreadsheet", :ods
|
13
13
|
Mime::Type.register "application/vnd.ms-word", :doc, [ "application/msword" ]
|
14
14
|
Mime::Type.register "application/vnd.ms-powerpoint", :ppt, [ "application/mspowerpoint" ]
|
15
15
|
Mime::Type.register "application/vnd.ms-excel", :xls, [ "application/msexcel" ]
|
@@ -36,11 +36,7 @@ module SocialStream
|
|
36
36
|
Mime::Type.register "image/png", :png, [ "image/x-png" ]
|
37
37
|
end
|
38
38
|
unless defined? Mime::BMP
|
39
|
-
Mime::Type.register "image/bmp", :bmp
|
40
|
-
else
|
41
|
-
# Manually register synonym
|
42
|
-
Mime::BMP.instance_variable_get("@synonyms") << "image/x-ms-bmp"
|
43
|
-
Mime::LOOKUP["image/x-ms-bmp"] = Mime::BMP
|
39
|
+
Mime::Type.register "image/bmp", :bmp
|
44
40
|
end
|
45
41
|
|
46
42
|
# Audio
|
@@ -48,8 +44,9 @@ module SocialStream
|
|
48
44
|
Mime::Type.register "audio/x-vorbis+ogg", :ogg, [ "application/ogg" ]
|
49
45
|
Mime::Type.register "audio/webm", :webma
|
50
46
|
# These are already defined in Rails 3.2
|
51
|
-
|
52
|
-
|
47
|
+
# MPEG is currently reserved to 'video/mpeg'
|
48
|
+
unless defined? Mime::MP3
|
49
|
+
Mime::Type.register "audio/mpeg", :mp3
|
53
50
|
end
|
54
51
|
|
55
52
|
# Video
|
@@ -64,12 +61,6 @@ module SocialStream
|
|
64
61
|
SocialStream::ActivityStreams.register :audio
|
65
62
|
SocialStream::ActivityStreams.register :video
|
66
63
|
end
|
67
|
-
|
68
|
-
initializer "social_stream-documents.views.toolbar" do
|
69
|
-
SocialStream::Views::Toolbar.module_eval do
|
70
|
-
include SocialStream::Views::Toolbar::Documents
|
71
|
-
end
|
72
|
-
end
|
73
64
|
end
|
74
65
|
end
|
75
66
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module SocialStream
|
2
|
+
module Documents
|
3
|
+
module Models
|
4
|
+
module ActivityObject
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
extend ::ActivityObject::Properties::HolderMethods
|
7
|
+
|
8
|
+
included do
|
9
|
+
property_reflections SocialStream::Documents.subtypes,
|
10
|
+
source: :document,
|
11
|
+
conditions: true
|
12
|
+
end
|
13
|
+
|
14
|
+
holder_methods SocialStream::Documents.subtypes
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'social_stream/documents/dependencies'
|
2
2
|
|
3
3
|
module SocialStream
|
4
|
-
module
|
5
|
-
module
|
6
|
-
autoload :
|
4
|
+
module Documents
|
5
|
+
module Models
|
6
|
+
autoload :ActivityObject, 'social_stream/documents/models/activity_object'
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
@@ -11,30 +11,73 @@ module SocialStream
|
|
11
11
|
# Picture thumbnails
|
12
12
|
mattr_accessor :picture_styles
|
13
13
|
@@picture_styles = {
|
14
|
-
:
|
15
|
-
:
|
16
|
-
#
|
17
|
-
:
|
18
|
-
:preview => ["500>"]
|
14
|
+
:"170x127#" => ["170x127#"],
|
15
|
+
# this one preserves A4 proportion: 210x297
|
16
|
+
:"80x113#" => ["80x113#"],
|
17
|
+
:"500" => ["500>"]
|
19
18
|
}
|
20
19
|
|
21
20
|
mattr_accessor :audio_styles
|
22
|
-
@@audio_styles = {
|
21
|
+
@@audio_styles = {
|
22
|
+
webma: {
|
23
|
+
format: 'webm',
|
24
|
+
processors: [ :ffmpeg ]
|
25
|
+
},
|
26
|
+
waveform: {
|
27
|
+
format: :png,
|
28
|
+
convert_options: {
|
29
|
+
color: :transparent,
|
30
|
+
background_color: 'ffffff',
|
31
|
+
width: 460,
|
32
|
+
height: 75
|
33
|
+
},
|
34
|
+
processors: [ :waveform ]
|
35
|
+
}
|
36
|
+
}
|
23
37
|
|
24
38
|
mattr_accessor :video_styles
|
25
39
|
@@video_styles = {
|
26
40
|
:webm => { :format => 'webm' },
|
27
41
|
:flv => { :format => 'flv' },
|
28
42
|
:mp4 => { :format => 'mp4' },
|
29
|
-
:
|
30
|
-
|
31
|
-
|
43
|
+
:"170x127#" => { :geometry => "170x127#", :format => 'png', :time => 5 }
|
44
|
+
}
|
45
|
+
|
46
|
+
# List of mime types that have an icon defined
|
47
|
+
mattr_accessor :icon_mime_types
|
48
|
+
@@icon_mime_types = {
|
49
|
+
default: :default,
|
50
|
+
types: [
|
51
|
+
:text, :image, :audio, :video
|
52
|
+
],
|
53
|
+
subtypes: [
|
54
|
+
:txt, :ps, :pdf, :sla,
|
55
|
+
:odt, :odp, :ods, :doc, :ppt, :xls, :rtf,
|
56
|
+
:rar, :zip,
|
57
|
+
:jpeg, :gif, :png, :bmp, :xcf,
|
58
|
+
:wav, :ogg, :webma, :mp3,
|
59
|
+
:flv, :webm, :mp4
|
60
|
+
]
|
61
|
+
}
|
62
|
+
|
63
|
+
# Mapping between subtype classes of Document (audio, video, etc) and
|
64
|
+
# the mime_types they handle
|
65
|
+
mattr_accessor :subtype_classes_mime_types
|
66
|
+
@@subtype_classes_mime_types = {
|
67
|
+
picture: [ :jpeg, :gif, :png, :bmp, :xcf ],
|
68
|
+
audio: [ :wav, :ogg, :webma, :mp3 ],
|
69
|
+
video: [ :flv, :webm, :mp4, :mpeg ]
|
32
70
|
}
|
33
71
|
|
34
72
|
class << self
|
35
73
|
def setup
|
36
74
|
yield self
|
37
75
|
end
|
76
|
+
|
77
|
+
# The symbols for the STI classes of {Document}: [ :picture, :audio, :video ]
|
78
|
+
def subtypes
|
79
|
+
subtype_classes_mime_types.keys
|
80
|
+
end
|
38
81
|
end
|
39
82
|
|
40
83
|
# Add :document to SocialStream.objects and SocialStream.activity_forms by default
|
@@ -44,7 +87,7 @@ module SocialStream
|
|
44
87
|
SocialStream.extended_search_models.push(o) unless SocialStream.extended_search_models.include?(o)
|
45
88
|
end
|
46
89
|
|
47
|
-
%w(objects activity_forms).each do |m|
|
90
|
+
%w(objects activity_forms repository_models).each do |m|
|
48
91
|
SocialStream.__send__(m).push(:document) unless SocialStream.__send__(m).include?(:document)
|
49
92
|
end
|
50
93
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
namespace :db do
|
2
|
+
namespace :populate do
|
3
|
+
|
4
|
+
desc "Create populate data with documents"
|
5
|
+
task :create => 'create:documents'
|
6
|
+
|
7
|
+
namespace :create do
|
8
|
+
desc "Add documents to populate data"
|
9
|
+
task :documents => :read_environment do
|
10
|
+
SS_DOCS_PATH=Gem::Specification.find_by_name('social_stream-documents').full_gem_path
|
11
|
+
doc_files = Forgery::Extensions::Array.new(Dir.glob(File.join(SS_DOCS_PATH, 'lib', 'samples', "*")))
|
12
|
+
|
13
|
+
SocialStream::Population::ActivityObject.new Document do |d|
|
14
|
+
d.file = File.open(doc_files.random, "r")
|
15
|
+
d.title = Forgery::LoremIpsum.words(rand(4), :random => true)
|
16
|
+
d.description = Forgery::LoremIpsum.sentences(rand(4), :random => true)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -12,10 +12,13 @@ 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', '~>
|
15
|
+
s.add_runtime_dependency('social_stream-base', '~> 2.0.0.beta1')
|
16
16
|
s.add_runtime_dependency('paperclip','~> 3.3.0')
|
17
17
|
s.add_runtime_dependency('paperclip-ffmpeg', '~> 0.9.0')
|
18
18
|
s.add_runtime_dependency('delayed_paperclip','>= 2.4.5.2')
|
19
|
+
s.add_runtime_dependency('paperclip_waveform')
|
20
|
+
|
21
|
+
|
19
22
|
# Development Gem dependencies
|
20
23
|
s.add_development_dependency('sqlite3-ruby')
|
21
24
|
if RUBY_VERSION < '1.9'
|
@@ -16,9 +16,9 @@ describe DocumentsController do
|
|
16
16
|
|
17
17
|
it "should render receiver's index with public document included" do
|
18
18
|
get :index, :user_id => @public_document.post_activity.receiver.to_param
|
19
|
+
|
19
20
|
response.should be_success
|
20
|
-
response.body.should =~ /
|
21
|
-
response.body.should =~ /small.pdf/
|
21
|
+
response.body.should =~ /#{ controller.dom_id(@public_document) }/
|
22
22
|
end
|
23
23
|
|
24
24
|
it "should render receiver's html show" do
|
@@ -41,9 +41,9 @@ describe DocumentsController do
|
|
41
41
|
|
42
42
|
it "should render index" do
|
43
43
|
get :index, :user_id => @public_document.post_activity.receiver.to_param
|
44
|
+
|
44
45
|
response.should be_success
|
45
|
-
response.body.should =~ /
|
46
|
-
response.body.should =~ /small.pdf/
|
46
|
+
response.body.should =~ /#{ controller.dom_id(@public_document) }/
|
47
47
|
end
|
48
48
|
|
49
49
|
it "should render html show" do
|
@@ -51,7 +51,13 @@ describe DocumentsController do
|
|
51
51
|
response.should be_success
|
52
52
|
response.headers["Content-Type"].should include('text/html')
|
53
53
|
end
|
54
|
-
|
54
|
+
|
55
|
+
it "should render html new" do
|
56
|
+
get :new
|
57
|
+
response.should be_success
|
58
|
+
response.headers["Content-Type"].should include('text/html')
|
59
|
+
end
|
60
|
+
|
55
61
|
it "should render format pdf download" do
|
56
62
|
get :download, :id => @public_document.to_param, :format => :pdf
|
57
63
|
response.should be_success
|
@@ -67,9 +73,9 @@ describe DocumentsController do
|
|
67
73
|
describe "when not authenticated" do
|
68
74
|
it "should render receiver's index without private document" do
|
69
75
|
get :index, :user_id => @private_document.post_activity.receiver.to_param
|
76
|
+
|
70
77
|
response.should be_success
|
71
|
-
response.body.should_not =~ /
|
72
|
-
response.body.should_not =~ /small.pdf/
|
78
|
+
response.body.should_not =~ /#{ controller.dom_id @private_document }/
|
73
79
|
end
|
74
80
|
end
|
75
81
|
|
@@ -79,9 +85,9 @@ describe DocumentsController do
|
|
79
85
|
end
|
80
86
|
it "should render index" do
|
81
87
|
get :index, :user_id => @private_document.post_activity.receiver.to_param
|
88
|
+
|
82
89
|
response.should be_success
|
83
|
-
response.body.should_not =~ /
|
84
|
-
response.body.should_not =~ /small.pdf/
|
90
|
+
response.body.should_not =~ /#{ controller.dom_id @private_document }/
|
85
91
|
end
|
86
92
|
|
87
93
|
it "should render show" do
|
@@ -16,9 +16,9 @@ describe PicturesController do
|
|
16
16
|
|
17
17
|
it "should render receiver's index with public picture included" do
|
18
18
|
get :index, :user_id => @public_picture.post_activity.receiver.to_param
|
19
|
+
|
19
20
|
response.should be_success
|
20
|
-
response.body.should =~ /
|
21
|
-
response.body.should =~ /rails.png/
|
21
|
+
response.body.should =~ /#{ controller.dom_id @public_picture }/
|
22
22
|
end
|
23
23
|
|
24
24
|
it "should render receiver's html show" do
|
@@ -35,9 +35,9 @@ describe PicturesController do
|
|
35
35
|
|
36
36
|
it "should render index" do
|
37
37
|
get :index, :user_id => @public_picture.post_activity.receiver.to_param
|
38
|
+
|
38
39
|
response.should be_success
|
39
|
-
response.body.should =~ /
|
40
|
-
response.body.should =~ /rails.png/
|
40
|
+
response.body.should =~ /#{ controller.dom_id @public_picture }/
|
41
41
|
end
|
42
42
|
|
43
43
|
it "should render html show" do
|
@@ -56,8 +56,8 @@ describe PicturesController do
|
|
56
56
|
it "should render receiver's index without private picture" do
|
57
57
|
get :index, :user_id => @private_picture.post_activity.receiver.to_param
|
58
58
|
response.should be_success
|
59
|
-
|
60
|
-
response.body.should_not =~
|
59
|
+
|
60
|
+
response.body.should_not =~ /#{ controller.dom_id @private_picture }/
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
@@ -68,8 +68,8 @@ describe PicturesController do
|
|
68
68
|
it "should render index" do
|
69
69
|
get :index, :user_id => @private_picture.post_activity.receiver.to_param
|
70
70
|
response.should be_success
|
71
|
-
|
72
|
-
response.body.should_not =~
|
71
|
+
|
72
|
+
response.body.should_not =~ /#{ controller.dom_id @private_picture }/
|
73
73
|
end
|
74
74
|
|
75
75
|
it "should render show" do
|
@@ -4,4 +4,10 @@ describe SocialStream::Documents do
|
|
4
4
|
it "should be valid" do
|
5
5
|
SocialStream::Documents.should be_a(Module)
|
6
6
|
end
|
7
|
+
|
8
|
+
describe "subtypes" do
|
9
|
+
it "should return expected value" do
|
10
|
+
SocialStream::Documents.subtypes.should eq([ :picture, :audio, :video ])
|
11
|
+
end
|
12
|
+
end
|
7
13
|
end
|
@@ -320,6 +320,7 @@ div.jp-volume-bar-value {
|
|
320
320
|
width:0px;
|
321
321
|
height:5px;
|
322
322
|
}
|
323
|
+
//*
|
323
324
|
div.jp-current-time,
|
324
325
|
div.jp-duration {
|
325
326
|
position: absolute;
|
@@ -347,7 +348,7 @@ div.jp-video div.jp-duration {
|
|
347
348
|
left:0px;
|
348
349
|
width:98%;
|
349
350
|
padding:0 1%;
|
350
|
-
}
|
351
|
+
}*//
|
351
352
|
div.jp-playlist {
|
352
353
|
/* width:418px; */
|
353
354
|
width:100%;
|