social_stream 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. data/.gitignore +1 -0
  2. data/base/app/assets/images/arrow-end.png +0 -0
  3. data/base/app/assets/images/arrow-start.png +0 -0
  4. data/base/app/assets/images/arrow.png +0 -0
  5. data/base/app/assets/javascripts/layouts.js +0 -1
  6. data/base/app/assets/stylesheets/frontpage.css +2 -2
  7. data/base/app/assets/stylesheets/location.css +36 -0
  8. data/base/app/helpers/location_helper.rb +3 -5
  9. data/base/app/helpers/toolbar_helper.rb +5 -6
  10. data/base/app/views/avatars/index.html.erb +2 -2
  11. data/base/app/views/contacts/edit.html.erb +2 -2
  12. data/base/app/views/conversations/_show.html.erb +2 -2
  13. data/base/app/views/conversations/index.html.erb +1 -3
  14. data/base/app/views/devise/registrations/edit.html.erb +1 -1
  15. data/base/app/views/frontpage/_header.html.erb +1 -1
  16. data/base/app/views/home/index.html.erb +1 -2
  17. data/base/app/views/invitation_mailer/send_invitation.html.erb +1 -1
  18. data/base/app/views/invitation_mailer/send_invitation.text.erb +2 -2
  19. data/base/app/views/invitations/new.html.erb +1 -1
  20. data/base/app/views/layouts/_footer.html.erb +1 -1
  21. data/base/app/views/layouts/_header.erb +1 -1
  22. data/base/app/views/layouts/application.html.erb +1 -1
  23. data/base/app/views/layouts/frontpage.html.erb +1 -1
  24. data/base/app/views/location/_location_body.html.erb +18 -0
  25. data/base/app/views/message_mailer/new_message_email.html.erb +2 -2
  26. data/base/app/views/message_mailer/new_message_email.text.erb +1 -1
  27. data/base/app/views/message_mailer/reply_message_email.html.erb +2 -2
  28. data/base/app/views/message_mailer/reply_message_email.text.erb +1 -1
  29. data/base/app/views/messages/new.html.erb +2 -2
  30. data/base/app/views/profiles/edit.html.erb +6 -6
  31. data/base/app/views/profiles/show.html.erb +1 -2
  32. data/base/app/views/users/index.html.erb +1 -1
  33. data/base/app/views/users/show.html.erb +1 -2
  34. data/base/config/locales/en.yml +7 -6
  35. data/base/lib/social_stream-base.rb +4 -1
  36. data/base/lib/social_stream/base.rb +6 -0
  37. data/base/lib/social_stream/base/version.rb +1 -1
  38. data/base/lib/social_stream/toolbar_config/base.rb +87 -0
  39. data/base/lib/tasks/workers.rake +163 -0
  40. data/documents/app/assets/stylesheets/documents.css +5 -0
  41. data/documents/app/models/audio.rb +2 -7
  42. data/documents/app/models/video.rb +2 -7
  43. data/documents/app/views/audios/_audio.html.erb +7 -42
  44. data/documents/app/views/audios/_audio_processed.html.erb +47 -0
  45. data/documents/app/views/audios/_audio_processing.html.erb +7 -0
  46. data/documents/app/views/common-documents/_index.html.erb +3 -3
  47. data/documents/app/views/videos/_video.html.erb +5 -46
  48. data/documents/app/views/videos/_video_processed.html.erb +49 -0
  49. data/documents/app/views/videos/_video_processing.html.erb +7 -0
  50. data/documents/config/locales/en.yml +2 -0
  51. data/documents/db/migrate/20110922173707_add_file_processing_to_document.rb +9 -0
  52. data/documents/lib/social_stream-documents.rb +5 -0
  53. data/documents/lib/social_stream/documents/engine.rb +5 -0
  54. data/documents/lib/social_stream/toolbar_config/documents.rb +40 -0
  55. data/documents/social_stream-documents.gemspec +2 -0
  56. data/events/lib/social_stream-events.rb +6 -1
  57. data/events/lib/social_stream/events/engine.rb +5 -2
  58. data/events/lib/social_stream/toolbar_config/events.rb +40 -0
  59. data/lib/social_stream/version.rb +1 -1
  60. data/social_stream.gemspec +1 -1
  61. data/social_stream.thor +110 -0
  62. metadata +22 -33
  63. data/base/lib/social_stream/toolbar_config.rb +0 -99
  64. data/events/app/views/users/index.html.erb +0 -46
  65. data/spec/dummy/documents/pictures/000/000/009/original.png +0 -0
  66. data/spec/dummy/documents/pictures/000/000/009/thumb.png +0 -0
  67. data/spec/dummy/documents/pictures/000/000/009/thumb0.png +0 -0
  68. data/spec/dummy/documents/pictures/000/000/010/original.png +0 -0
  69. data/spec/dummy/documents/pictures/000/000/010/thumb.png +0 -0
  70. data/spec/dummy/documents/pictures/000/000/010/thumb0.png +0 -0
  71. data/spec/dummy/documents/pictures/000/000/011/original.png +0 -0
  72. data/spec/dummy/documents/pictures/000/000/011/thumb.png +0 -0
  73. data/spec/dummy/documents/pictures/000/000/011/thumb0.png +0 -0
  74. data/spec/dummy/documents/pictures/000/000/012/original.png +0 -0
  75. data/spec/dummy/documents/pictures/000/000/012/thumb.png +0 -0
  76. data/spec/dummy/documents/pictures/000/000/012/thumb0.png +0 -0
  77. data/spec/dummy/documents/pictures/000/000/013/original.png +0 -0
  78. data/spec/dummy/documents/pictures/000/000/013/thumb.png +0 -0
  79. data/spec/dummy/documents/pictures/000/000/013/thumb0.png +0 -0
  80. data/spec/dummy/documents/pictures/000/000/014/original.png +0 -0
  81. data/spec/dummy/documents/pictures/000/000/014/thumb.png +0 -0
  82. data/spec/dummy/documents/pictures/000/000/014/thumb0.png +0 -0
  83. data/spec/dummy/documents/pictures/000/000/015/original.png +0 -0
  84. data/spec/dummy/documents/pictures/000/000/015/thumb.png +0 -0
  85. data/spec/dummy/documents/pictures/000/000/015/thumb0.png +0 -0
  86. data/spec/dummy/documents/pictures/000/000/016/original.png +0 -0
  87. data/spec/dummy/documents/pictures/000/000/016/thumb.png +0 -0
  88. data/spec/dummy/documents/pictures/000/000/016/thumb0.png +0 -0
