social_stream 0.12.3 → 0.12.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,7 +19,7 @@
19
19
  /****************** WALL - HEADER *********************/
20
20
  #wrapper_activities_header { padding-top: 5px; padding-bottom: 5px; background-color: $secondary-color;}
21
21
  #activities_title { vertical-align: top; margin-left: 10px; font-weight: bold;}
22
- #activities_header { width: 100%; margin-bottom: 5px; text-align: center; padding-top: 5px;}
22
+ #activities_header { width: 100%; margin-bottom: 5px; text-align: center; padding-top: 5px;min-height: 35px;}
23
23
  #activities_header input[type="text"] { color: $main-color; padding: 5px 5px 5px 5px; width:95%;
24
24
  border:1px solid $input-border-color;}
25
25
  #activities_share_btn { text-align: right; padding: 5px 16px 0px 10px; vertical-align: middle;}
@@ -191,19 +191,29 @@ div.chzn-container ul.chzn-choices li.search-field input{ cursor:pointer;}
191
191
  }
192
192
 
193
193
  #activity_form_select {
194
- margin-left: 10px;
194
+ margin-left: 6px;
195
195
  }
196
196
 
197
197
  .activity_form_selector{
198
198
  padding: 5px;
199
+ margin: 1px 2px;
199
200
  margin-bottom: 5px;
200
201
  float: left;
201
- border: 2px solid transparent;
202
+ background: $text-over-main;
203
+ border: 1px solid $separation-color;
202
204
  cursor: pointer;
203
205
  }
204
206
 
205
207
  .activity_form_selector.selected{
206
- border: 2px solid #46B9E8;
208
+ background: $auxiliar-color;
209
+ border: 1px solid $main-color;
210
+ color: $text-over-main;
211
+ font-weight: bold;
212
+ }
213
+
214
+ .activity_form_selector:hover{
215
+ background: $auxiliar-color;
216
+ color: $text-over-main;
207
217
  }
208
218
 
209
219
  .more_pending{
@@ -2,7 +2,7 @@
2
2
 
3
3
  /****************** HEADER STRUCTURE ******/
4
4
  #headerFront { width: 100%; padding: 0; background: $header-color; padding: 2px 0px 0px 0px;}
5
- #header_left { left: 0px; float: left; padding-left: 5px;}
5
+ #header_left { left: 0px; float: left; padding-left: 15px; padding-right: 5px; width:155px;}
6
6
  #header_right { right: 0px; float: right; padding-right: 10px; }
7
7
  .banner_top{ width: 960px; margin-left: auto; margin-right: auto; margin-top: 3px; padding-bottom: 3px;
8
8
  position: relative; }
@@ -4,7 +4,7 @@
4
4
  /********************************* Header **************/
5
5
  #header_search {
6
6
  float: left;
7
- padding: 1px 0 0 10px;
7
+ padding: 1px 0 0 2px;
8
8
  z-index: 2001;
9
9
  }
10
10
  #header_search_input, #global_search_input {
@@ -261,6 +261,15 @@ class Activity < ActiveRecord::Base
261
261
  allow?(subject, 'destroy')
262
262
  end
263
263
 
264
+ # Can subject edit the object of this activity?
265
+ def edit_object_by?(subject)
266
+ subject.present? &&
267
+ direct_object.present? &&
268
+ ! direct_object.is_a?(Actor) &&
269
+ ! direct_object.class.ancestors.include?(SocialStream::Models::Subject) &&
270
+ allow?(subject, 'update')
271
+ end
272
+
264
273
  # The {Relation} with which activity is shared
265
274
  def audience_in_words(subject, options = {})
266
275
  options[:details] ||= :full
@@ -1,5 +1,5 @@
1
1
  module SocialStream
2
2
  module Base
3
- VERSION = "0.9.26".freeze
3
+ VERSION = "0.9.27".freeze
4
4
  end
5
5
  end
