<%= image_tag(activity.params['first_image']) if activity.params['first_image'] %><%= strip_tags(activity.params['lead']).gsub(/(\xA0|\xC2|\s)+/, ' ').gsub(/^\s+/, '') %>
<%= link_to_remote(content_tag(:span, _('Remove')), :url =>{:action => 'remove_activity', :activity_id => activity.id}, :update => "profile-activity-item-#{activity.id}") if logged_in? && current_person == @profile %>
diff --git a/config/initializers/action_tracker.rb b/config/initializers/action_tracker.rb
index cde4180..22f6db5 100644
--- a/config/initializers/action_tracker.rb
+++ b/config/initializers/action_tracker.rb
@@ -23,7 +23,7 @@ ActionTrackerConfig.verbs = {
},
:upload_image => {
- :description => lambda { n_('uploaded 1 image:
%{thumbnails}
%{details}', 'uploaded %{num} images:
%{thumbnails}
%{details}', get_view_url.size) % { :num => get_view_url.size, :thumbnails => '{{ta.collect_group_with_index(:thumbnail_path){ |t,i| content_tag(:span, link_to(image_tag(t), ta.get_view_url[i]))}.last(3).join}}', :details => '{{unique_with_count(ta.collect_group_with_index(:parent_name){ |n,i| link_to(n, ta.get_parent_url[i])}, "%s").join("
")}}' % _("in the gallery") } },
+ :description => lambda { n_('uploaded 1 image:
%{thumbnails}
%{details}', 'uploaded %{num} images:
%{thumbnails}
%{details}', get_view_url.size) % { :num => get_view_url.size, :thumbnails => '{{ta.collect_group_with_index(:thumbnail_path){ |t,i| content_tag(:span, image_tag(t) + link_to(nil, ta.get_view_url[i]))}.last(3).join}}', :details => '{{unique_with_count(ta.collect_group_with_index(:parent_name){ |n,i| link_to(n, ta.get_parent_url[i])}, "%s").join("
")}}' % _("in the gallery") } },
:type => :groupable
},
diff --git a/public/images/gallery-image-activity-border.png b/public/images/gallery-image-activity-border.png
new file mode 100644
index 0000000..7b125f2
Binary files /dev/null and b/public/images/gallery-image-activity-border.png differ
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index 88ca7df..735ccb5 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -5911,6 +5911,65 @@ h1#agenda-title {
color: #808080;
}
+#profile-wall li.profile-activity-item.upload_image span,
+#profile-wall li.profile-activity-item.upload_image span img,
+#profile-wall li.profile-activity-item.upload_image span a {
+ width: 98px;
+ height: 86px;
+ display: block;
+ overflow: hidden;
+ position: absolute;
+}
+
+#profile-wall li.profile-activity-item.upload_image span {
+ position: relative;
+ float: left;
+ margin: 5px 5px 5px 0;
+}
+
+#profile-wall li.profile-activity-item.upload_image span a {
+ background: transparent url(/images/gallery-image-activity-border.png) center center no-repeat;
+ text-indent: -5000em;
+}
+
+#profile-wall li.profile-activity-item.upload_image .article-comment span,
+#profile-wall li.profile-activity-item.upload_image .profile-wall-actions span {
+ display: inline;
+ position: static;
+ margin: 0;
+ float: none;
+ width: auto;
+ height: auto;
+}
+
+#profile-wall li.profile-activity-item ul.profile-wall-activities-comments {
+ margin-top: 0;
+}
+
+#profile-wall li.profile-activity-item.upload_image .profile-activity-text {
+ padding-left: 50px;
+}
+
+#profile-wall li.profile-activity-item.join_community .profile-activity-text a img,
+#profile-wall li.profile-activity-item.new_friendship .profile-activity-text a img {
+ margin: 5px 5px 0 0;
+ padding: 1px;
+ border: 1px solid #ccc;
+}
+
+#profile-wall li.profile-activity-item.create_article {
+ position: relative;
+}
+
+.profile-activity-icon {
+ width: 16px;
+ height: 16px;
+ display: inline-block;
+ position: absolute;
+ top: 5px;
+ right: 5px;
+}
+
#profile-activity .profile-wall-scrap-replies li,
#profile-network .profile-wall-scrap-replies li,
#profile-wall .profile-wall-scrap-replies li {
diff --git a/test/unit/article_test.rb b/test/unit/article_test.rb
index 78fb647..6c1cc6d 100644
--- a/test/unit/article_test.rb
+++ b/test/unit/article_test.rb
@@ -1600,4 +1600,9 @@ assert_equal 'bla', profile.articles.map(&:comments_count)
a = fast_create(Article, :body => '
Foo
Bar
')
assert_equal '', a.first_image
end
+
+ should 'store first image in tracked action' do
+ a = TinyMceArticle.create! :name => 'Tracked Article', :body => '
Foo
Bar
', :profile_id => profile.id
+ assert_equal 'foo.png', ActionTracker::Record.last.get_first_image
+ end
end
diff --git a/test/unit/event_test.rb b/test/unit/event_test.rb
index 7ff9c54..bf603ce 100644
--- a/test/unit/event_test.rb
+++ b/test/unit/event_test.rb
@@ -274,4 +274,7 @@ class EventTest < ActiveSupport::TestCase
assert Event.new.tiny_mce?
end
+ should 'be notifiable' do
+ assert Event.new.notifiable?
+ end
end
diff --git a/test/unit/forum_test.rb b/test/unit/forum_test.rb
index 468aea9..b784b55 100644
--- a/test/unit/forum_test.rb
+++ b/test/unit/forum_test.rb
@@ -110,4 +110,17 @@ class ForumTest < ActiveSupport::TestCase
assert !folder.accept_uploads?
end
+ should 'be notifiable' do
+ assert Forum.new.notifiable?
+ end
+
+ should 'get first paragraph' do
+ f = fast_create(Forum, :body => '
First
Second
')
+ assert_equal '
First
', f.first_paragraph
+ end
+
+ should 'not get first paragraph' do
+ f = fast_create(Forum, :body => 'Nothing to do here')
+ assert_equal '', f.first_paragraph
+ end
end
diff --git a/test/unit/uploaded_file_test.rb b/test/unit/uploaded_file_test.rb
index 1d7abd6..a08eae1 100644
--- a/test/unit/uploaded_file_test.rb
+++ b/test/unit/uploaded_file_test.rb
@@ -330,4 +330,11 @@ class UploadedFileTest < ActiveSupport::TestCase
assert_equal 'hello_world.php.txt', file.filename
end
+ should 'use the gallery as the parent for action tracker' do
+ p = fast_create(Gallery, :profile_id => @profile.id)
+ f = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :parent => p, :profile => @profile)
+ ta = ActionTracker::Record.last(:conditions => { :verb => "upload_image" })
+ assert_equal f.parent, ta.target
+ end
+
end
--
libgit2 0.21.2