diff --git a/Changelog.md b/Changelog.md index cac9e22d9..55c78aee4 100644 --- a/Changelog.md +++ b/Changelog.md @@ -33,6 +33,7 @@ * User interface enhancements [#3832](https://github.com/diaspora/diaspora/pull/3832), [#3839](https://github.com/diaspora/diaspora/pull/3839), [#3834](https://github.com/diaspora/diaspora/pull/3834), [#3840](https://github.com/diaspora/diaspora/issues/3840), [#3846](https://github.com/diaspora/diaspora/issues/3846), [#3851](https://github.com/diaspora/diaspora/issues/3851), [#3828](https://github.com/diaspora/diaspora/issues/3828), [#3874](https://github.com/diaspora/diaspora/issues/3874), [#3806](https://github.com/diaspora/diaspora/issues/3806), [#3906](https://github.com/diaspora/diaspora/issues/3906). * Show links in sidebar [#3827](https://github.com/diaspora/diaspora/pull/3827) * Add settings web mobile. [#3701](https://github.com/diaspora/diaspora/pull/3701) +* Stream form on profile page [#3910](https://github.com/diaspora/diaspora/issues/3910). ## Bug Fixes diff --git a/app/assets/javascripts/people.js b/app/assets/javascripts/people.js index 68a947224..4f0d7958a 100644 --- a/app/assets/javascripts/people.js +++ b/app/assets/javascripts/people.js @@ -4,4 +4,5 @@ */ //= require aspect-edit-pane //= require fileuploader-custom -//= require jquery.autoSuggest.custom \ No newline at end of file +//= require jquery.autoSuggest.custom +//= require jquery.textchange \ No newline at end of file diff --git a/app/assets/stylesheets/application.css.sass b/app/assets/stylesheets/application.css.sass index 10562f8b6..5b1a6a703 100644 --- a/app/assets/stylesheets/application.css.sass +++ b/app/assets/stylesheets/application.css.sass @@ -679,7 +679,6 @@ form p.checkbox_select form textarea :resize none - :width 455px :height 50px :margin 0 diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index bef5341e8..1b0e4589b 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -60,7 +60,7 @@ class StatusMessagesController < ApplicationController current_user.participate!(@status_message) - if coming_from_profile_page? # if this is a post coming from a profile page + if coming_from_profile_page? && !own_profile_page? # if this is a post coming from a profile page flash[:notice] = successful_mention_message end @@ -96,6 +96,10 @@ class StatusMessagesController < ApplicationController request.env['HTTP_REFERER'].include?("people") end + def own_profile_page? + request.env['HTTP_REFERER'].include?("/people/" + params[:status_message][:author][:guid].to_s) + end + def normalize_public_flag! # mobile || desktop conditions sm = params[:status_message] diff --git a/app/views/aspects/_aspect_stream.haml b/app/views/aspects/_aspect_stream.haml index 7b6121685..46957d3ce 100644 --- a/app/views/aspects/_aspect_stream.haml +++ b/app/views/aspects/_aspect_stream.haml @@ -2,8 +2,9 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -%h3#aspect_stream_header.stream_title - = stream.title +- if user_signed_in? && @person != current_user.person + %h3#aspect_stream_header.stream_title + = stream.title = render 'shared/publisher', :selected_aspects => stream.aspects, :aspect_ids => stream.aspect_ids, :for_all_aspects => stream.for_all_aspects?, :aspect => stream.aspect = render 'aspects/no_posts_message' diff --git a/app/views/people/_sub_header.html.haml b/app/views/people/_sub_header.html.haml index f2dbb57b3..750a3263d 100644 --- a/app/views/people/_sub_header.html.haml +++ b/app/views/people/_sub_header.html.haml @@ -29,5 +29,7 @@ = t('.you_have_no_tags') %span.add_tags = link_to t('.add_some'), edit_profile_path - + %hr + - if user_signed_in? && person == current_user.person + = render 'aspects/aspect_stream', :stream => @stream %hr diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 6ee3f982a..9dd05ad6a 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -5,8 +5,9 @@ - content_for :head do = javascript_include_tag :people - :javascript - Mentions.options.prefillMention = Mentions._contactToMention(#{@person.to_json}); + - if user_signed_in? && @person != current_user.person + :javascript + Mentions.options.prefillMention = Mentions._contactToMention(#{@person.to_json}); - content_for :page_title do = @person.name diff --git a/features/posts_from_profile_page.feature b/features/posts_from_profile_page.feature new file mode 100644 index 000000000..99f69c6d5 --- /dev/null +++ b/features/posts_from_profile_page.feature @@ -0,0 +1,47 @@ +@javascript +Feature: posting from own profile page + In order to be all cool and stuff + I want to post from my profile page + + Background: + Given I am on the home page + And a user with username "alice" + When I sign in as "alice@alice.alice" + + Given I have following aspects: + | Family | + | Work | + + Scenario: posting some text + Given I am on "alice@alice.alice"'s page + And I have turned off jQuery effects + And I append "I want to understand people" to the publisher + And I select "Family" on the aspect dropdown + + And I press "Share" + And I wait for the ajax to finish + + Then I should see "I want to understand people" + + When I am on the home page + Then I should see "I want to understand people" + + When I am on the aspects page + And I select only "Family" aspect + Then I should see "I want to understand people" + + When I select only "Work" aspect + Then I should not see "I want to understand people" + + Scenario: post a photo with text + Given I expand the publisher + When I attach the file "spec/fixtures/button.png" to hidden element "file" within "#file-upload" + When I fill in the following: + | status_message_fake_text | who am I? | + + And I press "Share" + And I wait for the ajax to finish + + When I am on the home page + Then I should see a "img" within ".stream_element div.photo_attachments" + And I should see "who am I?" within ".stream_element" diff --git a/features/step_definitions/posts_steps.rb b/features/step_definitions/posts_steps.rb index 28572573f..8282b09e5 100644 --- a/features/step_definitions/posts_steps.rb +++ b/features/step_definitions/posts_steps.rb @@ -64,3 +64,13 @@ end When /^I open the show page of the "([^"]*)" post$/ do |post_text| visit post_path_by_content(post_text) end + +When /^I select "([^"]*)" on the aspect dropdown$/ do |text| + page.execute_script( + "$('#publisher .dropdown .dropdown_list') + .find('li').each(function(i,el){ + var elem = $(el); + if ('" + text + "' == $.trim(elem.text()) ) { + elem.click(); + }});") +end