diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 12e3d4326..a294bff0a 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -24,7 +24,7 @@ class AspectsController < ApplicationController @contacts = Contact.all(:aspect_ids.in => @aspect_ids, :user_id => current_user.id, :pending => false) @contact_hashes = hashes_for_contacts @contacts - @aspect_hashes = hashes_for_aspects @all_aspects, @contacts, :limit => 8 + @aspect_hashes = hashes_for_aspects @aspects, @contacts, :limit => 8 @aspect = :all unless params[:a_ids] diff --git a/app/views/aspects/_aspect.haml b/app/views/aspects/_aspect.haml index 367768b03..a0d499fc0 100644 --- a/app/views/aspects/_aspect.haml +++ b/app/views/aspects/_aspect.haml @@ -1,4 +1,11 @@ %li .right - = t('contacts', :count => contact_count) - = link_to aspect.name, edit_aspect_path(aspect), :rel => 'facebox' + = link_to t('contacts', :count => contact_count), edit_aspect_path(aspect), :rel => 'facebox' + %b{:class => ("dull" if contacts.length == 0)} + = aspect.name + %br + + - if contacts.length > 0 + .contacts + - for hash in contacts[0..16] + = person_image_link(hash[:person]) diff --git a/app/views/aspects/_aspect_contact_pictures.haml b/app/views/aspects/_aspect_contact_pictures.haml deleted file mode 100644 index 60edb6e25..000000000 --- a/app/views/aspects/_aspect_contact_pictures.haml +++ /dev/null @@ -1,11 +0,0 @@ --# Copyright (c) 2010, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3 or later. See --# the COPYRIGHT file. - - -%h4 - = t('_contacts') - = link_to @contact_hashes.count, '#' - -- for contact in contact_hashes - = person_image_link(contact[:person]) diff --git a/app/views/aspects/_aspect_listings.haml b/app/views/aspects/_aspect_listings.haml new file mode 100644 index 000000000..c64025e7f --- /dev/null +++ b/app/views/aspects/_aspect_listings.haml @@ -0,0 +1,12 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + + +%h4 + = t('_aspects') + = link_to @aspect_hashes.count, aspects_manage_path + +%ul + - for a_hash in aspect_hashes + = render :partial => 'aspects/aspect', :locals => a_hash diff --git a/app/views/aspects/_no_posts_message.haml b/app/views/aspects/_no_posts_message.haml index 55627ccd7..d486a64eb 100644 --- a/app/views/aspects/_no_posts_message.haml +++ b/app/views/aspects/_no_posts_message.haml @@ -2,7 +2,7 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -#no_posts.floating.empty_message{:style => ("display:none" unless post_count == 0 && contact_count > 0)} +#no_posts.floating.empty_message{:class => ("hidden" unless post_count == 0)} .null_arrow ⇧ %h3=t('.start_talking') diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index 1c5494b53..77d74215c 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -8,7 +8,6 @@ .span-15.append-2 /= render 'aspects/no_contacts_message', :aspect => @aspect, :contact_count => @contacts.count - /= render 'aspects/no_posts_message', :post_count => @post_hashes.length, :contact_count => @contacts.count #aspect_stream_container = render 'aspect_stream', @@ -17,14 +16,13 @@ :post_hashes => @post_hashes .span-7.last - = owner_image_link - %h3{:style => "position:relative;display:inline-block;margin-left:12px;top:-8px;"} - = current_user.name - .description - = link_to current_user.diaspora_handle, person_path(current_user.person) - /= info_text(t('.handle_explanation')) - - %hr + #home_user_badge + = owner_image_link + %h3{:style => "position:relative;display:inline-block;margin-left:12px;top:-8px;"} + = current_user.name + .description + = link_to current_user.diaspora_handle, person_path(current_user.person) + /= info_text(t('.handle_explanation')) - if @request_count > 0 #new_request_pane{:class => "everyone"} @@ -32,24 +30,8 @@ = new_request_link(@request_count) #left_pane - .section.aspect_listings - %h4 - = t('_aspects') - = link_to @all_aspects.count, aspects_manage_path - - %ul - - for a_hash in @aspect_hashes - = render :partial => 'aspects/aspect', :locals => a_hash - - .section.contact_pictures - #aspect_contact_pictures - = render 'aspects/aspect_contact_pictures', :contact_hashes => @contact_hashes - - - if @contacts.count == 0 - %h4 - = t('.no_contacts') - = form_tag(people_path, :method => 'get') do - = text_field_tag 'q', nil, :placeholder => t('search'), :type => 'search', :results => 5 + #aspect_listings.section + = render 'aspects/aspect_listings', :aspect_hashes => @aspect_hashes .section %h4= t('shared.invitations.invites') diff --git a/app/views/aspects/index.js.erb b/app/views/aspects/index.js.erb index 16980c787..24bf9b40e 100644 --- a/app/views/aspects/index.js.erb +++ b/app/views/aspects/index.js.erb @@ -1,2 +1,2 @@ $('#aspect_stream_container').html("<%= escape_javascript(render('aspects/aspect_stream', :aspect => @aspect, :aspect_ids => @aspect_ids, :post_hashes => @post_hashes)) %>"); -$('#aspect_contact_pictures').html("<%= escape_javascript(render('aspects/aspect_contact_pictures', :contact_hashes => @contact_hashes)) %>"); +$('#aspect_listings').html("<%= escape_javascript(render('aspects/aspect_listings', :aspect_hashes => @aspect_hashes)) %>"); diff --git a/app/views/aspects/show.html.haml b/app/views/aspects/show.html.haml index 71a10a393..2a192448f 100644 --- a/app/views/aspects/show.html.haml +++ b/app/views/aspects/show.html.haml @@ -21,11 +21,9 @@ = render 'aspects/aspect_contacts', :contacts => @aspect_contacts, :aspect => @aspect = render 'aspects/edit_aspect_pane', :contacts => @all_contacts, :aspect => @aspect - .span-15.last = render 'shared/publisher', :aspect => @aspect = render 'aspects/no_contacts_message', :aspect => @aspect, :contact_count => @aspect_contacts_count, :options => false - = render 'aspects/no_posts_message', :post_count => @post_count, :contact_count=> @aspect_contacts_count #main_stream.stream{:data => {:guids => @aspect.id}} = render 'shared/stream', :posts => @post_hashes diff --git a/app/views/shared/_stream.haml b/app/views/shared/_stream.haml index bbe215430..d3b2dea9f 100644 --- a/app/views/shared/_stream.haml +++ b/app/views/shared/_stream.haml @@ -1,5 +1,11 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -- for post_hash in posts - = render 'shared/stream_element', post_hash.merge(:all_aspects => @all_aspects, :commenting_disabled => defined?(@commenting_disabled)) + + +- if posts.length > 0 + - for post_hash in posts + = render 'shared/stream_element', post_hash.merge(:all_aspects => @all_aspects, :commenting_disabled => defined?(@commenting_disabled)) + +- else + = render 'aspects/no_posts_message', :post_count => posts.length diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 171476f49..a7dfc2319 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -139,7 +139,7 @@ var View = { avatars: { bind: function() { - $(".contact_pictures img.avatar, #manage_aspect_zones img.avatar").tipsy({ + $("#aspect_listings img.avatar, #manage_aspect_zones img.avatar").tipsy({ live: true }); } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 06b41d7a2..fdd15866e 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -1208,16 +1208,18 @@ ul#settings_nav :background :color transparent -.contact_pictures - :margin - :top 12px - :line-height 1em +.contact_pictures, +#aspect_listings li img :margin - :right 1px - :bottom 2px - :width 35px - :height 35px + :right 2px + :bottom 0px + :width 29px + :height 29px + + h5 + :margin + :bottom 6px .contact_pictures.horizontal img @@ -1231,7 +1233,7 @@ ul#settings_nav :padding 0 #left_pane - .aspect_listings + #aspect_listings a :font :weight bold @@ -1246,13 +1248,21 @@ ul#settings_nav > li :position relative +.dull + :color #aaa + :font + :style italic + +#aspect_listings + .contacts + :margin + :top 6px -.aspect_listings ul :padding 0 :margin 0 > li - :padding 6px + :padding 8px 0 :border :bottom 1px solid #ddd @@ -2151,3 +2161,14 @@ ul.show_comments :position absolute :left 6px +#home_user_badge + h3 + :margin + :bottom 0 + :margin + :bottom 2em + :padding + :bottom 1em + + :border + :bottom 1px solid #ccc