@@ -0,0 +1,7 @@
1
+ <div class="attachment_thumb">
2
+ <%= thumb_for(audio, 16) %>
3
+ </div>
4
+ <div class="attachment_text">
5
+ <%= t('audio.msg') %><%= "\""+audio.file_file_name+"\"" %>
6
+ <div class="processing_text"><%= t('audio.processing')%></div>
7
+ </div>
@@ -8,13 +8,13 @@
8
8
 
9
9
  <%if profile_subject_is_current?%>
10
10
  <%= location(
11
- link_to(image_tag(("btn/btn_#{controller.controller_name.singularize}.png"), :class => "menu_icon")+t(controller.controller_name.singularize + '.title'), polymorphic_path(controller.controller_name),:remote => true)
11
+ link_to(t(controller.controller_name.singularize + '.title'), polymorphic_path(controller.controller_name),:remote => true)
12
12
  ) %>
13
13
  <% toolbar %>
14
14
  <%else%>
15
15
  <%= location(
16
- link_to(image_tag("btn/btn_profile.png", :class => "menu_icon")+ profile_subject.name, polymorphic_path(profile_subject),:remote => true),
17
- link_to(image_tag(("btn/btn_#{controller.controller_name.singularize}.png"), :class => "menu_icon")+t(controller.controller_name.singularize + '.title'), polymorphic_path([profile_subject, controller.controller_name]),:remote => true)
16
+ link_to(profile_subject.name, polymorphic_path(profile_subject),:remote => true),
17
+ link_to(t(controller.controller_name.singularize + '.title'), polymorphic_path([profile_subject, controller.controller_name]),:remote => true)
18
18
  ) %>
19
19
  <% toolbar :profile => profile_subject %>
20
20
  <%end%>
@@ -20,51 +20,10 @@
20
20
 
21
21
  <%= div_for video, :class => 'content_size' do %>
22
22
 
23
- <div class="attachment_thumb">
24
- <%= link_to thumb_for(video, 16),
25
- {:controller => "documents", :action => "download", :id => video},
26
- :class => "" %>
27
- </div>
28
-
29
- <div class="attachment_text">
30
- <%= t('video.msg') %><%= link_to "\""+video.file_file_name+"\"",
31
- {:controller => "documents", :action => "download", :id => video},
32
- :class => "attachment_text_link" %>
33
-
34
- <div id="video_thumbnail_<%=video.id%>" class="video_thumbnail_class">
35
- <%=image_tag(video_path(video)+"?style=thumb", :class => "video_thumbnail_image")%>
36
- <div id="<%=video.id%>" class="video_thumbnail_play_over"></div>
37
- </div>
38
-
39
-
40
- <div id="full_video_<%=video.id%>" class="jp-video jp-video-270p">
41
- <div class="jp-type-single">
42
- <div id="jpId<%=video.id%>" class="jp-jplayer"></div>
43
- <div id="jp_interface_<%=video.id%>" class="jp-interface">
44
- <div class="jp-video-play"></div>
45
- <ul class="jp-controls">
46
- <li><a href="#" class="jp-play" tabindex="1">play</a></li>
47
- <li><a href="#" class="jp-pause" tabindex="1">pause</a></li>
48
- <li><a href="#" class="jp-stop" tabindex="1">stop</a></li>
49
- <li><a href="#" class="jp-mute" tabindex="1">mute</a></li>
50
- <li><a href="#" class="jp-unmute" tabindex="1">unmute</a></li>
51
- </ul>
52
- <div class="jp-progress">
53
- <div class="jp-seek-bar">
54
- <div class="jp-play-bar"></div>
55
- </div>
56
- </div>
57
- <div class="jp-volume-bar">
58
- <div class="jp-volume-bar-value"></div>
59
- </div>
60
- <div class="jp-current-time"></div>
61
- <div class="jp-duration"></div>
62
- </div>
63
- <div id="jp_playlist_<%=video.id%>" class="jp-playlist">
64
- </div>
65
- </div>
66
- </div>
67
-
68
- </div>
23
+ <% if video.file_processing %>
24
+ <%= render :partial => 'videos/video_processing', :locals => {:video => video}%>
25
+ <% else %>
26
+ <%= render :partial => 'videos/video_processed', :locals => {:video => video}%>
27
+ <% end %>
69
28
 
70
29
  <% end %>
@@ -0,0 +1,49 @@
1
+ <div class="attachment_thumb">
2
+ <%= link_to thumb_for(video, 16),
3
+ {:controller => "documents", :action => "download", :id => video},
4
+ :class => "" %>
5
+ </div>
6
+ <div class="attachment_text">
7
+ <%= t('video.msg') %><%= link_to "\""+video.file_file_name+"\"",
8
+ {:controller => "documents", :action => "download", :id => video},
9
+ :class => "attachment_text_link" %>
10
+ <div id="video_thumbnail_<%= video.id%>" class="video_thumbnail_class">
11
+ <%= image_tag(video_path(video)+"?style=thumb", :class => "video_thumbnail_image")%> <div id="<%= video.id%>" class="video_thumbnail_play_over"></div>
12
+ </div>
13
+ <div id="full_video_<%= video.id%>" class="jp-video jp-video-270p">
14
+ <div class="jp-type-single">
15
+ <div id="jpId<%= video.id%>" class="jp-jplayer"></div>
16
+ <div id="jp_interface_<%= video.id%>" class="jp-interface">
17
+ <div class="jp-video-play"></div>
18
+ <ul class="jp-controls">
19
+ <li>
20
+ <a href="#" class="jp-play" tabindex="1">play</a>
21
+ </li>
22
+ <li>
23
+ <a href="#" class="jp-pause" tabindex="1">pause</a>
24
+ </li>
25
+ <li>
26
+ <a href="#" class="jp-stop" tabindex="1">stop</a>
27
+ </li>
28
+ <li>
29
+ <a href="#" class="jp-mute" tabindex="1">mute</a>
30
+ </li>
31
+ <li>
32
+ <a href="#" class="jp-unmute" tabindex="1">unmute</a>
33
+ </li>
34
+ </ul>
35
+ <div class="jp-progress">
36
+ <div class="jp-seek-bar">
37
+ <div class="jp-play-bar"></div>
38
+ </div>
39
+ </div>
40
+ <div class="jp-volume-bar">
41
+ <div class="jp-volume-bar-value"></div>
42
+ </div>
43
+ <div class="jp-current-time"></div>
44
+ <div class="jp-duration"></div>
45
+ </div>
46
+ <div id="jp_playlist_<%= video.id%>" class="jp-playlist"></div>
47
+ </div>
48
+ </div>
49
+ </div>
@@ -0,0 +1,7 @@
1
+ <div class="attachment_thumb">
2
+ <%= thumb_for(video, 16) %>
3
+ </div>
4
+ <div class="attachment_text">
5
+ <%= t('video.msg') %><%= "\""+video.file_file_name+"\"" %>
6
+ <div class="processing_text"><%= t('video.processing')%></div>
7
+ </div>
@@ -5,6 +5,7 @@ en:
5
5
  mine: "My audios"
