social_stream-documents 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -51,10 +51,9 @@
51
51
  }
52
52
 
53
53
  #new_document{
54
- margin-top: 10px;
55
- margin-left: 15px;
56
- margin-bottom: 10px;
54
+ margin-left: 10px;
57
55
  clear: both;
56
+ padding-top: 5px;
58
57
  text-align: left;
59
58
  }
60
59
 
@@ -68,13 +67,19 @@
68
67
  overflow: hidden;
69
68
  border: 1px solid transparent;
70
69
  padding: 5px;
70
+ position: relative;
71
71
  }
72
72
 
73
- .attachment_tile img{
73
+ .attachment_tile_thumb img{
74
74
  width: 48px;
75
75
  height: 48px;
76
76
  }
77
77
 
78
+ .attachment_tile_tipsy{
79
+ position: absolute;
80
+ top: 0px;
81
+ right: 9px;
82
+ }
78
83
 
79
84
  .attachment_tile:hover{
80
85
  border: 1px solid $main-color;
@@ -95,6 +100,43 @@
95
100
  background-color: #e0edf2;
96
101
  }
97
102
 
103
+ .attachment_tile_tipsy_menu.tipsy {
104
+ padding-top: 0px;
105
+ display: none;
106
+ }
107
+ .attachment_tile_tipsy_menu.tipsy .tipsy-arrow {
108
+ display: none;
109
+ }
110
+ .attachment_tile_tipsy_menu.tipsy .tipsy-inner {
111
+ background-color: $text-over-main;
112
+ border-radius: 0px;
113
+ -moz-border-radius: 0px;
114
+ -webkit-border-radius: 0px;
115
+ padding:0px;
116
+ }
117
+ .attachment_tile_tipsy_menu.tipsy .actions {
118
+ border-bottom: 1px solid $main-color;
119
+ text-align: left;
120
+ }
121
+ .attachment_tile_tipsy_menu.tipsy .actions .action {
122
+ border: 1px solid $main-color;
123
+ border-bottom: 0px;
124
+ padding:5px;
125
+ width: 80px;
126
+ }
127
+ .attachment_tile_tipsy_menu.tipsy .actions .action:hover {
128
+ background-color: $secondary-color;
129
+ }
130
+ .attachment_tile_tipsy_menu.tipsy .actions a:hover {
131
+ text-decoration: none;
132
+ }
133
+ .attachment_tile_tipsy_menu.tipsy .actions .action img {
134
+ vertical-align: middle;
135
+ padding-bottom: 3px;
136
+ padding-right: 3px;
137
+ padding-left: 3px;
138
+ display: inline-block;
139
+ }
98
140
  #repository_filter {
99
141
  margin-left: 10px;
100
142
  }
@@ -82,7 +82,7 @@ class DocumentsController < InheritedResources::Base
82
82
  if params[:query].present?
83
83
  @activities = @activities.joins(:activity_objects => :document).where('documents.title LIKE ?', get_search_query)
84
84
  end
85
- @activities.page(params[:page]).per(PER_PAGE)
85
+ @activities = @activities.page(params[:page]).per(PER_PAGE)
86
86
  end
87
87
 
88
88
  class << self
@@ -25,7 +25,9 @@
25
25
  <br class="clearfloat" />
26
26
  <div id="actions">
27
27
  <%= link_to content_tag(:span,image_tag("btn/download.png") + t('document.actions.download'), :class => :action), download_document_path(document) %>
28
- <%= link_to content_tag(:span,image_tag("btn/edit.png") + t('document.actions.edit'), :class => :action, :id => :document_edit_action), "javascript:toggleDocumentEdit();" %>
28
+ <% if document.post_activity.edit_object_by?(current_subject) %>
29
+ <%= link_to content_tag(:span,image_tag("btn/edit.png") + t('document.actions.edit'), :class => :action, :id => :document_edit_action), "javascript:toggleDocumentEdit();" %>
30
+ <% end %>
29
31
  <% if document.post_activity.delete_object_by?(current_subject) %>
30
32
  <%= link_to content_tag(:span,image_tag("btn/error.png") + t('document.actions.delete'), :class => :action), document.post_activity.direct_object , :confirm => t('confirm_delete',
31
33
  :scope => document.post_activity.direct_object.class.to_s.underscore), :method => :delete %>
@@ -47,3 +47,11 @@
47
47
  </div>
48
48
  <% end %>
49
49
  </div>
50
+
51
+ <% if params[:editing].present? and params[:editing].eql?"true" and document.post_activity.edit_object_by?(current_subject) %>
52
+ <%= javascript_tag do %>
53
+ $(document).ready(function(){
54
+ toggleDocumentEdit();
55
+ });
56
+ <% end %>
57
+ <% end %>
@@ -21,9 +21,7 @@
21
21
  <br class="clearfloat" />
22
22
  <div class="space_center"></div>
23
23
  <div id="repository_filter">
