diff --git a/app/models/image.rb b/app/models/image.rb index a88bc0c..e0b953d 100644 --- a/app/models/image.rb +++ b/app/models/image.rb @@ -13,7 +13,7 @@ class Image < ActiveRecord::Base :thumbnails => { :big => '150x150', :thumb => '100x100', :portrait => '64x64', - :minor => '50x50', + :minor => '50x50>', :icon => '20x20!' }, :max_size => 5.megabytes # remember to update validate message below diff --git a/app/views/profile/_comment.rhtml b/app/views/profile/_comment.rhtml index ba73efc..8b40ba5 100644 --- a/app/views/profile/_comment.rhtml +++ b/app/views/profile/_comment.rhtml @@ -17,7 +17,11 @@
+ <% end %> + <%= txt2html comment.body %>
- <%= image_tag(activity.params['first_image']) unless activity.params['first_image'].blank? %><%= strip_tags(activity.params['lead']).gsub(/(\xA0|\xC2|\s)+/, ' ').gsub(/^\s+/, '') %> <%= link_to(_('See more'), activity.params['url']) unless activity.get_lead.blank? %> +
<%= time_ago_as_sentence(activity.created_at) %>
diff --git a/app/views/profile/_profile_comments.rhtml b/app/views/profile/_profile_comments.rhtml index cfa110d..40496c7 100644 --- a/app/views/profile/_profile_comments.rhtml +++ b/app/views/profile/_profile_comments.rhtml @@ -7,7 +7,7 @@ <% end %> <%= render :partial => 'profile_comment_form', :locals => { :activity => activity, :tab_action => tab_action } %> diff --git a/public/designs/templates/leftbar/stylesheets/style.css b/public/designs/templates/leftbar/stylesheets/style.css index fbeb80e..17c460b 100644 --- a/public/designs/templates/leftbar/stylesheets/style.css +++ b/public/designs/templates/leftbar/stylesheets/style.css @@ -55,19 +55,13 @@ height: 144px; } -#profile-wall li.profile-activity-item.upload_image span a, -#profile-network li.profile-activity-item.upload_image span a { - background-image: url(/images/gallery-image-activity-border-onecol.png); -} - #profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span, -#profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span img, +#profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a img, #profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a, #profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span, -#profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span img, +#profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a img, #profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a { - width: 549px; - height: 254px; + max-width: 540px; } #profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a, diff --git a/public/designs/templates/rightbar/stylesheets/style.css b/public/designs/templates/rightbar/stylesheets/style.css index 34d02e3..0b38254 100644 --- a/public/designs/templates/rightbar/stylesheets/style.css +++ b/public/designs/templates/rightbar/stylesheets/style.css @@ -55,22 +55,11 @@ height: 144px; } -#profile-wall li.profile-activity-item.upload_image span a, -#profile-network li.profile-activity-item.upload_image span a { - background-image: url(/images/gallery-image-activity-border-onecol.png); -} - #profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span, -#profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span img, +#profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a img, #profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a, #profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span, -#profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span img, -#profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a { - width: 549px; - height: 254px; -} - -#profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a, +#profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a img, #profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a { - background-image: url(/images/gallery-image-activity-border-big-onecol.png); + max-width: 540px; } diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 507bfb9..ccb8846 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1203,6 +1203,10 @@ a.comment-picture { color: #888; } +.comment-title { + font-size: 12px; + font-weight: bold; +} .comment-created-at { padding-right: 9px; } @@ -5913,6 +5917,11 @@ h1#agenda-title { margin: 5px 0; } +.profile-activity-lead .article-name { + font-weight: bold; + margin-bottom: 5px; +} + .profile-activity-article-forum .profile-activity-lead { height: 50px; width: 297px; @@ -5980,7 +5989,8 @@ h1#agenda-title { #profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a img, #profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span, #profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a img { - width: 383px; + width: auto; + max-width: 383px; height: auto; } @@ -6006,13 +6016,11 @@ h1#agenda-title { #profile-wall li.profile-activity-item.upload_image span a, #profile-network li.profile-activity-item.upload_image span a { - Xbackground: transparent url(/images/gallery-image-activity-border.png) center center no-repeat; text-indent: -5000em; } #profile-wall li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a, #profile-network li.profile-activity-item.upload_image .activity-gallery-images-count-1 span a { - Xbackground-image: url(/images/gallery-image-activity-border-big.png); position: relative; } @@ -6365,8 +6373,8 @@ h1#agenda-title { #profile-wall .profile-wall-activities-comments img, #profile-network .profile-wall-activities-comments img { - width: 33px; - height: 33px; + max-width: 50px; + max-height: 50px; } #profile-wall .profile-wall-activities-comments .comment_reply, @@ -6378,8 +6386,8 @@ h1#agenda-title { #profile-wall .profile-wall-activities-comments .comment-picture, #profile-network .profile-wall-activities-comments .comment-picture { - width: 33px; - margin-right: 10px; + width: 50px; + text-align: center; } #profile-wall .profile-wall-activities-comments .comment-text p, diff --git a/test/unit/comment_test.rb b/test/unit/comment_test.rb index 055057f..d0c1ef7 100644 --- a/test/unit/comment_test.rb +++ b/test/unit/comment_test.rb @@ -321,6 +321,22 @@ class CommentTest < ActiveSupport::TestCase assert result[1].replies.empty? end + should "return activities comments as a thread" do + person = fast_create(Person) + a = TextileArticle.create!(:profile => person, :name => 'My article', :body => 'Article body') + c0 = Comment.create!(:source => a, :body => 'My comment', :author => person) + c1 = Comment.create!(:reply_of_id => c0.id, :source => a, :body => 'bla', :author => person) + c2 = Comment.create!(:reply_of_id => c1.id, :source => a, :body => 'bla', :author => person) + c3 = Comment.create!(:reply_of_id => c0.id, :source => a, :body => 'bla', :author => person) + c4 = Comment.create!(:source => a, :body => 'My comment', :author => person) + result = a.activity.comments_as_thread + assert_equal c0, result[0] + assert_equal [c1, c3], result[0].replies + assert_equal [c2], result[0].replies[0].replies + assert_equal c4, result[1] + assert result[1].replies.empty? + end + should 'provide author url for authenticated user' do author = Person.new author.expects(:url).returns('http://blabla.net/author') diff --git a/vendor/plugins/action_tracker_has_comments/init.rb b/vendor/plugins/action_tracker_has_comments/init.rb index 9ad3408..778f0d8 100644 --- a/vendor/plugins/action_tracker_has_comments/init.rb +++ b/vendor/plugins/action_tracker_has_comments/init.rb @@ -9,4 +9,15 @@ ActionTracker::Record.module_eval do "source_type = '#{type}' AND source_id = '#{id}'" end + def comments_as_thread + result = {} + root = [] + self.comments.each do |c| + c.replies = [] + result[c.id] ||= c + c.reply_of_id.nil? ? root << c : result[c.reply_of_id].replies << c + end + root + end + end -- libgit2 0.21.2