diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e58c66960..2a2188263 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -29,6 +29,16 @@ module ApplicationHelper post.aspect_ids.include?(a.id) end end + def aspect_badge aspects + str = '' + if aspects.count > 1 + str = "All aspects" + elsif aspects.count == 1 + aspect = aspects.first + str = "#{aspect.name}" + end + str.html_safe + end def aspect_links aspects, opts={} str = "" aspects.each do |a| @@ -62,7 +72,7 @@ module ApplicationHelper aspects_path end end - + def object_path(object, opts = {}) return "" if object.nil? object = object.person if object.is_a? User diff --git a/app/views/shared/_author_info.html.haml b/app/views/shared/_author_info.html.haml index e74e197fd..ee5a7c8dd 100644 --- a/app/views/shared/_author_info.html.haml +++ b/app/views/shared/_author_info.html.haml @@ -3,15 +3,15 @@ .from %h2 = person.name - - if current_user.owns?(post) - .aspect - ➔ - %ul - - if post.public? - =t('the_world') - - else - - for aspect in post.aspects - %li= link_to aspect.name, aspect + + - if post.public? + %span.arrow ➔ + %span.aspect_badge.public + =t('the_world') + + - elsif current_user.owns?(post) + %span.arrow ➔ + =aspect_badge(aspects_with_post(post.aspects, post)) #person_nav_links = link_to t('layouts.header.view_profile'), person_path(person) diff --git a/app/views/shared/_stream_element.html.haml b/app/views/shared/_stream_element.html.haml index f6e06f049..fd007d5b9 100644 --- a/app/views/shared/_stream_element.html.haml +++ b/app/views/shared/_stream_element.html.haml @@ -2,32 +2,28 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -%li.message{:data=>{:guid=>post.id}, :class => ('public' if post.public?)} +%li.message{:data=>{:guid=>post.id}} =person_image_link(person) - .public_badge - - if post.public? - = image_tag 'icons/globe.png', :title => "public post" - .content .from + .right + - reshare_aspects = aspects_without_post(aspects, post) + - unless reshare_aspects.empty? + = render 'shared/reshare', :aspects => reshare_aspects, :post => post + = link_to t('delete'), status_message_path(post), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :class => "delete" %h4 =person_link(person) - - if person.owner_id == current_user.id - .aspect - ➔ - %ul - - if post.public? - %li= t('the_world') - - else - =aspect_links(aspects_with_post(aspects, post)) + - if post.public? + %span.arrow ➔ + %span.aspect_badge.public + = t('the_world') + + - elsif person.owner_id == current_user.id + %span.arrow ➔ + =aspect_badge(aspects_with_post(aspects, post)) - .right - - reshare_aspects = aspects_without_post(aspects, post) - - unless reshare_aspects.empty? - = render 'shared/reshare', :aspects => reshare_aspects, :post => post - = link_to t('delete'), status_message_path(post), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :class => "delete" = render 'status_messages/status_message', :post => post, :photos => photos diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 71cedf701..8a7e3abc2 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -12,7 +12,7 @@ a :text :decoration none &:hover - :color #22AAE0 + :color #4CCAE0 &:active :color #005D9C @@ -243,40 +243,21 @@ header :border none :height 370px :width 500px - + .from :text :shadow 0 1px #fff - - .aspect - :cursor default + h4 :display inline - :color #bbb - a - :font - :weight normal - :color #bbb - - &:hover - :text - :decoration underline - &:active - :color #999 - ul - :display inline - :margin 0 - :padding 0 - li - :display inline - &:after - :content "," - &:last-child:after - :content "" - a :font :weight bold +.arrow + :color #ccc + :font + :weight lighter + #author_info :position relative :margin @@ -302,12 +283,6 @@ header :margin :bottom -2px - .aspect - ul > li a - :font - :weight 200 - - #person_nav_links a :margin @@ -1397,7 +1372,6 @@ ul.aspects &:hover :background :color #fafafa - .right :top 12px @@ -1969,20 +1943,6 @@ h3,h4 :font :size 12px -.stream - .public_badge - :position absolute - :top 60px - :left 25px - -.message.public - :background - :color #FEFFF0 - - &:hover - :background - :color #FEFFE3 - #already_invited_pane h4 :color #666 @@ -1995,3 +1955,51 @@ h3,h4 .term :font :weight bold + +.aspect_badge + :color #fff + :line-height auto + :padding 0 4px + + :-webkit-border-radius 3px + :-moz-border-radius 3px + :border-radius 3px + + :display inline-block + + :font + :size smaller + :weight normal + :text + :shadow none + + :cursor default + + a + :color #fff + :font + :weight normal + + &:hover + :color #eee + +.aspect_badge.public + :background + :color #C0E76C + +.aspect_badge.single + :background + :color #999 + +.aspect_badge.all + :background + :color #ccc + +.stream + .arrow, + .aspect_badge + :position relative + .arrow + :top -0.1em + .aspect_badge + :top -0.2em