add contact images to aspect index, removed comment background color, add vertical rule to people pages

This commit is contained in:
danielgrippi 2011-06-30 19:19:41 -07:00
parent ca76db4550
commit 238e859dbe
10 changed files with 132 additions and 79 deletions

View file

@ -18,6 +18,8 @@ class AspectsController < ApplicationController
@contacts_sharing_with = current_user.contacts.sharing.includes(:person => :profile) @contacts_sharing_with = current_user.contacts.sharing.includes(:person => :profile)
end end
aspect_ids = @aspects.map{|a| a.id}
#No aspect_listings on infinite scroll #No aspect_listings on infinite scroll
@aspects = @aspects.includes(:contacts => {:person => :profile}) unless params[:only_posts] @aspects = @aspects.includes(:contacts => {:person => :profile}) unless params[:only_posts]
@ -27,7 +29,9 @@ class AspectsController < ApplicationController
return return
end 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 } @aspect_ids = @aspects.map { |a| a.id }
posts = current_user.visible_posts(:by_members_of => @aspect_ids, posts = current_user.visible_posts(:by_members_of => @aspect_ids,

View file

@ -9,20 +9,42 @@
.span-5.leftNavBar .span-5.leftNavBar
#home_user_badge #home_user_badge
= owner_image_link = owner_image_link
%h4{:style => "position:relative;"} %h3
= current_user.first_name = current_user.first_name
.section .section
= render 'aspects/aspect_listings' = render 'aspects/aspect_listings'
.span-13.append-1 .span-13.append-1
#aspect_stream_container #aspect_stream_container.stream_container
= render 'aspect_stream', = render 'aspect_stream',
:aspect => @aspect, :aspect => @aspect,
:aspect_ids => @aspect_ids, :aspect_ids => @aspect_ids,
:posts => @posts :posts => @posts
.span-5.rightBar.last .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 .section
.title .title

View file

@ -20,7 +20,7 @@
%br %br
%br %br
-if contact.sharing? || person == current_user.person -if contact.sharing? || person == current_user.person
%hr{:style=>"width:300px;"} %hr
%ul#profile_information %ul#profile_information
- unless person.profile.bio.blank? - unless person.profile.bio.blank?
%li %li
@ -35,7 +35,7 @@
%div{ :class => direction_for(person.profile.location) } %div{ :class => direction_for(person.profile.location) }
= markdownify(person.profile.location, :newlines => true) = markdownify(person.profile.location, :newlines => true)
%li.span-8.last %li
.span-4 .span-4
- unless person.profile.gender.blank? - unless person.profile.gender.blank?
%h4 %h4
@ -47,3 +47,5 @@
%h4 %h4
=t('.born') =t('.born')
= birthday_format(person.profile.birthday) = birthday_format(person.profile.birthday)
%br
%br

View file

@ -9,12 +9,12 @@
- content_for :page_title do - content_for :page_title do
= @person.name = @person.name
.span-8.append-1.last .span-8
= render :partial => 'people/profile_sidebar', :locals => {:person => @person, :contact => @contact } = render :partial => 'people/profile_sidebar', :locals => {:person => @person, :contact => @contact }
- if user_signed_in? && @contact.persisted? && @contacts_of_contact.count > 0 - if user_signed_in? && @contact.persisted? && @contacts_of_contact.count > 0
.span-8.last#contacts_of_contact .span-8.last#contacts_of_contact
%hr{:style=>"width:300px;"} %hr
.section.contact_pictures .section.contact_pictures
%h4 %h4
= t('contacts', :count => @contacts_of_contact_count) = t('contacts', :count => @contacts_of_contact_count)
@ -24,42 +24,42 @@
%p.see_all= link_to t('.see_all'), person_contacts_path(@person) %p.see_all= link_to t('.see_all'), person_contacts_path(@person)
.span-15.last .span-15.last
#author_info .stream_container
- if user_signed_in? && current_user.person != @person #author_info
.right - if user_signed_in? && current_user.person != @person
= render 'aspect_memberships/aspect_dropdown', :contact => @contact, :person => @person, :hang => 'left' .right
= render 'aspect_memberships/aspect_dropdown', :contact => @contact, :person => @person, :hang => 'left'
%h2
= @person.name
%span.diaspora_handle
= @person.diaspora_handle
%h3 .description
= @person.name - if !@person.profile.tag_string.blank? && user_signed_in? && (@contact.persisted? || @person == current_user.person || @incoming_request)
%span.diaspora_handle = @person.profile.format_tags(@person.profile.tag_string)
= @person.diaspora_handle - 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 %hr
- 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 - 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 - else
#main_stream.stream #stream
= render 'shared/stream', :posts => @posts, :commenting_disabled => @commenting_disabled %li{:style=>"text-align:center;"}
#pagination .dull= t('.no_posts')
=link_to(t('more'), next_page_path, :class => 'paginate')
- else
#stream
%li{:style=>"text-align:center;"}
.dull= t('.no_posts')

View file

@ -19,9 +19,18 @@ alice = Factory(:user_with_aspect, :username => "alice", :password => 'evankorth
bob = Factory(:user_with_aspect, :username => "bob", :password => 'evankorth', :invites => 10) bob = Factory(:user_with_aspect, :username => "bob", :password => 'evankorth', :invites => 10)
eve = Factory(:user_with_aspect, :username => "eve", :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") alice.person.profile.update_attributes(:first_name => "Alice", :last_name => "Smith",
bob.person.profile.update_attributes(:first_name => "Bob", :last_name => "Grimm") :image_url => "/images/user/uma.jpg",
eve.person.profile.update_attributes(:first_name => "Eve", :last_name => "Doe") :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, alice, alice.aspects.first)
connect_users(bob, bob.aspects.first, eve, eve.aspects.first) connect_users(bob, bob.aspects.first, eve, eve.aspects.first)

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
public/images/user/uma.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
public/images/user/wolf.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View file

@ -4,16 +4,6 @@
*/ */
var View = { var View = {
initialize: function() { initialize: function() {
$(window).scroll(function(){
var header = $('header');
if( $(this).scrollTop() > 30){
header.addClass('fixit');
} else {
header.removeClass('fixit');
}
});
/* Buttons */ /* Buttons */
$("input:submit").addClass("button"); $("input:submit").addClass("button");

View file

@ -7,10 +7,9 @@
body body
:padding 2em :padding 2em
:margin 0 :margin 0
:top 40px :top 33px
:background-color $background :background-color $background
a a
:color #107FC9
:color $blue :color $blue
:text :text
:decoration none :decoration none
@ -28,9 +27,7 @@ h1
:font :font
:weight bold :weight bold
h1, h2, h3 h1, h2, h3, h4
h4
:margin :margin
:bottom 5px :bottom 5px
@ -129,8 +126,8 @@ form
:margin 0 :margin 0
header header
@include box-shadow(0,1px,3px,#222) @include box-shadow(0,0px,2px,#777)
@include linear-gradient(rgba(25,20,20,0.95),rgba(25,20,20,1)) @include linear-gradient(rgba(35,30,30,0.95),rgba(35,30,30,1))
:z-index 50 :z-index 50
:padding 0 :padding 0
@ -138,7 +135,7 @@ header
:color #CCC :color #CCC
:height 35px :height 35px
:position absolute :position fixed
:width 100% :width 100%
:top 0 :top 0
@ -340,6 +337,7 @@ ul.dropdown
.from .from
:padding 0 :padding 0
h2,
h3, h3,
h4, h4,
h5 h5
@ -359,6 +357,9 @@ ul.dropdown
:margin 0 :margin 0
:padding 0 :padding 0
.right
:top 10px
#conversation_inbox a #conversation_inbox a
&:hover &:hover
:text :text
@ -389,7 +390,8 @@ ul.dropdown
p p
:margin :margin
:bottom 0px :top 2px
:bottom 10px
:font :font
:size 12px :size 12px
:line :line
@ -630,8 +632,6 @@ ul.show_comments,
:margin 0 :margin 0
:top 0.5em :top 0.5em
:padding 0 :padding 0
:background
:color #F0F4F5
:font :font
:size 12px :size 12px
@ -650,9 +650,10 @@ ul.show_comments,
li li
:list :list
:style none :style none
:padding 0.4em :padding 8px 5px
:border :border
:bottom 2px solid $background :bottom 1px dotted #aaa
.new_comment .new_comment
:min-height 35px :min-height 35px
@ -678,7 +679,11 @@ ul.show_comments,
:right 10px :right 10px
.from .from
a a
:color #444 :color rgb(85,80,80)
p
:margin
:bottom 0
:top 0
.right .right
:right 4px :right 4px
@ -735,10 +740,8 @@ ul.show_comments,
.profile_photo .profile_photo
img img
@include box-shadow(0,2px,2px,#333) :height 200px
:width 200px
:height 300px
:width 300px
#profile #profile
h3 h3
@ -2331,14 +2334,14 @@ ul.show_comments,
:position absolute :position absolute
:left 0 :left 0
h4 h3
:position relative :position relative
:top 16px :top 13px
:padding :padding
:bottom 5px :bottom 5px
:margin :margin
:bottom 60px :bottom 54px
:padding :padding
:left 60px :left 60px
@ -2747,6 +2750,10 @@ h1.tag
:padding 2px 0 :padding 2px 0
:left 24px :left 24px
&.no_icon
:padding
:left 8px
.right .right
:right 4px :right 4px
:top 3px :top 3px
@ -2756,9 +2763,8 @@ h1.tag
h5 h5
:font-size 13px :font-size 13px
:font-weight 500
:margin 0 :margin 0
:color #444 :color #666
img img
:position absolute :position absolute
@ -2771,7 +2777,7 @@ h1.tag
:color #999 :color #999
:font-size 11px :font-size 11px
:margin :margin
:bottom 4px :bottom 10px
.subtle .subtle
:color #888 :color #888
@ -2921,11 +2927,13 @@ ul.left_nav
:display none !important :display none !important
.left_nav .left_nav
a
:width 150px
ul.sub_nav ul.sub_nav
a a
:width 140px :width 140px
#aspect_stream_container .stream_container
h3 h3
:margin :margin
:bottom 0 :bottom 0
@ -2967,7 +2975,8 @@ ul.left_nav
.from .from
:position relative :position relative
a a
:color #444 :color rgb(85,80,80)
.content .content
:padding :padding
:left 40px :left 40px
@ -3003,3 +3012,20 @@ ul.left_nav
.conversation_button .conversation_button
:float right :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