diff --git a/app/views/shared/_reshare.haml b/app/views/shared/_reshare.haml new file mode 100644 index 000000000..61f48e73b --- /dev/null +++ b/app/views/shared/_reshare.haml @@ -0,0 +1,27 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3. See +-# the COPYRIGHT file. + + + +:javascript + $(".reshare_button").toggle(function(e){ + e.preventDefault(); + $(this).parent(".reshare_pane").children(".reshare_box").fadeIn(200); + }, function(e) { + e.preventDefault(); + $(this).parent(".reshare_pane").children(".reshare_box").fadeOut(200); + }); + +.reshare_pane + %span.reshare_button + = link_to "Reshare", "#" + + %ul.reshare_box + - for aspect in current_user.aspects_with_post( post.id ) + %li.currently_sharing= aspect.name + + - for aspect in current_user.aspects + - unless aspect.posts.include? post + %li.aspect_to_share= link_to aspect, repost_path( :id => post.id, :aspect_ids => aspect.id ) + diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index ee484f47b..33764453f 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -17,14 +17,10 @@ \-- = link_to "show comments (#{post.comments.count})", '#', :class => "show_post_comments" - = render "comments/comments", :post => post + = render "comments/comments", :post => post - if current_user.owns?(post) .destroy_link = link_to 'Delete', status_message_path(post), :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "delete" - - %b reshare: - -if @aspects - - for aspect in @aspects - = link_to aspect, repost_path( :id => post.id, :aspect_ids => aspect.id ) + = render "shared/reshare", :post => post, :current_user => current_user diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 9e8561cc2..e95107081 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -171,6 +171,40 @@ li.message { li.message .content div.info .time a { color: #666666; } +.reshare_pane { + margin-left: 5px; + margin-right: 5px; + display: inline; + position: relative; } + .reshare_pane ul.reshare_box { + display: none; + z-index: 10; + position: absolute; + margin-top: 5px; + padding: 0; + background-color: #fafafa; + list-style: none; + border: 5px solid #666666; + -webkit-box-shadow: 0 0 5px #666666; + -moz-box-shadow: 0 0 5px #666666; + text-shadow: 0 2px white; + color: black; } + .reshare_pane ul.reshare_box > li { + font-weight: bold; + padding: 8px; + padding-right: 15px; + border-top: 1px solid white; + border-bottom: 1px solid #cccccc; } + .reshare_pane ul.reshare_box > li:first-child { + border-top: none; } + .reshare_pane ul.reshare_box > li:last-child { + border-bottom: none; } + .reshare_pane ul.reshare_box > li a { + display: block; + height: 100%; } + .reshare_pane ul.reshare_box > li a:hover { + background-color: #eeeeee; } + form { position: relative; font-size: 120%; @@ -270,6 +304,9 @@ ul.comment_set { .destroy_link a, .request_button a { color: #999999; font-weight: normal; } + .destroy_link a:hover, .request_button a:hover { + text-decoration: underline; + background: none; } .destroy_link { display: none; diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 88145b6df..30f03f8c0 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -225,6 +225,58 @@ li.message a :color #666 +.reshare_pane + :margin + :left 5px + :right 5px + :display inline + :position relative + + ul.reshare_box + :display none + :z-index 10 + :position absolute + :margin + :top 5px + :padding 0 + + :background + :color #fafafa + + :list + :style none + + :border 5px solid #666 + :-webkit-box-shadow 0 0 5px #666 + :-moz-box-shadow 0 0 5px #666 + + :text-shadow 0 2px #fff + :color #000 + + > li + :font + :weight bold + + :padding 8px + :right 15px + :border + :top 1px solid #fff + :bottom 1px solid #ccc + + &:first-child + :border + :top none + &:last-child + :border + :bottom none + a + :display block + :height 100% + + &:hover + :background + :color #eee + form :position relative @@ -360,6 +412,10 @@ ul.comment_set :color #999 :font :weight normal + &:hover + :text + :decoration underline + :background none .destroy_link :display none