collapsed aspect_listing and contact_listing on aspects/index

This commit is contained in:
danielvincent 2011-01-06 18:09:12 -08:00
parent 3ff4b67ff0
commit c9307305b3
11 changed files with 74 additions and 59 deletions

View file

@ -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]

View file

@ -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])

View file

@ -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])

View file

@ -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

View file

@ -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')

View file

@ -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,6 +16,7 @@
:post_hashes => @post_hashes
.span-7.last
#home_user_badge
= owner_image_link
%h3{:style => "position:relative;display:inline-block;margin-left:12px;top:-8px;"}
= current_user.name
@ -24,32 +24,14 @@
= link_to current_user.diaspora_handle, person_path(current_user.person)
/= info_text(t('.handle_explanation'))
%hr
- if @request_count > 0
#new_request_pane{:class => "everyone"}
%h1.new_request{:style => 'text-align:center'}
= 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')

View file

@ -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)) %>");

View file

@ -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

View file

@ -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.
- 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

View file

@ -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
});
}

View file

@ -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