@@ -1,96 +1,224 @@
1
- (function($) {
2
- $.fn.tipsy = function(options) {
1
+ // tipsy, facebook style tooltips for jquery
2
+ // version 1.0.0a
3
+ // (c) 2008-2010 jason frame [jason@onehackoranother.com]
4
+ // released under the MIT license
3
5
 
4
- options = $.extend({}, $.fn.tipsy.defaults, options);
5
-
6
- return this.each(function() {
7
-
8
- var opts = $.fn.tipsy.elementOptions(this, options);
9
-
10
- $(this).hover(function() {
6
+ (function($) {
7
+
8
+ function maybeCall(thing, ctx) {
9
+ return (typeof thing == 'function') ? (thing.call(ctx)) : thing;
10
+ };
11
+
12
+ function Tipsy(element, options) {
13
+ this.$element = $(element);
14
+ this.options = options;
15
+ this.enabled = true;
16
+ this.fixTitle();
17
+ };
18
+
19
+ Tipsy.prototype = {
20
+ show: function() {
21
+ var title = this.getTitle();
22
+ if (title && this.enabled) {
23
+ var $tip = this.tip();
24
+
25
+ $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
26
+ $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity
27
+ $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
11
28
 
12
- $.data(this, 'cancel.tipsy', true);
13
29
 
14
- var tip = $.data(this, 'active.tipsy');
15
- if (!tip) {
16
- tip = $('<div class="tipsy"><div class="tipsy-inner"/></div>');
17
- tip.css({position: 'absolute', zIndex: 100000});
18
- $.data(this, 'active.tipsy', tip);
30
+ if (this.options.hoverable) {
31
+ $tip.hover(tipOver, tipOut);
19
32
  }
20
33
 
21
- if ($(this).attr('title') || typeof($(this).attr('original-title')) != 'string') {
22
- $(this).attr('original-title', $(this).attr('title') || '').removeAttr('title');
34
+ var that = this;
35
+ function tipOver() {
36
+ that.hoverTooltip = true;
23
37
  }
24
-
25
- var title;
26
- if (typeof opts.title == 'string') {
27
- title = $(this).attr(opts.title == 'title' ? 'original-title' : opts.title);
28
- } else if (typeof opts.title == 'function') {
29
- title = opts.title.call(this);
38
+ function tipOut() {
39
+ if (that.hoverState == 'in') return; // If field is still focused.
40
+ that.hoverTooltip = false;
41
+ if (that.options.trigger != 'manual') {
42
+ var eventOut = that.options.trigger == 'hover' ? 'mouseleave.tipsy' : 'blur.tipsy';
43
+ that.$element.trigger(eventOut);
44
+ }
30
45
  }
31
-
32
- tip.find('.tipsy-inner')[opts.html ? 'html' : 'text'](title || opts.fallback);
33
-
34
- var pos = $.extend({}, $(this).offset(), {width: this.offsetWidth, height: this.offsetHeight});
35
- tip.get(0).className = 'tipsy'; // reset classname in case of dynamic gravity
36
- tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).appendTo(document.body);
37
- var actualWidth = tip[0].offsetWidth, actualHeight = tip[0].offsetHeight;
38
- var gravity = (typeof opts.gravity == 'function') ? opts.gravity.call(this) : opts.gravity;
39
-
46
+
47
+ var pos = $.extend({}, this.$element.offset(), {
48
+ width: this.$element[0].offsetWidth,
49
+ height: this.$element[0].offsetHeight
50
+ });
51
+
52
+ var actualWidth = $tip[0].offsetWidth,
53
+ actualHeight = $tip[0].offsetHeight,
54
+ gravity = maybeCall(this.options.gravity, this.$element[0]);
55
+
56
+ var tp;
40
57
  switch (gravity.charAt(0)) {
41
58
  case 'n':
42
- tip.css({top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}).addClass('tipsy-north');
59
+ tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
43
60
  break;
44
61
  case 's':
45
- tip.css({top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}).addClass('tipsy-south');
62
+ tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
46
63
  break;
47
64
  case 'e':
48
- tip.css({top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}).addClass('tipsy-east');
65
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
49
66
  break;
50
67
  case 'w':
51
- tip.css({top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}).addClass('tipsy-west');
68
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
52
69
  break;
53
70
  }
54
-
55
- if (opts.fade) {
56
- tip.css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: 0.8});
57
- } else {
58
- tip.css({visibility: 'visible'});
59
- }
60
-
61
- }, function() {
62
- $.data(this, 'cancel.tipsy', false);
63
- var self = this;
64
- setTimeout(function() {
65
- if ($.data(this, 'cancel.tipsy')) return;
66
- var tip = $.data(self, 'active.tipsy');
67
- if (opts.fade) {
68
- tip.stop().fadeOut(function() { $(this).remove(); });
71
+
72
+ if (gravity.length == 2) {
73
+ if (gravity.charAt(1) == 'w') {
74
+ tp.left = pos.left + pos.width / 2 - 15;
69
75
  } else {
70
- tip.remove();
76
+ tp.left = pos.left + pos.width / 2 - actualWidth + 15;
71
77
  }
72
- }, 100);
73
-
74
- });
75
-
76
- });
78
+ }
79
+
80
+ $tip.css(tp).addClass('tipsy-' + gravity);
81
+ $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0);
82
+ if (this.options.className) {
83
+ $tip.addClass(maybeCall(this.options.className, this.$element[0]));
84
+ }
85
+
86
+ if (this.options.fade) {
87
+ $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
88
+ } else {
89
+ $tip.css({visibility: 'visible', opacity: this.options.opacity});
90
+ }
91
+ }
92
+ },
93
+
94
+ hide: function() {
95
+ if (this.options.fade) {
96
+ this.tip().stop().fadeOut(function() { $(this).remove(); });
97
+ } else {
98
+ this.tip().remove();
99
+ }
100
+ },
101
+
102
+ fixTitle: function() {
103
+ var $e = this.$element;
104
+ if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') {
105
+ $e.attr('original-title', $e.attr('title') || '').removeAttr('title');
106
+ }
107
+ },
108
+
109
+ getTitle: function() {
110
+ var title, $e = this.$element, o = this.options;
111
+ this.fixTitle();
112
+ var title, o = this.options;
113
+ if (typeof o.title == 'string') {
114
+ title = $e.attr(o.title == 'title' ? 'original-title' : o.title);
115
+ } else if (typeof o.title == 'function') {
116
+ title = o.title.call($e[0]);
117
+ }
118
+ title = ('' + title).replace(/(^\s*|\s*$)/, "");
119
+ return title || o.fallback;
120
+ },
121
+
122
+ tip: function() {
123
+ if (!this.$tip) {
124
+ this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');
125
+ }
126
+ return this.$tip;
127
+ },
128
+
129
+ validate: function() {
130
+ if (!this.$element[0].parentNode) {
131
+ this.hide();
132
+ this.$element = null;
133
+ this.options = null;
134
+ }
135
+ },
77
136
 
137
+ enable: function() { this.enabled = true; },
138
+ disable: function() { this.enabled = false; },
139
+ toggleEnabled: function() { this.enabled = !this.enabled; }
78
140
  };
79
141
 
80
- // Overwrite this method to provide options on a per-element basis.
81
- // For example, you could store the gravity in a 'tipsy-gravity' attribute:
82
- // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
83
- // (remember - do not modify 'options' in place!)
84
- $.fn.tipsy.elementOptions = function(ele, options) {
85
- return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
142
+ $.fn.tipsy = function(options) {
143
+
144
+ if (options === true) {
145
+ return this.data('tipsy');
146
+ } else if (typeof options == 'string') {
147
+ var tipsy = this.data('tipsy');
148
+ if (tipsy) tipsy[options]();
149
+ return this;
150
+ }
151
+
152
+ options = $.extend({}, $.fn.tipsy.defaults, options);
153
+ if (options.hoverable) {
154
+ options.delayOut = options.delayOut || 200;
155
+ }
156
+
157
+ function get(ele) {
158
+ var tipsy = $.data(ele, 'tipsy');
159
+ if (!tipsy) {
160
+ tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options));
161
+ $.data(ele, 'tipsy', tipsy);
162
+ }
163
+ return tipsy;
164
+ }
165
+
166
+ function enter() {
167
+ var tipsy = get(this);
168
+ tipsy.hoverState = 'in';
169
+ if (options.delayIn == 0) {
170
+ tipsy.show();
171
+ } else {
172
+ tipsy.fixTitle();
173
+ setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn);
174
+ }
175
+ };
176
+
177
+ function leave() {
178
+ var tipsy = get(this);
179
+ tipsy.hoverState = 'out';
180
+ if (options.delayOut == 0) {
181
+ tipsy.hide();
182
+ } else {
183
+ setTimeout(function() { if (tipsy.hoverState == 'out' && !tipsy.hoverTooltip) tipsy.hide(); }, options.delayOut);
184
+ }
185
+ };
186
+
187
+ if (!options.live) this.each(function() { get(this); });
188
+
189
+ if (options.trigger != 'manual') {
190
+ var binder = options.live ? 'live' : 'bind',
191
+ eventIn = options.trigger == 'hover' ? 'mouseenter.tipsy' : 'focus.tipsy',
192
+ eventOut = options.trigger == 'hover' ? 'mouseleave.tipsy' : 'blur.tipsy';
193
+ this[binder](eventIn, enter)[binder](eventOut, leave);
194
+ }
195
+
196
+ return this;
197
+
86
198
  };
87
199
 
88
200
  $.fn.tipsy.defaults = {
201
+ className: null,
202
+ delayIn: 0,
203
+ delayOut: 0,
89
204
  fade: false,
90
205
  fallback: '',
91
206
  gravity: 'n',
92
207
  html: false,
93
- title: 'title'
208
+ live: false,
209
+ hoverable: false,
210
+ offset: 0,
211
+ opacity: 0.8,
212
+ title: 'title',
213
+ trigger: 'hover'
214
+ };
215
+
216
+ // Overwrite this method to provide options on a per-element basis.
217
+ // For example, you could store the gravity in a 'tipsy-gravity' attribute:
218
+ // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
219
+ // (remember - do not modify 'options' in place!)
220
+ $.fn.tipsy.elementOptions = function(ele, options) {
221
+ return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
94
222
  };
95
223
 
96
224
  $.fn.tipsy.autoNS = function() {
@@ -101,4 +229,35 @@
101
229
  return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
102
230
  };
103
231
 
232
+ /**
233
+ * yields a closure of the supplied parameters, producing a function that takes
234
+ * no arguments and is suitable for use as an autogravity function like so:
235
+ *
236
+ * @param margin (int) - distance from the viewable region edge that an
237
+ * element should be before setting its tooltip's gravity to be away
238
+ * from that edge.
239
+ * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer
240
+ * if there are no viewable region edges effecting the tooltip's
241
+ * gravity. It will try to vary from this minimally, for example,
242
+ * if 'sw' is preferred and an element is near the right viewable
243
+ * region edge, but not the top edge, it will set the gravity for
244
+ * that element's tooltip to be 'se', preserving the southern
245
+ * component.
246
+ */
247
+ $.fn.tipsy.autoBounds = function(margin, prefer) {
248
+ return function() {
249
+ var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)},
250
+ boundTop = $(document).scrollTop() + margin,
251
+ boundLeft = $(document).scrollLeft() + margin,
252
+ $this = $(this);
253
+
254
+ if ($this.offset().top < boundTop) dir.ns = 'n';
255
+ if ($this.offset().left < boundLeft) dir.ew = 'w';
256
+ if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e';
257
+ if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's';
258
+
259
+ return dir.ns + (dir.ew ? dir.ew : '');
260
+ }
261
+ };
262
+
104
263
  })(jQuery);
