Merge pull request #3918 from asphxia/3910-stream-form-on-profile-page
Stream form on profile page
This commit is contained in:
commit
c763586a6a
9 changed files with 74 additions and 8 deletions
|
|
@ -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).
|
* 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)
|
* Show links in sidebar [#3827](https://github.com/diaspora/diaspora/pull/3827)
|
||||||
* Add settings web mobile. [#3701](https://github.com/diaspora/diaspora/pull/3701)
|
* 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
|
## Bug Fixes
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,3 +5,4 @@
|
||||||
//= require aspect-edit-pane
|
//= require aspect-edit-pane
|
||||||
//= require fileuploader-custom
|
//= require fileuploader-custom
|
||||||
//= require jquery.autoSuggest.custom
|
//= require jquery.autoSuggest.custom
|
||||||
|
//= require jquery.textchange
|
||||||
|
|
@ -679,7 +679,6 @@ form p.checkbox_select
|
||||||
form
|
form
|
||||||
textarea
|
textarea
|
||||||
:resize none
|
:resize none
|
||||||
:width 455px
|
|
||||||
:height 50px
|
:height 50px
|
||||||
:margin 0
|
:margin 0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ class StatusMessagesController < ApplicationController
|
||||||
|
|
||||||
current_user.participate!(@status_message)
|
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
|
flash[:notice] = successful_mention_message
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -96,6 +96,10 @@ class StatusMessagesController < ApplicationController
|
||||||
request.env['HTTP_REFERER'].include?("people")
|
request.env['HTTP_REFERER'].include?("people")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def own_profile_page?
|
||||||
|
request.env['HTTP_REFERER'].include?("/people/" + params[:status_message][:author][:guid].to_s)
|
||||||
|
end
|
||||||
|
|
||||||
def normalize_public_flag!
|
def normalize_public_flag!
|
||||||
# mobile || desktop conditions
|
# mobile || desktop conditions
|
||||||
sm = params[:status_message]
|
sm = params[:status_message]
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,9 @@
|
||||||
-# 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.
|
||||||
|
|
||||||
%h3#aspect_stream_header.stream_title
|
- if user_signed_in? && @person != current_user.person
|
||||||
= stream.title
|
%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 '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'
|
= render 'aspects/no_posts_message'
|
||||||
|
|
|
||||||
|
|
@ -29,5 +29,7 @@
|
||||||
= t('.you_have_no_tags')
|
= t('.you_have_no_tags')
|
||||||
%span.add_tags
|
%span.add_tags
|
||||||
= link_to t('.add_some'), edit_profile_path
|
= link_to t('.add_some'), edit_profile_path
|
||||||
|
%hr
|
||||||
|
- if user_signed_in? && person == current_user.person
|
||||||
|
= render 'aspects/aspect_stream', :stream => @stream
|
||||||
%hr
|
%hr
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,9 @@
|
||||||
|
|
||||||
- content_for :head do
|
- content_for :head do
|
||||||
= javascript_include_tag :people
|
= javascript_include_tag :people
|
||||||
:javascript
|
- if user_signed_in? && @person != current_user.person
|
||||||
Mentions.options.prefillMention = Mentions._contactToMention(#{@person.to_json});
|
:javascript
|
||||||
|
Mentions.options.prefillMention = Mentions._contactToMention(#{@person.to_json});
|
||||||
|
|
||||||
- content_for :page_title do
|
- content_for :page_title do
|
||||||
= @person.name
|
= @person.name
|
||||||
|
|
|
||||||
47
features/posts_from_profile_page.feature
Normal file
47
features/posts_from_profile_page.feature
Normal file
|
|
@ -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"
|
||||||
|
|
@ -64,3 +64,13 @@ end
|
||||||
When /^I open the show page of the "([^"]*)" post$/ do |post_text|
|
When /^I open the show page of the "([^"]*)" post$/ do |post_text|
|
||||||
visit post_path_by_content(post_text)
|
visit post_path_by_content(post_text)
|
||||||
end
|
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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue