social_stream-documents 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +3 -13
- data/app/assets/javascripts/documents.js.erb +21 -32
- data/app/assets/javascripts/social_stream-documents.js +2 -1
- data/app/assets/stylesheets/{documents.css → documents.css.scss} +32 -6
- data/app/assets/stylesheets/show.css.scss +75 -0
- data/app/assets/stylesheets/social_stream-documents.css +2 -1
- data/app/controllers/audios_controller.rb +0 -14
- data/app/controllers/common_documents_controller.rb +6 -3
- data/app/controllers/documents_controller.rb +9 -3
- data/app/controllers/pictures_controller.rb +0 -1
- data/app/controllers/videos_controller.rb +0 -15
- data/app/helpers/documents_helper.rb +11 -7
- data/app/models/audio.rb +1 -1
- data/app/models/document.rb +9 -5
- data/app/models/picture.rb +1 -1
- data/app/models/video.rb +8 -6
- data/app/views/audios/_audio.html.erb +2 -2
- data/app/views/audios/_audio_processed.html.erb +4 -4
- data/app/views/audios/_audio_show.html.erb +62 -0
- data/app/views/audios/index.html.erb +1 -1
- data/app/views/audios/show.html.erb +2 -2
- data/app/views/common_documents/_document_info.html.erb +34 -0
- data/app/views/common_documents/_index.html.erb +49 -0
- data/app/views/common_documents/_show.html.erb +36 -0
- data/app/views/documents/_document.html.erb +2 -6
- data/app/views/documents/_document_show.html.erb +7 -0
- data/app/views/documents/index.html.erb +1 -1
- data/app/views/documents/show.html.erb +2 -2
- data/app/views/pictures/_picture.html.erb +13 -12
- data/app/views/pictures/_picture_show.html.erb +26 -0
- data/app/views/pictures/index.html.erb +1 -1
- data/app/views/pictures/show.html.erb +2 -2
- data/app/views/videos/_video.html.erb +2 -2
- data/app/views/videos/_video_processed.html.erb +4 -3
- data/app/views/videos/_video_show.html.erb +64 -0
- data/app/views/videos/index.html.erb +1 -1
- data/app/views/videos/show.html.erb +2 -2
- data/config/locales/en.yml +19 -1
- data/config/locales/es.yml +18 -0
- data/lib/social_stream/documents/engine.rb +2 -0
- data/lib/social_stream/documents/version.rb +1 -1
- data/social_stream-documents.gemspec +1 -1
- data/spec/controllers/documents_controller_spec.rb +40 -2
- data/spec/controllers/pictures_controller_spec.rb +4 -4
- data/spec/dummy/config/environments/development.rb +0 -1
- data/spec/dummy/config/environments/test.rb +2 -0
- metadata +37 -31
- data/app/views/common-documents/_index.html.erb +0 -45
- data/app/views/toolbar/_uploads_menu.html.erb +0 -21
data/Rakefile
CHANGED
@@ -1,33 +1,23 @@
|
|
1
1
|
# encoding: UTF-8
|
2
|
-
require '
|
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
|
2
|
+
require 'bundler/gem_tasks'
|
8
3
|
|
9
|
-
require '
|
10
|
-
require 'rake/rdoctask'
|
4
|
+
require 'rdoc/task'
|
11
5
|
|
12
6
|
require 'rspec/core'
|
13
7
|
require 'rspec/core/rake_task'
|
14
8
|
|
15
|
-
require 'bundler'
|
16
|
-
|
17
9
|
RSpec::Core::RakeTask.new(:spec)
|
18
10
|
|
19
11
|
task :default => :spec
|
20
12
|
|
21
13
|
Rake::RDocTask.new(:rdoc) do |rdoc|
|
22
14
|
rdoc.rdoc_dir = 'rdoc'
|
23
|
-
rdoc.title = '
|
15
|
+
rdoc.title = 'SocialStream Documents'
|
24
16
|
rdoc.options << '--line-numbers' << '--inline-source'
|
25
17
|
rdoc.rdoc_files.include('README.rdoc')
|
26
18
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
27
19
|
end
|
28
20
|
|
29
|
-
Bundler::GemHelper.install_tasks
|
30
|
-
|
31
21
|
# Modify this gem's tags
|
32
22
|
class Bundler::GemHelper
|
33
23
|
def version_tag
|
@@ -1,35 +1,3 @@
|
|
1
|
-
$('.attachment_tile a, .picture_link a').live("click",function(e){
|
2
|
-
if(this.type ==""){
|
3
|
-
return true;
|
4
|
-
}
|
5
|
-
e.preventDefault();
|
6
|
-
|
7
|
-
var download_link = this;
|
8
|
-
|
9
|
-
/*
|
10
|
-
if($('.player').length > 0 && $('.attachment_tile.selected').length==1){
|
11
|
-
removePlayers();
|
12
|
-
return;
|
13
|
-
}
|
14
|
-
*/
|
15
|
-
if(this.type == "Audio"){
|
16
|
-
removePlayers();
|
17
|
-
$(this).parent().parent().addClass("selected");
|
18
|
-
$('body').append("<audio class='player' autoplay='autoplay' id='audio_player' src='"+this+"' controls='controls'></audio>");
|
19
|
-
$('body').append("<a href='"+download_link+"'><img id='downloadButton' src='<%= asset_path "16/default.png" %>' /></a>");
|
20
|
-
return;
|
21
|
-
}
|
22
|
-
if(this.type == "Video"){
|
23
|
-
removePlayers();
|
24
|
-
$(this).parent().parent().addClass("selected");
|
25
|
-
var show = (this+"").split('/download')[0];
|
26
|
-
show = show.replace("documents","videos");
|
27
|
-
$('body').append("<video class='player' autoplay='autoplay' id='video_player' src='"+show+"?style=webm' controls='controls'></video>");
|
28
|
-
$('body').append("<a href='"+download_link+"'><img id='downloadButton' src='<%= asset_path "16/default.png" %>' /></a>");
|
29
|
-
return;
|
30
|
-
}
|
31
|
-
});
|
32
|
-
|
33
1
|
function removePlayers(){
|
34
2
|
$('.attachment_tile').removeClass("selected");
|
35
3
|
$('.player').remove();
|
@@ -59,3 +27,24 @@ $(".video_thumbnail_play_over").livequery("click",function(){
|
|
59
27
|
$(this).parent().hide();
|
60
28
|
$("#jpId"+the_id).jPlayer("play", 0);
|
61
29
|
});
|
30
|
+
|
31
|
+
$(document).ready(function(){
|
32
|
+
//if there are 6 or more commments we only show the last 5 and a link to show the rest
|
33
|
+
$("#document_comments .activity_comments").each(function(){
|
34
|
+
var comments = $(this).children(".subactivity");
|
35
|
+
if (comments.size() > 5){
|
36
|
+
$(this).prepend("<div class='hide_show_comments'><a href='#' onclick='showAllDocumentComments(\""+
|
37
|
+
$(this).attr('id') +"\"); return false;'><%= I18n.t('comment.view_all') %> (" +
|
38
|
+
comments.size() + ")</a></div><div class='space_comments'></div>");
|
39
|
+
comments.slice(0,comments.size()-5).hide();
|
40
|
+
//hide alto space_comments
|
41
|
+
$(this).children(".space_comments").slice(0,comments.size()-5).hide();
|
42
|
+
}
|
43
|
+
});
|
44
|
+
});
|
45
|
+
|
46
|
+
showAllDocumentComments = function(id){
|
47
|
+
$("#"+id).children().show("slow");
|
48
|
+
//and hide the hide_show_comments
|
49
|
+
$("#"+id).children(".hide_show_comments").hide();
|
50
|
+
};
|
@@ -1,3 +1,5 @@
|
|
1
|
+
@import "colors";
|
2
|
+
|
1
3
|
.attachment
|
2
4
|
{
|
3
5
|
padding-top: 10px;
|
@@ -57,19 +59,25 @@
|
|
57
59
|
}
|
58
60
|
|
59
61
|
.attachment_tile{
|
60
|
-
margin:
|
61
|
-
|
62
|
-
|
63
|
-
height: 65px;
|
62
|
+
margin: 5px;
|
63
|
+
width: 90px;
|
64
|
+
height: 70px;
|
64
65
|
border-bottom: 2px solid transparent;
|
65
66
|
float: left;
|
66
67
|
text-align: center;
|
67
68
|
overflow: hidden;
|
69
|
+
border: 1px solid transparent;
|
70
|
+
padding: 5px;
|
71
|
+
}
|
72
|
+
|
73
|
+
.attachment_tile img{
|
74
|
+
width: 48px;
|
75
|
+
height: 48px;
|
68
76
|
}
|
69
77
|
|
78
|
+
|
70
79
|
.attachment_tile:hover{
|
71
|
-
|
72
|
-
border-bottom: 2px solid #2A3890;
|
80
|
+
border: 1px solid $main-color;
|
73
81
|
}
|
74
82
|
|
75
83
|
.attachment_tile.selected{
|
@@ -87,6 +95,24 @@
|
|
87
95
|
background-color: #e0edf2;
|
88
96
|
}
|
89
97
|
|
98
|
+
#repository_filter {
|
99
|
+
margin-left: 10px;
|
100
|
+
}
|
101
|
+
|
102
|
+
#repository_filter #order_by{
|
103
|
+
margin: 5px 5px 5px 15px;
|
104
|
+
}
|
105
|
+
|
106
|
+
#repository_filter input {
|
107
|
+
padding: 0 3px 0 22px;
|
108
|
+
background: url('btn/search_icon.png') 5px 50% no-repeat white;
|
109
|
+
font-size: 11px;
|
110
|
+
color: $main-color;
|
111
|
+
border: solid 1px $input-border-color;
|
112
|
+
height: 25px;
|
113
|
+
width: 200px;
|
114
|
+
}
|
115
|
+
|
90
116
|
.player{
|
91
117
|
position: fixed;
|
92
118
|
border-left: 24px solid #2A3890;
|
@@ -0,0 +1,75 @@
|
|
1
|
+
@import "colors";
|
2
|
+
|
3
|
+
.picture.content_size .picture_show img{
|
4
|
+
max-width: 500px;
|
5
|
+
max-height: 500px;
|
6
|
+
margin-left: 30px;
|
7
|
+
border: 2px solid black;
|
8
|
+
-moz-border-radius: 5px;
|
9
|
+
-webkit-border-radius: 5px;
|
10
|
+
border-radius: 5px;
|
11
|
+
}
|
12
|
+
|
13
|
+
.video_show div.jp-video-270p{
|
14
|
+
padding-left: 40px;
|
15
|
+
}
|
16
|
+
.audio_show div.jp-audio{
|
17
|
+
padding-left: 40px;
|
18
|
+
}
|
19
|
+
.document_show{
|
20
|
+
padding-left: 40px;
|
21
|
+
}
|
22
|
+
|
23
|
+
#document_info .details{
|
24
|
+
color: $details-color;
|
25
|
+
}
|
26
|
+
#document_info #dates, #document_info #date_labels{
|
27
|
+
display: inline-block;
|
28
|
+
}
|
29
|
+
|
30
|
+
#document_info {
|
31
|
+
margin-top: 10px;
|
32
|
+
}
|
33
|
+
#document_info .right, #document_info .left{
|
34
|
+
}
|
35
|
+
#document_info .right{
|
36
|
+
float: right;
|
37
|
+
margin-right: 30px;
|
38
|
+
}
|
39
|
+
#document_info .left{
|
40
|
+
float: left;
|
41
|
+
margin-left: 30px;
|
42
|
+
}
|
43
|
+
#document_info #actions{
|
44
|
+
margin-top: 10px;
|
45
|
+
margin-left: 30px;
|
46
|
+
}
|
47
|
+
#document_info #actions .action{
|
48
|
+
margin-right: 10px;
|
49
|
+
}
|
50
|
+
#document_info #actions .action img{
|
51
|
+
width: 16px;
|
52
|
+
height: 16px;
|
53
|
+
}
|
54
|
+
|
55
|
+
#document_comments {
|
56
|
+
margin-top: 20px;
|
57
|
+
padding-top: 10px;
|
58
|
+
border-top: thin solid $separation-color;
|
59
|
+
}
|
60
|
+
|
61
|
+
#document_comments .new_comment.new_comment_shown {
|
62
|
+
width: 500px;
|
63
|
+
}
|
64
|
+
|
65
|
+
#document_comments .new_comment {
|
66
|
+
width: 550px;
|
67
|
+
}
|
68
|
+
|
69
|
+
#document_comments .activity, #document_comments .subactivity {
|
70
|
+
background: transparent;
|
71
|
+
border: none;
|
72
|
+
}
|
73
|
+
#document_comments .activity_new_comment {
|
74
|
+
display:block;
|
75
|
+
}
|
@@ -1,16 +1,2 @@
|
|
1
1
|
class AudiosController < CommonDocumentsController
|
2
|
-
respond_to :html,:js
|
3
|
-
|
4
|
-
def show
|
5
|
-
path = @audio.file.path(params[:style])
|
6
|
-
if(params[:style].present?) && Document::STYLE_FORMAT[params[:style]]
|
7
|
-
path = path.split('.')[0]+'.'+Document::STYLE_FORMAT[params[:style]]
|
8
|
-
end
|
9
|
-
respond_to do |format|
|
10
|
-
format.all {send_file path,
|
11
|
-
:type => Document::STYLE_MIMETYPE[params[:style]], # CANT USE: @video.file_content_type because it is allways video/mp4 and breaks explorer and firefox
|
12
|
-
:disposition => "inline"}
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
2
|
end
|
@@ -1,18 +1,21 @@
|
|
1
1
|
class CommonDocumentsController < InheritedResources::Base
|
2
|
+
respond_to :html, :js
|
3
|
+
|
2
4
|
belongs_to_subjects :optional => true
|
3
5
|
|
4
6
|
before_filter :profile_subject!, :only => :index
|
5
7
|
|
6
8
|
load_and_authorize_resource :except => :index
|
7
9
|
|
8
|
-
def show
|
9
|
-
path = resource.file.path(params[:style])
|
10
10
|
|
11
|
+
def show
|
11
12
|
respond_to do |format|
|
13
|
+
format.html {render :action => :show}
|
12
14
|
format.all {
|
15
|
+
path = resource.file.path(params[:style] || params[:format])
|
16
|
+
|
13
17
|
send_file path,
|
14
18
|
:filename => resource.file_file_name,
|
15
|
-
:type => resource.file_content_type,
|
16
19
|
:disposition => "inline"
|
17
20
|
}
|
18
21
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class DocumentsController < CommonDocumentsController
|
2
|
-
respond_to :html
|
2
|
+
respond_to :html, :js
|
3
3
|
|
4
4
|
SEND_FILE_METHOD = :default
|
5
5
|
|
@@ -12,9 +12,15 @@ class DocumentsController < CommonDocumentsController
|
|
12
12
|
#TODO: we have to add the mimetype as in videos_controller
|
13
13
|
def download
|
14
14
|
path = @document.file.path(params[:style])
|
15
|
+
|
15
16
|
head(:bad_request) and return unless File.exist?(path)
|
16
|
-
send_file_options = {:filename=>@document.file_file_name, :type => @document.file_content_type}
|
17
17
|
|
18
|
+
send_file_options = {
|
19
|
+
:filename => @document.file_file_name,
|
20
|
+
:type => @document.file_content_type
|
21
|
+
}
|
22
|
+
|
23
|
+
# Ask Victor about the rationale of this:
|
18
24
|
case SEND_FILE_METHOD
|
19
25
|
when :apache then send_file_options[:x_sendfile] = true
|
20
26
|
when :nginx then head(:x_accel_redirect => path.gsub(Rails.root, ''))
|
@@ -25,7 +31,7 @@ class DocumentsController < CommonDocumentsController
|
|
25
31
|
|
26
32
|
class << self
|
27
33
|
def index_object_type
|
28
|
-
[:Audio
|
34
|
+
[ :Audio, :Video, :Picture, :Document ]
|
29
35
|
end
|
30
36
|
end
|
31
37
|
end
|
@@ -1,17 +1,2 @@
|
|
1
1
|
class VideosController < CommonDocumentsController
|
2
|
-
respond_to :html,:js
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
def show
|
7
|
-
path = @video.file.path(params[:style])
|
8
|
-
if(params[:style].present?) && Document::STYLE_FORMAT[params[:style]]
|
9
|
-
path = path.split('.')[0]+'.'+Document::STYLE_FORMAT[params[:style]]
|
10
|
-
end
|
11
|
-
respond_to do |format|
|
12
|
-
format.all {send_file path,
|
13
|
-
:type => Document::STYLE_MIMETYPE[params[:style]], # CANT USE: @video.file_content_type because it is allways video/mp4 and breaks explorer and firefox
|
14
|
-
:disposition => "inline"}
|
15
|
-
end
|
16
|
-
end
|
17
2
|
end
|
@@ -11,16 +11,20 @@ module DocumentsHelper
|
|
11
11
|
def thumb_file_for(document, size)
|
12
12
|
document.thumb(size, self)
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
|
+
def image_tag_for (document)
|
16
|
+
image_tag download_document_path document,
|
17
|
+
:id => dom_id(document) + "_img"
|
18
|
+
end
|
19
|
+
|
15
20
|
def link_for_wall(document)
|
16
21
|
format = Mime::Type.lookup(document.file_content_type)
|
17
|
-
|
22
|
+
|
23
|
+
polymorphic_path(document, :format => format, :style => 'thumb0')
|
18
24
|
end
|
19
25
|
|
20
|
-
def
|
21
|
-
|
22
|
-
|
23
|
-
name[0,12]+"..."
|
24
|
-
end
|
26
|
+
def show_view_for(document)
|
27
|
+
render :partial => document.class.to_s.pluralize.downcase + '/' + document.class.to_s.downcase + "_show",
|
28
|
+
:locals => {document.class.to_s.downcase.to_sym => document}
|
25
29
|
end
|
26
30
|
end
|
data/app/models/audio.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class Audio < Document
|
2
2
|
has_attached_file :file,
|
3
3
|
:url => '/:class/:id.:extension',
|
4
|
-
:path => ':rails_root/documents/:class/:id_partition/:style
|
4
|
+
:path => ':rails_root/documents/:class/:id_partition/:style',
|
5
5
|
:styles => {:webma => {:format => 'webm'}
|
6
6
|
},:processors => [:ffmpeg]
|
7
7
|
|
data/app/models/document.rb
CHANGED
@@ -3,16 +3,14 @@ class Document < ActiveRecord::Base
|
|
3
3
|
|
4
4
|
IMAGE_FORMATS = ["doc","ppt","xls","rar","zip","mpeg","plain","pdf"]
|
5
5
|
|
6
|
-
STYLE_FORMAT = {"webm" =>"webm", "flv"=>"flv", "thumb"=>"png", "thumb0"=>"png", "webma"=>"webm"}
|
7
|
-
|
8
|
-
STYLE_MIMETYPE = {"webm" =>"video/webm", "flv"=>"video/x-flv", "thumb"=>"image/png", "thumb0"=>"image/png", "mp3"=>"audio/mpeg", "webma"=>"audio/webm"}
|
9
|
-
|
10
6
|
has_attached_file :file,
|
11
7
|
:url => '/:class/:id.:extension',
|
12
|
-
:path => ':rails_root/documents/:class/:id_partition/:style.:extension'
|
8
|
+
:path => ':rails_root/documents/:class/:id_partition/:style/:filename.:extension'
|
13
9
|
|
14
10
|
validates_attachment_presence :file
|
15
11
|
|
12
|
+
before_create :set_title_and_description
|
13
|
+
|
16
14
|
define_index do
|
17
15
|
indexes title
|
18
16
|
indexes file_file_name, :as => :file_name
|
@@ -67,5 +65,11 @@ class Document < ActiveRecord::Base
|
|
67
65
|
"#{ size.to_s }/default.png"
|
68
66
|
end
|
69
67
|
end
|
68
|
+
|
69
|
+
protected
|
70
|
+
|
71
|
+
def set_title_and_description
|
72
|
+
self.title = self.file_file_name
|
73
|
+
end
|
70
74
|
|
71
75
|
end
|
data/app/models/picture.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class Picture < Document
|
2
2
|
has_attached_file :file,
|
3
3
|
:url => '/:class/:id.:extension',
|
4
|
-
:path => ':rails_root/documents/:class/:id_partition/:style
|
4
|
+
:path => ':rails_root/documents/:class/:id_partition/:style',
|
5
5
|
:styles => {:thumb => ["48x48#"],
|
6
6
|
:thumb0 => ["130x80#"]
|
7
7
|
}
|
data/app/models/video.rb
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
class Video < Document
|
2
2
|
has_attached_file :file,
|
3
3
|
:url => '/:class/:id.:extension',
|
4
|
-
:path => ':rails_root/documents/:class/:id_partition/:style
|
5
|
-
:styles => {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
:path => ':rails_root/documents/:class/:id_partition/:style',
|
5
|
+
:styles => {
|
6
|
+
:webm => {:format => 'webm'},
|
7
|
+
:flv => { :format => 'flv' },
|
8
|
+
:thumb => {:geometry => "48x48" , :format => 'png', :time => 5},
|
9
|
+
:thumb0 => {:geometry => "130x80", :format => 'png', :time => 5}
|
10
|
+
},
|
11
|
+
:processors => [:ffmpeg]
|
10
12
|
|
11
13
|
process_in_background :file
|
12
14
|
|
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
$("#jpId<%=audio.id%>").jPlayer( {
|
4
4
|
ready: function () {
|
5
|
-
$(this).jPlayer("setMedia", {
|
6
|
-
webma: "<%=
|
5
|
+
$(this).jPlayer("setMedia", {
|
6
|
+
webma: "<%= audio_url(audio, :format => 'webma') %>" // Defines the webma url
|
7
7
|
});
|
8
8
|
},
|
9
9
|
supplied: "webma",
|
@@ -1,12 +1,12 @@
|
|
1
1
|
<div class="attachment_thumb">
|
2
2
|
<%= link_to thumb_for(audio, 16),
|
3
|
-
|
4
|
-
|
3
|
+
audio_path(audio),
|
4
|
+
:class => "" %>
|
5
5
|
</div>
|
6
6
|
<div class="attachment_text">
|
7
7
|
<%= t('audio.msg') %><%= link_to "\""+audio.file_file_name+"\"",
|
8
|
-
|
9
|
-
|
8
|
+
audio_path(audio),
|
9
|
+
:class => "attachment_text_link" %>
|
10
10
|
</div>
|
11
11
|
<div id="jpId<%= audio.id%>" class="jpId_size0"></div>
|
12
12
|
<div class="jp-audio">
|
@@ -0,0 +1,62 @@
|
|
1
|
+
<% content_for :javascript do %>
|
2
|
+
|
3
|
+
$("#jpId<%=audio.id%>").jPlayer( {
|
4
|
+
ready: function () {
|
5
|
+
$(this).jPlayer("setMedia", {
|
6
|
+
webma: "<%= audio_url(audio, :format => 'webma') %>" // Defines the webma url
|
7
|
+
});
|
8
|
+
},
|
9
|
+
supplied: "webma",
|
10
|
+
preload: "none",
|
11
|
+
swfPath: "assets",
|
12
|
+
cssSelectorAncestor: "#jp_interface_<%=audio.id%>"
|
13
|
+
});
|
14
|
+
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
<%= div_for audio, :class => 'content_size' do %>
|
18
|
+
<div class="audio_show">
|
19
|
+
<% if audio.file_processing %>
|
20
|
+
<div class="processing_text">
|
21
|
+
<%= t('audio.processing')%>
|
22
|
+
</div>
|
23
|
+
<% else %>
|
24
|
+
<div id="jpId<%= audio.id%>" class="jpId_size0"></div>
|
25
|
+
<div class="jp-audio">
|
26
|
+
<div class="jp-type-single">
|
27
|
+
<div id="jp_interface_<%= audio.id%>" class="jp-interface">
|
28
|
+
<ul class="jp-controls">
|
29
|
+
<li>
|
30
|
+
<a href="#" class="jp-play" tabindex="1">play</a>
|
31
|
+
</li>
|
32
|
+
<li>
|
33
|
+
<a href="#" class="jp-pause" tabindex="1">pause</a>
|
34
|
+
</li>
|
35
|
+
<li>
|
36
|
+
<a href="#" class="jp-stop" tabindex="1">stop</a>
|
37
|
+
</li>
|
38
|
+
<li>
|
39
|
+
<a href="#" class="jp-mute" tabindex="1">mute</a>
|
40
|
+
</li>
|
41
|
+
<li>
|
42
|
+
<a href="#" class="jp-unmute" tabindex="1">unmute</a>
|
43
|
+
</li>
|
44
|
+
</ul>
|
45
|
+
<div class="jp-progress">
|
46
|
+
<div class="jp-seek-bar">
|
47
|
+
<div class="jp-play-bar"></div>
|
48
|
+
</div>
|
49
|
+
</div>
|
50
|
+
<div class="jp-volume-bar">
|
51
|
+
<div class="jp-volume-bar-value"></div>
|
52
|
+
</div>
|
53
|
+
<div class="jp-current-time"></div>
|
54
|
+
<div class="jp-duration"></div>
|
55
|
+
</div>
|
56
|
+
<div id="jp_playlist_<%= audio.id%>" class="jp-playlist"></div>
|
57
|
+
</div>
|
58
|
+
</div>
|
59
|
+
</div>
|
60
|
+
<% end %>
|
61
|
+
|
62
|
+
<% end %>
|
@@ -1 +1 @@
|
|
1
|
-
<%=render(:partial => '
|
1
|
+
<%=render(:partial => 'common_documents/index') %>
|
@@ -1,2 +1,2 @@
|
|
1
|
-
<%= render :partial => '
|
2
|
-
:locals => { :
|
1
|
+
<%= render :partial => 'common_documents/show',
|
2
|
+
:locals => { :document => @audio } %>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<div id="document_info">
|
2
|
+
<div class="left">
|
3
|
+
<div id="date_labels">
|
4
|
+
<div class="details">
|
5
|
+
<%= t('document.info.date.created_at') %>
|
6
|
+
</div>
|
7
|
+
<div class="details">
|
8
|
+
<%= t('document.info.date.updated_at') %>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
<div id="dates">
|
12
|
+
<div class="date">
|
13
|
+
<%= I18n.localize document.created_at, :format => :long %>
|
14
|
+
</div>
|
15
|
+
<div class="date">
|
16
|
+
<%= I18n.localize document.updated_at, :format => :long %>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
<div class="right">
|
21
|
+
<div id="like_count">
|
22
|
+
<%= document.like_count %> <span class="details">likes</span>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
<br class="clearfloat" />
|
26
|
+
<div id="actions">
|
27
|
+
<%= link_to image_tag("btn/download.png") + t('document.actions.download'), download_document_path(document), :class => :action %>
|
28
|
+
<%= link_to image_tag("btn/edit.png") + t('document.actions.edit'), "javascript:toggleEdit();", :class => :action %>
|
29
|
+
<% if document.post_activity.delete_object_by?(current_subject) %>
|
30
|
+
<%= link_to image_tag("btn/error.png") + t('document.actions.delete'), document.post_activity.direct_object , :confirm => t('confirm_delete',
|
31
|
+
:scope => document.post_activity.direct_object.class.to_s.underscore), :method => :delete %>
|
32
|
+
<% end %>
|
33
|
+
</div>
|
34
|
+
</div>
|
@@ -0,0 +1,49 @@
|
|
1
|
+
<% content_for :title do %>
|
2
|
+
<%= profile_subject.name + ": " + t('repository.title') %>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<% content_for :sidebar do %>
|
6
|
+
<%= render :partial => 'home/sidebar' %>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<%if profile_subject_is_current?%>
|
10
|
+
<%= location(
|
11
|
+
link_to(t('repository.title'), polymorphic_path(controller.controller_name),:remote => true)
|
12
|
+
) %>
|
13
|
+
<%else%>
|
14
|
+
<%= location(
|
15
|
+
link_to(profile_subject.name, polymorphic_path(profile_subject),:remote => true),
|
16
|
+
link_to(t('repository.title'), polymorphic_path([profile_subject, controller.controller_name]),:remote => true)
|
17
|
+
) %>
|
18
|
+
<%end%>
|
19
|
+
|
20
|
+
<% toolbar :profile => profile_subject %>
|
21
|
+
<br class="clearfloat" />
|
22
|
+
<div class="space_center"></div>
|
23
|
+
<div id="repository_filter">
|
24
|
+
<form action="<%= search_path%>" method="get" id="repository_filter">
|
25
|
+
<%= text_field_tag :filter_query, nil,:autocomplete => :off, :id => :repository_filter_input %>
|
26
|
+
</form>
|
27
|
+
<div id="order_by"><%= t('repository.order.by') %>: <%= t('repository.order.last_modified') %> · <%= t('repository.order.most_popular') %> </div>
|
28
|
+
</div>
|
29
|
+
<div class="space_center"></div>
|
30
|
+
|
31
|
+
<% @activities.each do |a| %>
|
32
|
+
<% document = a.activity_objects.first.document %>
|
33
|
+
<div class="attachment_tile">
|
34
|
+
<div class="attachment_tile_thumb">
|
35
|
+
<%= link_to thumb_for(document,48),
|
36
|
+
{:controller => "documents", :action => "show", :id => document},
|
37
|
+
:type => document.type,
|
38
|
+
:title => document.file_file_name,
|
39
|
+
:path => document_path(document) %>
|
40
|
+
</div>
|
41
|
+
<div class="attachment_tile_text">
|
42
|
+
<%= link_to truncate_name(document.file_file_name,:length => 15),
|
43
|
+
{:controller => "documents", :action => "show", :id => document},
|
44
|
+
:alt => document.file_file_name,
|
45
|
+
:type => document.type,
|
46
|
+
:path => document_path(document) %>
|
47
|
+
</div>
|
48
|
+
</div>
|
49
|
+
<% end %>
|