6
6
  msg: "Uploaded an audio:"
7
7
  not_mine: "Audios"
8
+ processing: "Processing audio clip"
8
9
  conference:
9
10
  all: "All conferences"
10
11
  confirm_delete: "Delete conference?"
@@ -41,3 +42,4 @@ en:
41
42
  mine: "My videos"
42
43
  msg: "Uploaded a video:"
43
44
  not_mine: "Videos"
45
+ processing: "Processing video"
@@ -0,0 +1,9 @@
1
+ class AddFileProcessingToDocument < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :documents, :file_processing, :boolean
4
+ end
5
+
6
+ def self.down
7
+ remove_column :documents, :file_processing
8
+ end
9
+ end
@@ -1,6 +1,11 @@
1
1
  require 'social_stream-base'
2
+ require 'delayed_paperclip'
2
3
 
3
4
  module SocialStream
5
+ module ToolbarConfig
6
+ autoload :Documents, 'social_stream/toolbar_config/documents'
7
+ end
8
+
4
9
  module Documents
5
10
  # Add :document to SocialStream.objects and SocialStream.activity_forms by default
6
11
  # It can be configured by users at application's config/initializers/social_stream.rb
@@ -34,6 +34,11 @@ module SocialStream
34
34
  Mime::Type.register "video/x-flv", :flv
35
35
  end
36
36
 
37
+ initializer "social_stream-documents.toolbar_config" do
38
+ SocialStream::ToolbarConfig.module_eval do
39
+ include SocialStream::ToolbarConfig::Documents
40
+ end
41
+ end
37
42
  end
38
43
  end
39
44
  end
@@ -0,0 +1,40 @@
1
+ module SocialStream
2
+ module ToolbarConfig
3
+ module Documents
4
+ def home_toolbar_items
5
+ items = super
6
+
7
+ # FIXME: insert
8
+ items << {
9
+ :key => :resources,
10
+ :name => image_tag("btn/btn_resource.png",:class =>"menu_icon")+t('resource.mine'),
11
+ :url => "#",
12
+ :options => {:link => {:id => "resources_menu"}},
13
+ :items => [
14
+ {:key => :resources_documents,:name => image_tag("btn/btn_document.png")+t('document.title'),:url => documents_path},
15
+ {:key => :resources_pictures,:name => image_tag("btn/btn_gallery.png")+t('picture.title'),:url => pictures_path},
16
+ {:key => :resources_videos,:name => image_tag("btn/btn_video.png")+t('video.title'),:url => videos_path},
17
+ {:key => :resources_audios,:name => image_tag("btn/btn_audio.png")+t('audio.title'),:url => audios_path}
18
+ ]
19
+ }
20
+ end
21
+
22
+ def profile_toolbar_items(subject = current_subject)
23
+ items = super
24
+
25
+ items << {
26
+ :key => :resources,
27
+ :name => image_tag("btn/btn_resource.png",:class =>"menu_icon")+t("resource.#{ subject == current_subject ? 'mine' : 'title' }"),
28
+ :url => "#",
29
+ :options => {:link => {:id => "resources_menu"}},
30
+ :items => [
31
+ {:key => :resources_documents,:name => image_tag("btn/btn_document.png")+t('document.title'),:url => polymorphic_path([subject, Document.new])},
32
+ {:key => :resources_pictures,:name => image_tag("btn/btn_gallery.png")+t('picture.title'),:url => polymorphic_path([subject, Picture.new])},
33
+ {:key => :resources_videos,:name => image_tag("btn/btn_video.png")+t('video.title'),:url => polymorphic_path([subject, Video.new])},
34
+ {:key => :resources_audios,:name => image_tag("btn/btn_audio.png")+t('audio.title'),:url => polymorphic_path([subject, Audio.new])}
35
+ ]
36
+ }
37
+ end
38
+ end
39
+ end
40
+ end
@@ -1,3 +1,4 @@
1
+ # encoding: UTF-8
1
2
  Gem::Specification.new do |s|