@@ -1,7 +1,25 @@
1
- .tipsy { padding: 5px; font-size: 10px; opacity: 0.8; filter: alpha(opacity=80); background-repeat: no-repeat; background-image: url(../images/tipsy.gif); }
2
- .tipsy-inner { padding: 5px 8px 4px 8px; background-color: black; color: white; max-width: 200px; text-align: center; }
3
- .tipsy-inner { -moz-border-radius:3px; -webkit-border-radius:3px; }
4
- .tipsy-north { background-position: top center; }
5
- .tipsy-south { background-position: bottom center; }
6
- .tipsy-east { background-position: right center; }
7
- .tipsy-west { background-position: left center; }
1
+ .tipsy { font-size: 10px; position: absolute; padding: 5px; z-index: 100000; }
2
+ .tipsy-inner { background-color: #000; color: #FFF; max-width: 200px; padding: 5px 8px 4px 8px; text-align: center; }
3
+
4
+ /* Rounded corners */
5
+ .tipsy-inner { border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; }
6
+
7
+ /* Uncomment for shadow */
8
+ /*.tipsy-inner { box-shadow: 0 0 5px #000000; -webkit-box-shadow: 0 0 5px #000000; -moz-box-shadow: 0 0 5px #000000; }*/
9
+
10
+ .tipsy-arrow { position: absolute; width: 0; height: 0; line-height: 0; border: 5px dashed #000; }
11
+
12
+ /* Rules to colour arrows */
13
+ .tipsy-arrow-n { border-bottom-color: #000; }
14
+ .tipsy-arrow-s { border-top-color: #000; }
15
+ .tipsy-arrow-e { border-left-color: #000; }
16
+ .tipsy-arrow-w { border-right-color: #000; }
17
+
18
+ .tipsy-n .tipsy-arrow { top: 0px; left: 50%; margin-left: -5px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent; }
19
+ .tipsy-nw .tipsy-arrow { top: 0; left: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;}
20
+ .tipsy-ne .tipsy-arrow { top: 0; right: 10px; border-bottom-style: solid; border-top: none; border-left-color: transparent; border-right-color: transparent;}
21
+ .tipsy-s .tipsy-arrow { bottom: 0; left: 50%; margin-left: -5px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
22
+ .tipsy-sw .tipsy-arrow { bottom: 0; left: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
23
+ .tipsy-se .tipsy-arrow { bottom: 0; right: 10px; border-top-style: solid; border-bottom: none; border-left-color: transparent; border-right-color: transparent; }
24
+ .tipsy-e .tipsy-arrow { right: 0; top: 50%; margin-top: -5px; border-left-style: solid; border-right: none; border-top-color: transparent; border-bottom-color: transparent; }
25
+ .tipsy-w .tipsy-arrow { left: 0; top: 50%; margin-top: -5px; border-right-style: solid; border-left: none; border-top-color: transparent; border-bottom-color: transparent; }
@@ -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')
@@ -1,3 +1,3 @@
1
1
  module SocialStream
2
- VERSION = "0.12.3".freeze
2
+ VERSION = "0.12.4".freeze
3
3
  end
@@ -11,8 +11,8 @@ 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.26')
15
- s.add_runtime_dependency('social_stream-documents', '~> 0.4.2')
14
+ s.add_runtime_dependency('social_stream-base', '~> 0.9.27')
15
+ s.add_runtime_dependency('social_stream-documents', '~> 0.4.3')
16
16
  s.add_runtime_dependency('social_stream-events', '~> 0.0.17')
17
17
 
18
18
  # Development Gem dependencies
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_stream
3
3
  version: !ruby/object:Gem::Version
4
- hash: 41
4
+ hash: 39
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 12
9
- - 3
10
- version: 0.12.3
9
+ - 4
10
+ version: 0.12.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - GING - DIT - UPM
@@ -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: 15
30
+ hash: 13
31
31
  segments:
32
32
  - 0
33
33
  - 9
34
- - 26
35
- version: 0.9.26
34
+ - 27
35
+ version: 0.9.27
36
36
  type: :runtime
37
37
  version_requirements: *id001
38
38
  - !ruby/object:Gem::Dependency
@@ -43,12 +43,12 @@ dependencies:
43
43
  requirements:
44
44
  - - ~>
45
45
  - !ruby/object:Gem::Version
46
- hash: 11
46
+ hash: 9
47
47
  segments:
48
48
  - 0
49
49
  - 4
50
- - 2
51
- version: 0.4.2
50
+ - 3
51
+ version: 0.4.3
52
52
  type: :runtime
53
53
  version_requirements: *id002
54
54
  - !ruby/object:Gem::Dependency