diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 370074bb0..ca10f539d 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -18,6 +18,8 @@ class AspectsController < ApplicationController @contacts_sharing_with = current_user.contacts.sharing.includes(:person => :profile) end + aspect_ids = @aspects.map{|a| a.id} + #No aspect_listings on infinite scroll @aspects = @aspects.includes(:contacts => {:person => :profile}) unless params[:only_posts] @@ -27,7 +29,9 @@ class AspectsController < ApplicationController return end - @selected_contacts = @aspects.map { |aspect| aspect.contacts }.flatten.uniq unless params[:only_posts] + @selected_contacts = Contact.joins(:aspect_memberships). + where(:aspect_memberships => {:aspect_id => aspect_ids}). + includes(:person => :profile).limit(20) unless params[:only_posts] @aspect_ids = @aspects.map { |a| a.id } posts = current_user.visible_posts(:by_members_of => @aspect_ids, diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index 572acf86f..395890f06 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -9,20 +9,42 @@ .span-5.leftNavBar #home_user_badge = owner_image_link - %h4{:style => "position:relative;"} + %h3 = current_user.first_name .section = render 'aspects/aspect_listings' .span-13.append-1 - #aspect_stream_container + #aspect_stream_container.stream_container = render 'aspect_stream', :aspect => @aspect, :aspect_ids => @aspect_ids, :posts => @posts .span-5.rightBar.last + #selected_aspect_contacts.section + .title.no_icon + %h5 + = "Contacts (#{@selected_contacts.size})" + + .content + - for contact in @selected_contacts + = person_image_link contact.person + = person_image_link contact.person + = person_image_link contact.person + = person_image_link current_user.person + = person_image_link current_user.person + = person_image_link contact.person + = person_image_link contact.person + = person_image_link current_user.person + = person_image_link contact.person + = person_image_link contact.person + = person_image_link current_user.person + = person_image_link contact.person + + #edit_this_aspect + = link_to "View all contacts", "#" .section .title diff --git a/app/views/people/_profile_sidebar.html.haml b/app/views/people/_profile_sidebar.html.haml index 048d331d5..4324d466a 100644 --- a/app/views/people/_profile_sidebar.html.haml +++ b/app/views/people/_profile_sidebar.html.haml @@ -20,7 +20,7 @@ %br %br -if contact.sharing? || person == current_user.person - %hr{:style=>"width:300px;"} + %hr %ul#profile_information - unless person.profile.bio.blank? %li @@ -35,7 +35,7 @@ %div{ :class => direction_for(person.profile.location) } = markdownify(person.profile.location, :newlines => true) - %li.span-8.last + %li .span-4 - unless person.profile.gender.blank? %h4 @@ -47,3 +47,5 @@ %h4 =t('.born') = birthday_format(person.profile.birthday) + %br + %br diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index af6f3f652..0310a4726 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -9,12 +9,12 @@ - content_for :page_title do = @person.name -.span-8.append-1.last +.span-8 = render :partial => 'people/profile_sidebar', :locals => {:person => @person, :contact => @contact } - if user_signed_in? && @contact.persisted? && @contacts_of_contact.count > 0 .span-8.last#contacts_of_contact - %hr{:style=>"width:300px;"} + %hr .section.contact_pictures %h4 = t('contacts', :count => @contacts_of_contact_count) @@ -24,42 +24,42 @@ %p.see_all= link_to t('.see_all'), person_contacts_path(@person) .span-15.last - #author_info - - if user_signed_in? && current_user.person != @person - .right - = render 'aspect_memberships/aspect_dropdown', :contact => @contact, :person => @person, :hang => 'left' + .stream_container + #author_info + - if user_signed_in? && current_user.person != @person + .right + = render 'aspect_memberships/aspect_dropdown', :contact => @contact, :person => @person, :hang => 'left' + %h2 + = @person.name + %span.diaspora_handle + = @person.diaspora_handle - %h3 - = @person.name - %span.diaspora_handle - = @person.diaspora_handle + .description + - if !@person.profile.tag_string.blank? && user_signed_in? && (@contact.persisted? || @person == current_user.person || @incoming_request) + = @person.profile.format_tags(@person.profile.tag_string) + - if user_signed_in? && @person == current_user.person + %span.hover_edit + = link_to t('.edit'), edit_profile_path + - else + - if user_signed_in? && @person == current_user.person + %i + = t('.you_have_no_tags') + %span.add_tags + = link_to t('.add_some'), edit_profile_path - .description - - if !@person.profile.tag_string.blank? && user_signed_in? && (@contact.persisted? || @person == current_user.person || @incoming_request) - = @person.profile.format_tags(@person.profile.tag_string) - - if user_signed_in? && @person == current_user.person - %span.hover_edit - = link_to t('.edit'), edit_profile_path - - else - - if user_signed_in? && @person == current_user.person - %i - = t('.you_have_no_tags') - %span.add_tags - = link_to t('.add_some'), edit_profile_path + %hr - %hr + - if @posts.length > 0 + -if @post_type == :photos + = render 'photos/index', :photos => @posts + - else + #main_stream.stream + = render 'shared/stream', :posts => @posts, :commenting_disabled => @commenting_disabled + #pagination + =link_to(t('more'), next_page_path, :class => 'paginate') - - if @posts.length > 0 - -if @post_type == :photos - = render 'photos/index', :photos => @posts - else - #main_stream.stream - = render 'shared/stream', :posts => @posts, :commenting_disabled => @commenting_disabled - #pagination - =link_to(t('more'), next_page_path, :class => 'paginate') - - - else - #stream - %li{:style=>"text-align:center;"} - .dull= t('.no_posts') + #stream + %li{:style=>"text-align:center;"} + .dull= t('.no_posts') diff --git a/db/seeds.rb b/db/seeds.rb index 7d8dd676c..d5faad93e 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -19,9 +19,18 @@ alice = Factory(:user_with_aspect, :username => "alice", :password => 'evankorth bob = Factory(:user_with_aspect, :username => "bob", :password => 'evankorth', :invites => 10) eve = Factory(:user_with_aspect, :username => "eve", :password => 'evankorth', :invites => 10) -alice.person.profile.update_attributes(:first_name => "Alice", :last_name => "Smith") -bob.person.profile.update_attributes(:first_name => "Bob", :last_name => "Grimm") -eve.person.profile.update_attributes(:first_name => "Eve", :last_name => "Doe") +alice.person.profile.update_attributes(:first_name => "Alice", :last_name => "Smith", + :image_url => "/images/user/uma.jpg", + :image_url_small => "/images/user/uma.jpg", + :image_url_medium => "/images/user/uma.jpg") +bob.person.profile.update_attributes(:first_name => "Bob", :last_name => "Grimm", + :image_url => "/images/user/wolf.jpg", + :image_url_small => "/images/user/wolf.jpg", + :image_url_medium => "/images/user/wolf.jpg") +eve.person.profile.update_attributes(:first_name => "Eve", :last_name => "Doe", + :image_url => "/images/user/angela.jpg", + :image_url_small => "/images/user/angela.jpg", + :image_url_medium => "/images/user/angela.jpg") connect_users(bob, bob.aspects.first, alice, alice.aspects.first) connect_users(bob, bob.aspects.first, eve, eve.aspects.first) diff --git a/public/images/user/angela.jpg b/public/images/user/angela.jpg new file mode 100644 index 000000000..ee7516050 Binary files /dev/null and b/public/images/user/angela.jpg differ diff --git a/public/images/user/uma.jpg b/public/images/user/uma.jpg new file mode 100644 index 000000000..a299280c5 Binary files /dev/null and b/public/images/user/uma.jpg differ diff --git a/public/images/user/wolf.jpg b/public/images/user/wolf.jpg new file mode 100644 index 000000000..1322ec6d2 Binary files /dev/null and b/public/images/user/wolf.jpg differ diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 22e11db44..37cf9545b 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -4,16 +4,6 @@ */ var View = { initialize: function() { - - $(window).scroll(function(){ - var header = $('header'); - if( $(this).scrollTop() > 30){ - header.addClass('fixit'); - } else { - header.removeClass('fixit'); - } - }); - /* Buttons */ $("input:submit").addClass("button"); diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 2c2675e96..e71216268 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -7,10 +7,9 @@ body :padding 2em :margin 0 - :top 40px + :top 33px :background-color $background a - :color #107FC9 :color $blue :text :decoration none @@ -28,9 +27,7 @@ h1 :font :weight bold -h1, h2, h3 - -h4 +h1, h2, h3, h4 :margin :bottom 5px @@ -129,8 +126,8 @@ form :margin 0 header - @include box-shadow(0,1px,3px,#222) - @include linear-gradient(rgba(25,20,20,0.95),rgba(25,20,20,1)) + @include box-shadow(0,0px,2px,#777) + @include linear-gradient(rgba(35,30,30,0.95),rgba(35,30,30,1)) :z-index 50 :padding 0 @@ -138,7 +135,7 @@ header :color #CCC :height 35px - :position absolute + :position fixed :width 100% :top 0 @@ -340,6 +337,7 @@ ul.dropdown .from :padding 0 + h2, h3, h4, h5 @@ -359,6 +357,9 @@ ul.dropdown :margin 0 :padding 0 + .right + :top 10px + #conversation_inbox a &:hover :text @@ -389,7 +390,8 @@ ul.dropdown p :margin - :bottom 0px + :top 2px + :bottom 10px :font :size 12px :line @@ -630,8 +632,6 @@ ul.show_comments, :margin 0 :top 0.5em :padding 0 - :background - :color #F0F4F5 :font :size 12px @@ -650,9 +650,10 @@ ul.show_comments, li :list :style none - :padding 0.4em + :padding 8px 5px + :border - :bottom 2px solid $background + :bottom 1px dotted #aaa .new_comment :min-height 35px @@ -678,7 +679,11 @@ ul.show_comments, :right 10px .from a - :color #444 + :color rgb(85,80,80) + p + :margin + :bottom 0 + :top 0 .right :right 4px @@ -735,10 +740,8 @@ ul.show_comments, .profile_photo img - @include box-shadow(0,2px,2px,#333) - - :height 300px - :width 300px + :height 200px + :width 200px #profile h3 @@ -2331,14 +2334,14 @@ ul.show_comments, :position absolute :left 0 - h4 + h3 :position relative - :top 16px + :top 13px :padding :bottom 5px :margin - :bottom 60px + :bottom 54px :padding :left 60px @@ -2747,6 +2750,10 @@ h1.tag :padding 2px 0 :left 24px + &.no_icon + :padding + :left 8px + .right :right 4px :top 3px @@ -2756,9 +2763,8 @@ h1.tag h5 :font-size 13px - :font-weight 500 :margin 0 - :color #444 + :color #666 img :position absolute @@ -2771,7 +2777,7 @@ h1.tag :color #999 :font-size 11px :margin - :bottom 4px + :bottom 10px .subtle :color #888 @@ -2921,11 +2927,13 @@ ul.left_nav :display none !important .left_nav + a + :width 150px ul.sub_nav a :width 140px -#aspect_stream_container +.stream_container h3 :margin :bottom 0 @@ -2967,7 +2975,8 @@ ul.left_nav .from :position relative a - :color #444 + :color rgb(85,80,80) + .content :padding :left 40px @@ -3003,3 +3012,20 @@ ul.left_nav .conversation_button :float right + +#selected_aspect_contacts + :margin + :top 30px + + .avatar + :height 26px + :width 26px + :margin + :bottom -2px + +#edit_this_aspect + :text-align center + :margin + :top 5px + :padding 3px + :border 1px dotted #ccc