2
3
  s.name = "social_stream-documents"
3
4
  s.version = "0.2.6"
@@ -12,6 +13,7 @@ Gem::Specification.new do |s|
12
13
  s.add_runtime_dependency('social_stream-base','>= 0.9.2')
13
14
  s.add_runtime_dependency('paperclip-ffmpeg', '~> 0.7.0')
14
15
  s.add_runtime_dependency('paperclip','2.3.11')
16
+ s.add_runtime_dependency('delayed_paperclip','>= 0.7.2')
15
17
  # Development Gem dependencies
16
18
  s.add_development_dependency('sqlite3-ruby')
17
19
  if RUBY_VERSION < '1.9'
@@ -1,8 +1,13 @@
1
1
  require 'social_stream-base'
2
2
 
3
3
  module SocialStream
4
+ module ToolbarConfig
5
+ autoload :Events, 'social_stream/toolbar_config/events'
6
+ end
7
+
4
8
  module Events
5
- # Add :document to SocialStream.objects and SocialStream.activity_forms by default
9
+ # Add :event, :agenda, :session to SocialStream.objects and SocialStream.activity_forms
10
+ # by default
6
11
  # It can be configured by users at application's config/initializers/social_stream.rb
7
12
  [:event, :agenda, :session].each do |o|
8
13
  SocialStream.objects.push(o) unless SocialStream.objects.include?(o)
@@ -1,8 +1,11 @@
1
1
  module SocialStream
2
2
  module Events
3
3
  class Engine < Rails::Engine
4
-
5
-
4
+ initializer "social_stream-events.toolbar_config" do
5
+ SocialStream::ToolbarConfig.module_eval do
6
+ include SocialStream::ToolbarConfig::Events
7
+ end
8
+ end
6
9
  end
7
10
  end
8
11
  end
@@ -0,0 +1,40 @@
1
+ module SocialStream
2
+ module ToolbarConfig
3
+ module Events
4
+ def home_toolbar_items
5
+ items = super
6
+
7
+ items.find{ |i| i[:key] == :resources }[:items].unshift({
8
+ :key => :resources_events,
9
+ :name => image_tag("btn/btn_event.png")+t('conference.title'),
10
+ :url => events_path
11
+ })
12
+
13
+ items
14
+ end
15
+
16
+ def profile_toolbar_items(subject = current_subject)
17
+ items = super
18
+
19
+ items.find{ |i| i[:key] == :resources }[:items].unshift({
20
+ :key => :resources_events,
21
+ :name => image_tag("btn/btn_event.png")+t('conference.title'),
22
+ :url => polymorphic_path([subject, Event.new])
23
+ })
24
+
25
+ if SocialStream.activity_forms.include?(:event) &&
26
+ subject.is_a?(Event) &&
27
+ subject.agenda.present?
28
+
29
+ items.insert(1, {
30
+ :key => :outline_info,
31
+ :name => image_tag("btn/btn_outline.png")+t('menu.outline'),
32
+ :url => agenda_path(subject)
33
+ })
34
+ end
35
+
36
+ items
37
+ end
38
+ end
39
+ end
40
+ end
@@ -1,3 +1,3 @@
1
1
  module SocialStream
