diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 2ef3fad51..0aa61f15e 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -72,7 +72,7 @@ class AspectsController < ApplicationController @contact = current_user.share_with(@person, @aspect) end else - respond_with @aspect + redirect_to contacts_path(:a_id => @aspect.id) end else respond_to do |format| diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3f5938b38..8ccb079d9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -110,4 +110,12 @@ module ApplicationHelper def controller_index_path self.send((request.filtered_parameters["controller"] + "_path").to_sym) end + + def left_nav_root + if request.filtered_parameters["controller"] == "contacts" + t('contacts.index.my_contacts') + else + t('aspects.index.your_aspects') + end + end end diff --git a/app/views/aspects/_aspect_listings.haml b/app/views/aspects/_aspect_listings.haml index 63b5fec14..43d7eda10 100644 --- a/app/views/aspects/_aspect_listings.haml +++ b/app/views/aspects/_aspect_listings.haml @@ -4,10 +4,10 @@ %ul#aspect_nav.left_nav %li.all_aspects{:class => ("active" if params["set"] != "all" && params["set"] != "only_sharing")} - %a.aspect_selector{:href => controller_index_path, :class => ("sub_selected" if params["a_id"])} + %a.home_selector{:href => controller_index_path, :class => ("sub_selected" if params["a_id"])} .contact_count = my_contacts_count - = t('contacts.index.my_contacts') + = left_nav_root %ul.sub_nav - for aspect in all_aspects diff --git a/app/views/aspects/_aspect_stream.haml b/app/views/aspects/_aspect_stream.haml index b3e239196..76823b474 100644 --- a/app/views/aspects/_aspect_stream.haml +++ b/app/views/aspects/_aspect_stream.haml @@ -12,7 +12,7 @@ %h3 - if @aspect == :all - Stream + = t('.stream') - else = @aspects.to_sentence diff --git a/app/views/aspects/_no_posts_message.haml b/app/views/aspects/_no_posts_message.haml index a0bc6e395..4440aff1b 100644 --- a/app/views/aspects/_no_posts_message.haml +++ b/app/views/aspects/_no_posts_message.haml @@ -4,5 +4,6 @@ #no_posts.empty_message{:class => ("hidden" unless post_count == 0)} %h4 - =t('.start_talking') + = t('.start_talking') + = link_to t('.try_adding_some_more_contacts'), contacts_path diff --git a/app/views/aspects/_selected_contacts.html.haml b/app/views/aspects/_selected_contacts.html.haml index 5cc025c92..01ef4d5c0 100644 --- a/app/views/aspects/_selected_contacts.html.haml +++ b/app/views/aspects/_selected_contacts.html.haml @@ -1,9 +1,23 @@ #selected_aspect_contacts.section .title.no_icon %h5 - = "Contacts (#{count})" + - if @aspect == :all || @aspect_ids.size > 1 + = "#{t('_contacts')}" + - else + = @aspect.name + = "(#{count})" .content - - for contact in contacts - = person_image_link contact.person + - if contacts.size > 0 + - for contact in contacts + = person_image_link contact.person + + - if @aspect_ids.size > 1 + = link_to t('.view_all_contacts'), contacts_path, :id => "view_all_contacts_link" + - else + = link_to t('.view_all_contacts'), contacts_path(:a_id => @aspect.id), :id => "view_all_contacts_link" + + - else + = t('.no_contacts') + = link_to t('.manage_your_aspects'), contacts_path diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index 46335eb20..050a89788 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -66,4 +66,3 @@ .content = render "shared/invitations", :invites => @invites - diff --git a/app/views/contacts/index.html.haml b/app/views/contacts/index.html.haml index f1789fdda..1907bc014 100644 --- a/app/views/contacts/index.html.haml +++ b/app/views/contacts/index.html.haml @@ -20,8 +20,8 @@ #people_stream.stream.contacts - if @aspect_ #aspect_controls - = link_to "Edit #{@aspect_.name}", edit_aspect_path(@aspect_), :rel => "facebox" - = link_to "start a conversation", new_conversation_path(:aspect_id => @aspect_.id, :name => @aspect_.name), :class => "button conversation_button", :rel => "facebox" + = link_to t('.start_a_conversation'), new_conversation_path(:aspect_id => @aspect_.id, :name => @aspect_.name), :class => "button conversation_button", :rel => "facebox" + = link_to t('.edit_aspect', :name => @aspect_.name), edit_aspect_path(@aspect_), :rel => "facebox" - if @contacts.size > 0 - for contact in @contacts @@ -49,8 +49,8 @@ .info = contact.person.diaspora_handle + = will_paginate @contacts - else %h3.no_contacts = t('.no_contacts') - = will_paginate @contacts diff --git a/app/views/conversations/_show.haml b/app/views/conversations/_show.haml index 5c45327e8..ae75e421a 100644 --- a/app/views/conversations/_show.haml +++ b/app/views/conversations/_show.haml @@ -31,7 +31,7 @@ .content = form_for [conversation, Message.new] do |message| - = message.text_area :text, :rows => 5 + = message.text_area :text, :rows => 5, :tabindex => 1 .right - = message.submit t('.reply').capitalize, :class => 'button' - = message.submit t('cancel'), :name => "reset", :id => "reset_button", :type => "reset", :class => "button" + = message.submit t('cancel'), :name => "reset", :id => "reset_button", :type => "reset", :class => "button", :tabindex => 3 + = message.submit t('.reply').capitalize, :class => 'button creation', :tabindex => 2 diff --git a/app/views/likes/_likes.haml b/app/views/likes/_likes.haml index f1098a305..2d0bd5fae 100644 --- a/app/views/likes/_likes.haml +++ b/app/views/likes/_likes.haml @@ -5,7 +5,7 @@ - if likes.size > 0 .likes_container .likes - = image_tag('icons/heart.png') + = image_tag('icons/heart.svg') = link_to t('.people_like_this', :count => likes.length), "#", :class => "expand_likes" %span.hidden.likes_list = notification_people_link(nil, likes.map{|x| x.author}) diff --git a/app/views/people/_profile_sidebar.html.haml b/app/views/people/_profile_sidebar.html.haml index b56bb4056..5e0d40492 100644 --- a/app/views/people/_profile_sidebar.html.haml +++ b/app/views/people/_profile_sidebar.html.haml @@ -7,11 +7,7 @@ = person_image_link(person, :size => :thumb_large, :to => :photos) - if user_signed_in? - - if person == current_user.person - %p - = link_to t('people.profile_sidebar.edit_my_profile'), edit_profile_path - - - else + - if person != current_user.person - if @contact && @contact.receiving? %br = link_to t('people.show.mention'), new_status_message_path(:person_id => @person.id), :class => 'button', :rel => 'facebox' diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index ad573cea7..03be560af 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -22,12 +22,15 @@ - if @contacts_of_contact.count > 8 %p.see_all= link_to t('.see_all'), person_contacts_path(@person) -.span-15.last +.span-18.last .stream_container #author_info - - if user_signed_in? && current_user.person != @person - .right + .right + - if user_signed_in? && current_user.person != @person = render 'aspect_memberships/aspect_dropdown', :contact => @contact, :person => @person, :hang => 'left' + - else + = link_to t('people.profile_sidebar.edit_my_profile'), edit_profile_path, :class => 'button creation' + %h2 = @person.name %span.diaspora_handle diff --git a/app/views/status_messages/_status_message.haml b/app/views/status_messages/_status_message.haml index 1597f9f0c..fd1b26c3f 100644 --- a/app/views/status_messages/_status_message.haml +++ b/app/views/status_messages/_status_message.haml @@ -5,7 +5,7 @@ - if photos.size > 0 .photo_attachments - = link_to (image_tag photos.first.url(:scaled_full)), photo_path(photos.first) + = link_to (image_tag photos.first.url(:scaled_full)), photo_path(photos.first), :class => "big_stream_photo" - if photos.size > 1 - if photos.size >= 8 - for photo in photos[1..8] diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 2db7f7856..dd262bfd6 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -100,6 +100,7 @@ en: aspect_contacts: done_editing: "done editing" aspect_stream: + stream: "Stream" recently: "recently:" commented_on: "commented on" posted: "posted" @@ -107,6 +108,12 @@ en: edit_aspect: "edit aspect" no_posts_message: start_talking: "Nobody has said anything yet!" + try_adding_some_more_contacts: "Try adding some more contacts." + + selected_contacts: + view_all_contacts: "View all contacts" + no_contacts: "You don't have any contacts here yet." + manage_your_aspects: "Manage your aspects." new: name: "Name" @@ -135,6 +142,7 @@ en: family: "Family" work: "Work" index: + your_aspects: "Your Aspects" handle_explanation: "This is your diaspora id. Like an email address, you can give this to people to reach you." no_contacts: "No contacts" post_a_message: "post a message >>" @@ -186,6 +194,8 @@ en: sharing: people_sharing: "People sharing with you:" index: + edit_aspect: "Edit %{name}" + start_a_conversation: "Start a conversation" add_a_new_aspect: "Add a new aspect" title: "Contacts" your_contacts: "Your Contacts" diff --git a/features/comments.feature b/features/comments.feature index 49713a4da..a414be3f4 100644 --- a/features/comments.feature +++ b/features/comments.feature @@ -15,7 +15,7 @@ Feature: commenting And I fill in "status_message_fake_text" with "Look at this dog" And I press "Share" And I wait for the ajax to finish - And I follow "My Contacts" + And I follow "Your Aspects" Then I should see "Look at this dog" within ".stream_element" And I should see a "img" within ".stream_element div.photo_attachments" Then I log out diff --git a/features/connects_users.feature b/features/connects_users.feature index 812343e66..548832dd6 100644 --- a/features/connects_users.feature +++ b/features/connects_users.feature @@ -48,7 +48,7 @@ Feature: sending and receiving requests And I add the person to my 2nd aspect When I go to the home page - When I follow "My Contacts" + When I follow "Your Aspects" Then I should have 1 contact in "Unicorns" Then I should have 1 contact in "Besties" @@ -60,7 +60,7 @@ Feature: sending and receiving requests Then I go to the destroy user session page When I sign in as "bob@bob.bob" - When I follow "My Contacts" + When I follow "Your Aspects" Then I should have 1 contacts in "Besties" And I am on the home page @@ -79,12 +79,12 @@ Feature: sending and receiving requests And I wait for the ajax to finish When I go to the home page - When I follow "My Contacts" + When I follow "Your Aspects" Then I should have 1 contact in "Super People" Then I go to the destroy user session page When I sign in as "bob@bob.bob" - When I follow "My Contacts" + When I follow "Your Aspects" Then I should have 1 contact in "Besties" Scenario: should not see "Add to aspect" and see mention if already a follower diff --git a/features/disconnects_users.feature b/features/disconnects_users.feature index 14c2cfe0f..fdede04d0 100644 --- a/features/disconnects_users.feature +++ b/features/disconnects_users.feature @@ -42,6 +42,8 @@ Feature: disconnecting users Scenario: remove a non-mutual contact from the aspect edit page When I go to the home page + And I follow "Contacts" + And I follow "Besties" And I follow "Edit Besties" And I wait for the ajax to finish diff --git a/features/manages_aspects.feature b/features/manages_aspects.feature index c2d6fdf39..98bdb147d 100644 --- a/features/manages_aspects.feature +++ b/features/manages_aspects.feature @@ -23,9 +23,9 @@ Feature: User manages contacts Given I am signed in And I have 2 contacts And I have an aspect called "Cat People" - When I follow "My Contacts" + When I follow "Contacts" + And I follow "Cat People" And I follow "Edit Cat People" - And I wait for the ajax to finish And I press the first ".contact_list .button" And I wait for the ajax to finish Then I should have 1 contact in "Cat People" diff --git a/features/posts.feature b/features/posts.feature index 89fabc5a9..0973aa386 100644 --- a/features/posts.feature +++ b/features/posts.feature @@ -20,7 +20,7 @@ Feature: posting Given I expand the publisher When I fill in "status_message_fake_text" with "I am eating a yogurt" And I press "Share" - And I follow "My Contacts" + And I follow "Your Aspects" Then I should see "I am eating a yogurt" within ".stream_element" Scenario: post a photo without text @@ -30,7 +30,7 @@ Feature: posting Then I should see an uploaded image within the photo drop zone And I press "Share" And I wait for the ajax to finish - And I follow "My Contacts" + And I follow "Your Aspects" Then I should see a "img" within ".stream_element:first div.photo_attachments" Then I log out And I sign in as "alice@alice.alice" @@ -44,7 +44,7 @@ Feature: posting And I fill in "status_message_fake_text" with "Look at this dog" And I press "Share" And I wait for the ajax to finish - And I follow "My Contacts" + And I follow "Your Aspects" Then I should see a "img" within ".stream_element:first div.photo_attachments" And I should see "Look at this dog" within ".stream_element:first" Then I log out @@ -76,12 +76,12 @@ Feature: posting When I fill in "status_message_fake_text" with "I am eating a yogurt" And I press "Share" And I wait for the ajax to finish - And I follow "My Contacts" + And I follow "Your Aspects" And I hover over the post And I preemptively confirm the alert And I click to delete the first post And I wait for the ajax to finish - And I follow "My Contacts" + And I follow "Your Aspects" Then I should not see "I am eating a yogurt" Scenario Outline: post to one aspect diff --git a/public/images/icons/heart.svg b/public/images/icons/heart.svg new file mode 100755 index 000000000..c48ac4940 --- /dev/null +++ b/public/images/icons/heart.svg @@ -0,0 +1,9 @@ + + + + + + diff --git a/public/javascripts/publisher.js b/public/javascripts/publisher.js index 0fb01fd41..d533ca4ad 100644 --- a/public/javascripts/publisher.js +++ b/public/javascripts/publisher.js @@ -7,10 +7,12 @@ var Publisher = { close: function(){ Publisher.form().addClass('closed'); + Publisher.form().find("#publisher_textarea_wrapper").removeClass('active'); Publisher.form().find("textarea.ac_input").css('min-height', ''); }, open: function(){ Publisher.form().removeClass('closed'); + Publisher.form().find("#publisher_textarea_wrapper").addClass('active'); Publisher.form().find("textarea.ac_input").css('min-height', '42px'); Publisher.determineSubmitAvailability(); }, diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 1bd28ec29..bc2746938 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -997,6 +997,7 @@ label @include opacity(0.5) #publisher_textarea_wrapper + #hide_publisher @include opacity(0.3) :padding 3px @@ -1012,6 +1013,9 @@ label :border 1px solid #ccc :background #fff + &.active + :border 1px solid #999 + :position relative :padding :right 10px @@ -1620,6 +1624,7 @@ h3 span.current_gs_step :position relative :display inline-block :top 3px + :min-width 170px a:hover :text @@ -2729,10 +2734,10 @@ h1.tag .title :position relative :border - :bottom 1px solid #888 + :bottom 1px solid #ddd :padding 2px 0 :top 0 - :left 24px + :left 22px &.no_icon :padding @@ -2746,7 +2751,7 @@ h1.tag :color #777 h5 - :font-size 13px + :font-size 12px :margin 0 :color #666 @@ -2761,7 +2766,7 @@ h1.tag :color #999 :font-size 11px :margin - :bottom 10px + :bottom 25px .subtle :color #888 @@ -2862,7 +2867,8 @@ ul.left_nav :position relative :width 100% - a.aspect_selector + a.aspect_selector, + a.home_selector :display block :width 100% :padding 3px 7px @@ -2910,7 +2916,8 @@ ul.left_nav :margin 0 li :width 155px - a.aspect_selector + a.aspect_selector, + a.new_aspect :padding :left 15px :width 182px @@ -2923,17 +2930,23 @@ ul.left_nav :display none !important .left_nav - a.aspect_selector + a.aspect_selector, + a.home_selector :width 150px ul.sub_nav :width 140px - a.aspect_selector + + a.aspect_selector, + a.new_aspect :width 140px + li:hover .edit :display inline-block .stream_container + :min-height 500px + h3 :margin :bottom 0 @@ -2958,6 +2971,7 @@ ul.left_nav :color #777 .no_contacts + :position relative :text-align center :top 50px @@ -3022,6 +3036,14 @@ ul.left_nav :margin :bottom -2px +#view_all_contacts_link + @include border-radius(2px) + :display block + :padding 5px + :border 1px dotted #aaa + :text-align center + :margin 5px 0 + .bottom_submit_section :display block :position relative @@ -3036,3 +3058,6 @@ ul.left_nav .left :position absolute :left 0 + +.big_stream_photo + :display block diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index 9a8f6752b..3b1d684fa 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -217,9 +217,9 @@ describe AspectsController do post :create, "aspect" => {"name" => "new aspect"} alice.reload.aspects.count.should == 3 end - it "redirects to the aspect page" do + it "redirects to the aspect's contact page" do post :create, "aspect" => {"name" => "new aspect"} - response.should redirect_to(aspect_path(Aspect.find_by_name("new aspect"))) + response.should redirect_to(contacts_path(:a_id => Aspect.find_by_name("new aspect").id)) end context "with person_id param" do diff --git a/spec/javascripts/publisher-spec.js b/spec/javascripts/publisher-spec.js index d03c98544..80a4042cd 100644 --- a/spec/javascripts/publisher-spec.js +++ b/spec/javascripts/publisher-spec.js @@ -6,13 +6,6 @@ describe("Publisher", function() { describe("initialize", function(){ - it("calls close when it does not have text", function(){ - spec.loadFixture('aspects_index'); - spyOn(Publisher, 'close'); - Publisher.initialize(); - expect(Publisher.close).toHaveBeenCalled(); - }); - it("does not call close when there is prefilled text", function(){ spec.loadFixture('aspects_index_prefill'); spyOn(Publisher, 'close'); @@ -224,6 +217,7 @@ describe("Publisher", function() { Publisher.initialize(); }); it("adds the closed class", function() { + Publisher.form().removeClass('closed'); expect(Publisher.form().hasClass('closed')).toBeFalsy(); Publisher.close(); expect(Publisher.form().hasClass('closed')).toBeTruthy(); diff --git a/spec/javascripts/stream-spec.js b/spec/javascripts/stream-spec.js index 0a7c7c242..b161bac1c 100644 --- a/spec/javascripts/stream-spec.js +++ b/spec/javascripts/stream-spec.js @@ -27,7 +27,7 @@ describe("Stream", function() { {show_more: 'Placeholder'}, 'en'); Stream.initialize(); stream_element = $('#main_stream .stream_element:first'); - expect(stream_element.find(".details").css('display')).toEqual('none'); + expect(stream_element.find("p .details").css('display')).toEqual('none'); expect(stream_element.find(".read-more a").css('display')).toEqual('inline'); stream_element.find(".read-more a").click(); jasmine.Clock.tick(200); @@ -51,7 +51,7 @@ describe("Stream", function() { link = $("a.show_post_comments"); Diaspora.widgets.i18n.loadLocale( {'comments' : {'hide': 'comments.hide pl'}}, 'en'); - expect(link.text()).toEqual("show all comments"); + expect(link.text()).toEqual("Show 1 more comments"); Stream.toggleComments.call( link, {preventDefault: function(){} } );