Merge branch 'master' of github.com:diaspora/diaspora

This commit is contained in:
Sarah Mei 2011-03-22 21:03:43 -07:00
commit 4ff67b0200
10 changed files with 38 additions and 12 deletions

View file

@ -104,7 +104,7 @@ class AspectsController < ApplicationController
def edit def edit
@aspect = current_user.aspects.where(:id => params[:id]).includes(:contacts => {:person => :profile}).first @aspect = current_user.aspects.where(:id => params[:id]).includes(:contacts => {:person => :profile}).first
@contacts = current_user.contacts.includes(:person => :profile) @contacts = current_user.contacts.includes(:person => :profile).all.sort!{|x, y| x.person.profile.first_name <=> y.person.profile.first_name }.reverse!
unless @aspect unless @aspect
render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404 render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404
else else

View file

@ -37,6 +37,7 @@
= t('.to') = t('.to')
.span-10.last .span-10.last
= text_field_tag "contact_autocomplete" = text_field_tag "contact_autocomplete"
.clearfix
.span-2 .span-2
%h4 %h4

View file

@ -2,5 +2,6 @@
-# licensed under the Affero General Public License version 3 or later. See -# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file. -# the COPYRIGHT file.
= person_image_tag(person)
= link_to "#{person.name.titleize}", person_path(person.id) = link_to "#{person.name.titleize}", person_path(person.id)
= object_link(note) = object_link(note)

View file

@ -9,6 +9,7 @@
:javascript :javascript
$(document).ready( function(){ $(document).ready( function(){
$("#user_username").focus();
$("form").submit(function(){ $("form").submit(function(){
$(this).fadeOut(200, function(){ $(this).fadeOut(200, function(){
$('#logo').animate({ $('#logo').animate({

View file

@ -28,31 +28,29 @@
%params %params
#publisher_textarea_wrapper #publisher_textarea_wrapper
%ul#photodropzone %ul#photodropzone
= status.text_area :fake_text, :rows => 2, :value => h(params[:prefill]) = status.text_area :fake_text, :rows => 2, :value => h(params[:prefill]), :tabindex => 1
= status.hidden_field :text, :value => '', :class => 'clear_on_submit' = status.hidden_field :text, :value => '', :class => 'clear_on_submit'
- for aspect_id in aspect_ids - for aspect_id in aspect_ids
= hidden_field_tag 'aspect_ids[]', aspect_id.to_s = hidden_field_tag 'aspect_ids[]', aspect_id.to_s
.options_and_submit .options_and_submit
.mention_helper - if aspect == :profile
- if aspect != :profile .mention_helper
%i= t('.mention_helper_text')
- else
.badges .badges
%i= t('.publishing_to') %i= t('.publishing_to')
= aspect_badges(aspects_with_person, :link => false) = aspect_badges(aspects_with_person, :link => false)
.public_toggle .public_toggle
%span#publisher_service_icons %span#publisher_service_icons
= link_to (image_tag "icons/monotone_wrench_settings.png"), "#question_mark_pane", :class => 'question_mark', :rel => 'facebox', :title => t('shared.public_explain.manage')#, :style=>"display:none;" = link_to (image_tag "icons/monotone_wrench_settings.png"), "#question_mark_pane", :class => 'question_mark', :rel => 'facebox', :title => t('shared.public_explain.manage')
- if aspect == :all || :profile - if aspect == :all || :profile
= status.hidden_field( :public) = status.hidden_field( :public)
= image_tag "icons/globe.png", :title => t('.public'), :class => 'public_icon dim', :width => 16, :height => 16 = image_tag "icons/globe.png", :title => t('.public'), :class => 'public_icon dim', :width => 16, :height => 16
- if current_user.services - if current_user.services
- for service in current_user.services - for service in current_user.services
= image_tag "social_media_logos/#{service.provider}-16x16.png", :title => service.provider, :class => "service_icon dim", :id =>"#{service.provider}" = image_tag "social_media_logos/#{service.provider}-16x16.png", :title => service.provider, :class => "service_icon dim", :id =>"#{service.provider}"
= status.submit t('.share'), :disable_with => t('.posting'), :class => 'button' = status.submit t('.share'), :disable_with => t('.posting'), :class => 'button', :tabindex => 2
.facebox_content .facebox_content
#question_mark_pane #question_mark_pane

View file

@ -276,6 +276,7 @@ en:
notifications: notifications:
request_accepted: "accepted your share request." request_accepted: "accepted your share request."
new_request: "offered to share with you." new_request: "offered to share with you."
private_message: "sent you a message."
comment_on_post: "commented on your" comment_on_post: "commented on your"
also_commented: "also commented on %{post_author}'s" also_commented: "also commented on %{post_author}'s"
mentioned: "has mentioned you in their" mentioned: "has mentioned you in their"
@ -513,7 +514,6 @@ en:
shared: shared:
publisher: publisher:
mention_helper_text: "to mention someone, press '@' and start typing their name"
posting: "Posting..." posting: "Posting..."
share: "Share" share: "Share"
post_a_message_to: "Post a message to %{aspect}" post_a_message_to: "Post a message to %{aspect}"

View file

@ -26,6 +26,6 @@ eve.person.profile.update_attributes(:first_name => "Eve", :last_name => "Doe")
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)
alice.services << Services::Facebook.create(:user_id => alice.id, :uid => 'a1') alice.services << Services::Facebook.create(:user_id => alice.id, :uid => 'a1', :access_token => "secret 1")
bob.services << Services::Facebook.create(:user_id => bob.id, :uid => 'b2') bob.services << Services::Facebook.create(:user_id => bob.id, :uid => 'b2', :access_token => "secret 2")
eve.services << Services::Facebook.create(:user_id => eve.id, :uid => 'e3') eve.services << Services::Facebook.create(:user_id => eve.id, :uid => 'e3', :access_token => "secret 3")

View file

@ -1615,6 +1615,18 @@ h3 span.current_gs_step
:padding 12px :padding 12px
:color #fff :color #fff
:vertical
:align middle
.avatar
:display inline-block
:height 20px
:width 20px
:margin
:right 5px
:vertical
:align middle
.bottom_notification .bottom_notification
:position fixed :position fixed
:bottom 0 :bottom 0

View file

@ -32,6 +32,8 @@ ul.as-selections li.as-selection-item {
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ddeefe), to(#bfe0f1)); background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ddeefe), to(#bfe0f1));
border: 1px solid #acc3ec; border: 1px solid #acc3ec;
padding: 0; padding: 0;
padding-top: 3px;
padding-bottom: 3px;
padding-left: 6px; padding-left: 6px;
border-radius: 5px; border-radius: 5px;
-webkit-border-radius: 5px; -webkit-border-radius: 5px;

View file

@ -284,10 +284,21 @@ describe AspectsController do
end end
describe '#edit' do describe '#edit' do
before do
@bob = bob
@eve = eve
end
it 'renders' do it 'renders' do
get :edit, :id => @alices_aspect_1.id get :edit, :id => @alices_aspect_1.id
response.should be_success response.should be_success
end end
it 'assigns the contacts in alphabetical order' do
connect_users(@alice, @alices_aspect_1, @eve, @eve.aspects.first)
get :edit, :id => @alices_aspect_1.id
assigns[:contacts].should == [@alice.contact_for(@bob.person), @alice.contact_for(@eve.person)]
end
end end
describe "#toggle_contact_visibility" do describe "#toggle_contact_visibility" do