2
- VERSION = "0.9.2".freeze
2
+ VERSION = "0.9.3".freeze
3
3
  end
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.files = `git ls-files`.split("\n")
12
12
 
13
13
  # Gem dependencies
14
- s.add_runtime_dependency('social_stream-base', '~> 0.9.3')
14
+ s.add_runtime_dependency('social_stream-base', '~> 0.9.7')
15
15
  s.add_runtime_dependency('social_stream-documents', '~> 0.2.6')
16
16
 
17
17
  # Development Gem dependencies
@@ -0,0 +1,110 @@
1
+ # SocialStream release tasks
2
+ class SocialStream < Thor
3
+ include Thor::Actions
4
+
5
+ # Manage component's version files
6
+ #
7
+ # This code is based on gem_release's version_file.rb
8
+ # https://github.com/svenfuchs/gem-release
9
+ #
10
+ # Copyright (c) 2010 Sven Fuchs <svenfuchs@artweb-design.de>
11
+ class VersionFile
12
+ VERSION_PATTERN = /(VERSION\s*=\s*(?:"|'))(\d+\.\d+\.\d+)("|')/
13
+ NUMBER_PATTERN = /(\d+)\.(\d+)\.(\d+)/
14
+
15
+ attr_reader :component, :target
16
+
17
+ def initialize(arg = "")
18
+ @component, @target = arg.split(":")
19
+ @target ||= :patch
20
+ end
21
+
22
+ def bump!
23
+ # Must load content before writing to it
24
+ content
25
+
26
+ File.open(filename, 'w+') { |f| f.write(bumped_content) }
27
+
28
+ commit
29
+
30
+ [ component, new_number ]
31
+ end
32
+
33
+ def new_number
34
+ @new_number ||= old_number.sub(NUMBER_PATTERN) do
35
+ respond_to?(target) ? send(target, $1, $2, $3) : target
36
+ end
37
+ end
38
+
39
+ def old_number
40
+ @old_number ||= content =~ VERSION_PATTERN && $2
41
+ end
42
+
43
+ def filename
44
+ component ?
45
+ "#{ component }/lib/social_stream/#{ component }/version.rb" :
46
+ "lib/social_stream/version.rb"
47
+ end
48
+
49
+ def commit
50
+ files = filename
51
+ files += " social_stream.gemspec" if component.nil?
52
+
53
+ system "git commit #{ files } -m #{ component }#{ new_number }"
54
+ end
55
+
56
+ protected
57
+
58
+ def major(major, minor, patch)
59
+ "#{major.to_i + 1}.0.0"
60
+ end
61
+
62
+ def minor(major, minor, patch)
63
+ "#{major}.#{minor.to_i + 1}.0"
64
+ end
65
+
66
+ def patch(major, minor, patch)
67
+ "#{major}.#{minor}.#{patch.to_i + 1}"
68
+ end
69
+
70
+ def content
71
+ @content ||= File.read(filename)
72
+ end
73
+
74
+ def bumped_content
75
+ content.sub(VERSION_PATTERN) { "#{$1}#{new_number}#{$3}" }
76
+ end
77
+ end
78
+
79
+
80
+ desc "release", "release SocialStream's gems"
81
+ def release(*components)
82
+ component_releases = components.map{ |c| release_component(c) }
83
+
84
+ update_components(component_releases)
85
+
86
+ VersionFile.new.bump!
87
+
88
+ system "rake release"
89
+ end
90
+
91
+ private
92
+
93
+ def release_component(component)
94
+ component, version = VersionFile.new(component).bump!
95
+
96
+ system "cd #{ component } && rake release"
97
+
98
+ [ component, version ]
99
+ end
100
+
101
+ def update_components(releases)
102
+ releases.each do |r|
103
+ component, version = r
104
+
105
+ gsub_file 'social_stream.gemspec',
106
+ /social_stream-#{ component }.*(\d+\.\d+\.\d+)/,
107
+ "social_stream-#{ component }', '~> #{ version }"
108
+ end
109
+ end
110
+ end