diff --git a/app/helpers/sockets_helper.rb b/app/helpers/sockets_helper.rb index b6a82c839bfad833884ae60c622a65a90cc5464c..d8cba03396d168ce85920485536a3f91aafb76d6 100644 --- a/app/helpers/sockets_helper.rb +++ b/app/helpers/sockets_helper.rb @@ -13,6 +13,7 @@ module SocketsHelper begin user = User.find_by_id uid v = render_to_string(:partial => type_partial(object), :locals => {:post => object, :current_user => user}) unless object.is_a? Retraction + v = render_to_string(:partial => 'shared/stream_element', :locals => {:post => object, :current_user => user}) unless object.is_a? Retraction rescue Exception => e Rails.logger.error("web socket view rendering failed for object #{object.inspect}.") raise e diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index 4e696b29a9ab183f6f9efcdad6eb3358c5ce86ce..c104d752cdf6794990769491b87f894d0cc08a28 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -11,7 +11,7 @@ = render 'aspects/no_posts_message' %ul#stream - for post in @posts - = render type_partial(post), :post => post + = render 'shared/stream_element', :post => post #pagination = will_paginate @posts diff --git a/app/views/aspects/show.html.haml b/app/views/aspects/show.html.haml index 4e696b29a9ab183f6f9efcdad6eb3358c5ce86ce..c104d752cdf6794990769491b87f894d0cc08a28 100644 --- a/app/views/aspects/show.html.haml +++ b/app/views/aspects/show.html.haml @@ -11,7 +11,7 @@ = render 'aspects/no_posts_message' %ul#stream - for post in @posts - = render type_partial(post), :post => post + = render 'shared/stream_element', :post => post #pagination = will_paginate @posts diff --git a/app/views/photos/_photo.haml b/app/views/photos/_photo.haml index f71bbad977ca30eee043da3e75a7ae90dc6152c7..5030c2c03615e0d8a5b503ab5e96c84a30164803 100644 --- a/app/views/photos/_photo.haml +++ b/app/views/photos/_photo.haml @@ -2,35 +2,9 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -%li.message{:data=>{:guid=>post.id}} += link_to (image_tag post.url(:thumb_large)), object_path(post), :class => 'stream_photo' - = person_image_link(post.person) - - .content - .from - = link_to post.person.real_name, post.person - .aspect - âž” - %ul - - if post.public? - %li= t('.the_world') - - else - - for aspect in current_user.aspects_with_post( post.id ) - %li= link_to aspect.name, aspect - - - if current_user.owns?(post) - .right - = link_to t('delete'), photo_path(post), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :class => "delete" - - =t('.posted_a_photo') - - %br - %br - = link_to (image_tag post.url(:thumb_large)), object_path(post) - - .info - %span.time= link_to(how_long_ago(post), photo_path(post)) - = link_to "#{t('.show_comments')} (#{post.comments.count})", '#', :class => "show_post_comments" - - = render "comments/comments", :post => post +%p.photo_description + = post.caption += link_to "view all of #{post.person.real_name}'s photos", person_photos_path(post.person), :class => "small_text" diff --git a/app/views/shared/_post_wrapper.haml b/app/views/shared/_post_wrapper.haml deleted file mode 100644 index 538d90348ae923696259fa9f6fcb0cc72eb04772..0000000000000000000000000000000000000000 --- a/app/views/shared/_post_wrapper.haml +++ /dev/null @@ -1,8 +0,0 @@ --# Copyright (c) 2010, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - -%li.message{:id => post.id, :class => ("mine" if current_user.owns?(post))} - = person_image_link(post.person) - = yield post_yield_tag(post) - = = render type_partial(post), :post => post diff --git a/app/views/shared/_stream_element.haml b/app/views/shared/_stream_element.haml new file mode 100644 index 0000000000000000000000000000000000000000..2bd35ca5c534a53740a40e8ed040cf1e3be50f12 --- /dev/null +++ b/app/views/shared/_stream_element.haml @@ -0,0 +1,32 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + +%li.message{:data=>{:guid=>post.id}} + + = person_image_link(post.person) + + .content + .from + = link_to post.person.real_name, post.person + .aspect + âž” + %ul + - if post.public? + %li= t('.the_world') + - else + - for aspect in current_user.aspects_with_post( post.id ) + %li= link_to aspect.name, aspect + + - if current_user.owns?(post) + .right + = link_to t('delete'), photo_path(post), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :class => "delete" + + = render type_partial(post), :post => post + + .info + %span.time= link_to(how_long_ago(post), photo_path(post)) + = link_to "#{t('.show_comments')} (#{post.comments.count})", '#', :class => "show_post_comments" + + = render "comments/comments", :post => post + diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index 19f0b1bd3791c612d2f09f294f0f89db5ac402c6..85fd62688d9bb2e5011b1ab95f7117e2745e5cf6 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -2,32 +2,4 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -%li.message{ :data=>{:guid=>post.id}, :class => ("mine" if current_user.owns?(post))} - - = person_image_link(post.person) - - .content - .from - = link_to post.person.real_name, post.person - .aspect - âž” - %ul - - if post.public? - the world - - else - - for aspect in current_user.aspects_with_post( post.id ) - %li= link_to aspect.name, aspect - - - if current_user.owns?(post) - .right - = render "shared/reshare", :post => post, :current_user => current_user - = link_to t('delete'), status_message_path(post), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :class => "delete" - - = markdownify(post.message) - - .info - %span.time= link_to(how_long_ago(post), object_path(post)) - = link_to "#{t('.show_comments')} (#{post.comments.count})", '#', :class => "show_post_comments" - - = render "comments/comments", :post => post - += markdownify(post.message) diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index c412bcf2892ec577f366e2e5d40663889b58f143..c70cb8bdf2417a8fea57028609bb547d898daf57 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -62,6 +62,9 @@ en: search: "Search" logout: "logout" shared: + stream_element: + show_comments: "show comments" + the_world: "the world" aspect_nav: all_aspects: "All Aspects" manage: "Manage" @@ -186,10 +189,8 @@ en: editing: "Editing" delete_photo: "Delete Photo" photo: - show_comments: "show comments" posted_a_new_photo_to: "posted a new photo to" posted_a_photo: "posted a photo" - the_world: "the world" new: new_photo: "New Photo" back_to_list: "Back to List" @@ -232,8 +233,6 @@ en: new_status_message: tell_me_something_good: "tell me something good" oh_yeah: "oh yeah!" - status_message: - show_comments: "show comments" show: status_message: "Status Message" comments: "comments" diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 0a40e4e6b3ce245ea6aa7b6e5cbc0a220fcb23bc..ee965d9de5f96b8c36a3d4ff15e5df154480f994 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -315,6 +315,25 @@ li.message :weight normal :size 14px + .stream_photo + :float left + :margin + :top 6px + + .photo_description + :margin + :top 6px + :padding + :left 220px + :min-height 185px + :color #888 + :font + :style italic + + .small_text + :font + :size 10px + div.info :color #999 :font-size smaller