24
- <form action="<%= search_path%>" method="get" id="repository_filter">
25
24
  <%= text_field_tag :filter_query, nil,:autocomplete => :off, :id => :repository_filter_input %>
26
- </form>
27
25
  <div id="order_by"><%= t('repository.order.by') %>: <%= t('repository.order.last_modified') %> · <%= t('repository.order.most_popular') %> </div>
28
26
  </div>
29
27
  <div class="space_center"></div>
@@ -5,7 +5,7 @@
5
5
 
6
6
  <% @activities.each do |a| %>
7
7
  <% document = a.activity_objects.first.document %>
8
- <div class="attachment_tile">
8
+ <div class="attachment_tile" id="<%= dom_id(document)%>">
9
9
  <div class="attachment_tile_thumb">
10
10
  <%= link_to thumb_for(document,48),
11
11
  {:controller => "documents", :action => "show", :id => document},
@@ -13,6 +13,22 @@
13
13
  :title => document.file_file_name,
14
14
  :path => document_path(document) %>
15
15
  </div>
16
+ <div class="attachment_tile_tipsy">
17
+ <%= link_to image_tag("btn/btn_down.png"),
18
+ "javascript:;" %>
19
+ <div class="tipsy_content" style="display:none;">
20
+ <div class="actions">
21
+ <%= link_to content_tag(:div,image_tag("btn/download.png") + t('document.actions.download'), :class => :action), download_document_path(document) %>
22
+ <% if document.post_activity.edit_object_by?(current_subject) %>
23
+ <%= link_to content_tag(:div,image_tag("btn/edit.png") + t('document.actions.edit'), :class => :action, :id => :document_edit_action), document_path(document, :editing => true) %>
24
+ <% end %>
25
+ <% if document.post_activity.delete_object_by?(current_subject) %>
26
+ <%= link_to content_tag(:div,image_tag("btn/error.png") + t('document.actions.delete'), :class => :action), document.post_activity.direct_object , :confirm => t('confirm_delete',
27
+ :scope => document.post_activity.direct_object.class.to_s.underscore), :method => :delete %>
28
+ <% end %>
29
+ </div>
30
+ </div>
31
+ </div>
16
32
  <div class="attachment_tile_text">
17
33
  <%= link_to truncate_name(document.file_file_name,:length => 15),
18
34
  {:controller => "documents", :action => "show", :id => document},
@@ -21,6 +37,21 @@
21
37
  :path => document_path(document) %>
22
38
  </div>
23
39
  </div>
40
+ <%= javascript_tag do %>
41
+ $(document).ready(function(){
42
+ $('#<%= dom_id(document)%> .attachment_tile_tipsy a').tipsy({
43
+ delayIn: 0,
44
+ delayOut: 1000,
45
+ gravity: 'nw',
46
+ className: 'attachment_tile_tipsy_menu',
47
+ html: true,
48
+ hoverable: true,
49
+ title: function(){
50
+ return $('#<%= dom_id(document)%> .attachment_tile_tipsy .tipsy_content').html();
51
+ }
52
+ });
53
+ });
54
+ <% end %>
24
55
  <% end %>
25
56
 
26
57
  <% if @activities.size == DocumentsController::PER_PAGE %>
@@ -33,3 +64,5 @@
33
64
  <% unless params[:no_layout].present? %>
34
65
  </div>
35
66
  <% end %>
67
+
68
+
@@ -1,5 +1,5 @@
1
1
  module SocialStream
2
2
  module Documents
3
- VERSION = "0.4.2".freeze
3
+ VERSION = "0.4.3".freeze
4
4
  end
5
5
  end
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.files = `git ls-files`.split("\n")
13
13
 
14
14
  # Gem dependencies
15
- s.add_runtime_dependency('social_stream-base', '~> 0.9.25')
15
+ s.add_runtime_dependency('social_stream-base', '~> 0.9.27')
16
16
  s.add_runtime_dependency('paperclip-ffmpeg', '~> 0.7.0')
17
17
  s.add_runtime_dependency('paperclip','2.3.11')
18
18
  s.add_runtime_dependency('delayed_paperclip','>= 0.7.2')
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_stream-documents
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 2
10
- version: 0.4.2
9
+ - 3
10
+ version: 0.4.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - "V\xC3\xADctor S\xC3\xA1nchez Belmar"
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-11-04 00:00:00 +01:00
19
+ date: 2011-11-08 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -27,12 +27,12 @@ dependencies:
27
27
  requirements:
28
28
  - - ~>
29
29
  - !ruby/object:Gem::Version
30
- hash: 9
30
+ hash: 13
31
31
  segments:
32
32
  - 0
33
33
  - 9
34
- - 25
35
- version: 0.9.25
34
+ - 27
35
+ version: 0.9.27
36
36
  type: :runtime
37
37
  version_requirements: *id001
38
38
  - !ruby/object:Gem::Dependency