From 98bcad5c592847b94278555bb9fb87e5de218cf6 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Fri, 7 Jan 2011 12:32:25 -0800 Subject: [PATCH] visual fixes on people/show. contact count on aspect filters. contact list searches again. --- app/controllers/application_controller.rb | 2 +- app/views/aspects/_aspect.haml | 7 ++--- app/views/aspects/_aspect_listings.haml | 5 +++- app/views/layouts/_header.html.haml | 3 +-- app/views/people/show.html.haml | 33 +++++++++-------------- app/views/photos/_index.html.haml | 1 - public/javascripts/contact-list.js | 8 +++--- public/javascripts/view.js | 9 +++++++ public/stylesheets/sass/application.sass | 23 +++++++++++----- 9 files changed, 51 insertions(+), 40 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4542f29f1..3f077160a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -16,7 +16,7 @@ class ApplicationController < ActionController::Base if user_signed_in? @aspect = nil @object_aspect_ids = [] - @all_aspects = current_user.aspects.fields(:name) + @all_aspects = current_user.aspects.fields(:name, :contacts) @aspects_dropdown_array = @all_aspects.collect{|x| [x.to_s, x.id]} @notification_count = Notification.for(current_user, :unread =>true).all.count end diff --git a/app/views/aspects/_aspect.haml b/app/views/aspects/_aspect.haml index 7a1299e88..79a88ff12 100644 --- a/app/views/aspects/_aspect.haml +++ b/app/views/aspects/_aspect.haml @@ -1,7 +1,8 @@ -%li{:data=>{:guid=>aspect.id}} +%li{:data=>{:guid=>aspect.id}, :class => ("dull" if contacts.length == 0)} .right - = link_to t('contacts', :count => contact_count), edit_aspect_path(aspect), :rel => 'facebox' - %b{:class => ("dull" if contacts.length == 0)} + %b + = link_to t('contacts', :count => contact_count), edit_aspect_path(aspect), :rel => 'facebox' + %b = aspect.name %br diff --git a/app/views/aspects/_aspect_listings.haml b/app/views/aspects/_aspect_listings.haml index c64025e7f..4810bfda1 100644 --- a/app/views/aspects/_aspect_listings.haml +++ b/app/views/aspects/_aspect_listings.haml @@ -4,8 +4,11 @@ %h4 + .right + = link_to t('contacts', :count => @contacts.count), aspects_manage_path + + = @aspect_hashes.count = t('_aspects') - = link_to @aspect_hashes.count, aspects_manage_path %ul - for a_hash in aspect_hashes diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 550aaf415..bd5803ced 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -46,8 +46,7 @@ - for aspect in @all_aspects %li{:data=>{:guid=>aspect.id}, :class => ("selected" if @object_aspect_ids.include?(aspect.id))} - = link_for_aspect(aspect, :class => 'aspect_selector') - = link_to '▼', edit_aspect_path(aspect), :class => 'aspect_selector_edit', :rel => 'facebox' + = link_for_aspect(aspect, :class => 'aspect_selector', :title => "#{aspect.contacts.count} contacts") %li = link_to '+', '#add_aspect_pane', :class => "add_aspect_button", :title => t('aspects.manage.add_a_new_aspect'), :rel => 'facebox' diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 793bd8701..0561c3eb6 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -5,19 +5,6 @@ - content_for :page_title do = @person.name -.span-24.last - #author_info - .from{:style=>"padding-left:0;display:block;"} - %h2{:style=>"display:block;"} - = @person.name - .right{:style => "top:0;"} - %span.description - = @person.diaspora_handle - - #person_nav_links - = link_to t('layouts.header.view_profile'), person_path(@person) - = link_to t('_photos'), person_photos_path(@person) - .span-8.append-1.last = render :partial => 'people/profile_sidebar', :locals => {:person => @person, :contact => @contact } @@ -31,6 +18,17 @@ = person_image_link person .span-15.last + #author_info + .right#person_nav_links + = link_to t('layouts.header.view_profile'), person_path(@person) + = link_to t('_photos'), person_photos_path(@person) + + %h3 + = @person.name + .description + = @person.diaspora_handle + %hr + - unless @contact || current_user.person == @person - if @incoming_request .floating @@ -42,18 +40,11 @@ - if @posts.count > 0 -if @post_type == :photos - %h4 - = t('_photos') = render 'photos/index', :photos => @posts - else - %h4 - - if @contact - = t('.recent_posts') - - else - = t('.recent_public_posts') - #main_stream.stream = render 'shared/stream', :posts => @post_hashes + = will_paginate @posts - else diff --git a/app/views/photos/_index.html.haml b/app/views/photos/_index.html.haml index 5550d5ef9..9c1e42e72 100644 --- a/app/views/photos/_index.html.haml +++ b/app/views/photos/_index.html.haml @@ -4,7 +4,6 @@ - content_for :head do - :javascript $(document).ready(function(){ $("#thumbnails").find("img").bind("mouseenter",function(){ diff --git a/public/javascripts/contact-list.js b/public/javascripts/contact-list.js index 18bbc1360..c8a7e20fd 100644 --- a/public/javascripts/contact-list.js +++ b/public/javascripts/contact-list.js @@ -7,7 +7,7 @@ $(document).ready(function() { var List = { initialize: function() { - $(".contact_list_search").keyup(function(e) { + $(".contact_list_search").live("keyup", function(e) { var search = $(this); var list = $(this).siblings("ul").first(); var query = new RegExp(search.val(),'i'); @@ -15,11 +15,11 @@ $(document).ready(function() { $("li", list).each( function() { var element = $(this); if( !element.text().match(query) ) { - if( !element.hasClass('invis') ) { - element.addClass('invis').fadeOut(100); + if( !element.hasClass('hidden') ) { + element.addClass('hidden'); } } else { - element.removeClass('invis').fadeIn(100); + element.removeClass('hidden'); } }); }); diff --git a/public/javascripts/view.js b/public/javascripts/view.js index a7dfc2319..444eb31f2 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -137,6 +137,15 @@ var View = { } }, + aspect_nav: { + bind: function() { + $("a", "#aspect_nav").tipsy({ + gravity:"n", + delayIn: 600 + }); + } + }, + avatars: { bind: function() { $("#aspect_listings img.avatar, #manage_aspect_zones img.avatar").tipsy({ diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index f1732ca53..f2cfd5572 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -246,7 +246,7 @@ header &:hover :background - :color #fafafa + :color #fff :border :bottom 1px solid #ddd .right @@ -294,9 +294,8 @@ header .from :padding 0 - h2,h3 - :margin - :bottom -2px + h3 + :display inline-block #person_nav_links a @@ -912,6 +911,9 @@ label :min-width 100px :height 100px :min-height 100px + :margin + :bottom 15px + :right 15px img :height 100px @@ -1232,13 +1234,20 @@ ul#settings_nav :margin 0 :padding 0 -#aspect_listings - .dull :color #aaa :font :style italic + a + :color #69AEDD + + &:hover + :color #82DAE9 + + &:active + :color #005D9C + .section :margin :bottom 24px @@ -1669,7 +1678,6 @@ ul#request_result :padding 0 > li - :display block :position relative :height 50px :padding 4px @@ -2162,3 +2170,4 @@ ul.show_comments :border :bottom 1px solid #ccc +