Merge pull request #5442 from svbergerem/pre-fill-tag-publisher
Pre-fill publisher on tag page
This commit is contained in:
commit
4f8cf0fe07
10 changed files with 66 additions and 8 deletions
|
|
@ -96,6 +96,7 @@ This is disabled by default since it requires the installation of additional pac
|
||||||
* Fix hidden aspect dropdown on getting started page [#5407](https://github.com/diaspora/diaspora/pulls/5407)
|
* Fix hidden aspect dropdown on getting started page [#5407](https://github.com/diaspora/diaspora/pulls/5407)
|
||||||
* Fix a few issues on Bootstrap pages [#5401](https://github.com/diaspora/diaspora/pull/5401)
|
* Fix a few issues on Bootstrap pages [#5401](https://github.com/diaspora/diaspora/pull/5401)
|
||||||
* Improve handling of the `more` link on mobile stream pages [#5400](https://github.com/diaspora/diaspora/pull/5400)
|
* Improve handling of the `more` link on mobile stream pages [#5400](https://github.com/diaspora/diaspora/pull/5400)
|
||||||
|
* Fix prefilling publisher after getting started [#5442](https://github.com/diaspora/diaspora/pull/5442)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
* Don't pull jQuery from a CDN by default [#5105](https://github.com/diaspora/diaspora/pull/5105)
|
* Don't pull jQuery from a CDN by default [#5105](https://github.com/diaspora/diaspora/pull/5105)
|
||||||
|
|
@ -117,6 +118,7 @@ This is disabled by default since it requires the installation of additional pac
|
||||||
* Show a message on the ignored users page when there are none [#5434](https://github.com/diaspora/diaspora/pull/5434)
|
* Show a message on the ignored users page when there are none [#5434](https://github.com/diaspora/diaspora/pull/5434)
|
||||||
* Truncate too long OpenGraph descriptions [#5387](https://github.com/diaspora/diaspora/pull/5387)
|
* Truncate too long OpenGraph descriptions [#5387](https://github.com/diaspora/diaspora/pull/5387)
|
||||||
* Make the source code URL configurable [#5410](https://github.com/diaspora/diaspora/pull/5410)
|
* Make the source code URL configurable [#5410](https://github.com/diaspora/diaspora/pull/5410)
|
||||||
|
* Prefill publisher on the tag pages [#5442](https://github.com/diaspora/diaspora/pull/5442)
|
||||||
|
|
||||||
# 0.4.1.2
|
# 0.4.1.2
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,7 @@ app.Router = Backbone.Router.extend({
|
||||||
{tagText: decodeURIComponent(name).toLowerCase()}
|
{tagText: decodeURIComponent(name).toLowerCase()}
|
||||||
);
|
);
|
||||||
$("#author_info").prepend(followedTagsAction.render().el)
|
$("#author_info").prepend(followedTagsAction.render().el)
|
||||||
|
app.tags = new app.views.Tags({tagName: name});
|
||||||
}
|
}
|
||||||
this._hideInactiveStreamLists();
|
this._hideInactiveStreamLists();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,9 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
if( this.el_hiddenInput.val() == "" ) {
|
if( this.el_hiddenInput.val() == "" ) {
|
||||||
this.el_hiddenInput.val( this.el_input.val() );
|
this.el_hiddenInput.val( this.el_input.val() );
|
||||||
}
|
}
|
||||||
|
if( this.el_input.val() == "" ) {
|
||||||
|
this.el_input.val( this.el_hiddenInput.val() );
|
||||||
|
}
|
||||||
|
|
||||||
// hide close and preview buttons, in case publisher is standalone
|
// hide close and preview buttons, in case publisher is standalone
|
||||||
// (e.g. bookmarklet, mentions popup)
|
// (e.g. bookmarklet, mentions popup)
|
||||||
|
|
@ -146,6 +149,7 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
setText: function(txt) {
|
setText: function(txt) {
|
||||||
this.el_input.val(txt);
|
this.el_input.val(txt);
|
||||||
this.el_hiddenInput.val(txt);
|
this.el_hiddenInput.val(txt);
|
||||||
|
this.prefillText = txt;
|
||||||
|
|
||||||
this.el_input.trigger('input');
|
this.el_input.trigger('input');
|
||||||
this.handleTextchange();
|
this.handleTextchange();
|
||||||
|
|
@ -479,7 +483,7 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
_beforeUnload: function(e) {
|
_beforeUnload: function(e) {
|
||||||
if(this._submittable()){
|
if(this._submittable() && this.el_input.val() != this.prefillText){
|
||||||
var confirmationMessage = Diaspora.I18n.t("confirm_unload");
|
var confirmationMessage = Diaspora.I18n.t("confirm_unload");
|
||||||
(e || window.event).returnValue = confirmationMessage; //Gecko + IE
|
(e || window.event).returnValue = confirmationMessage; //Gecko + IE
|
||||||
return confirmationMessage; //Webkit, Safari, Chrome, etc.
|
return confirmationMessage; //Webkit, Safari, Chrome, etc.
|
||||||
|
|
|
||||||
10
app/assets/javascripts/app/views/tags_view.js
Normal file
10
app/assets/javascripts/app/views/tags_view.js
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
|
||||||
|
|
||||||
|
app.views.Tags = Backbone.View.extend({
|
||||||
|
|
||||||
|
initialize: function(opts) {
|
||||||
|
app.publisher.setText("#"+ this.tagName + " ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// @license-end
|
||||||
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
%br
|
%br
|
||||||
|
|
||||||
%h4
|
%h4
|
||||||
= t('invitaitons.new.language')
|
= t('invitations.new.language')
|
||||||
= select_tag('email_inviter[locale]', options_from_collection_for_select(available_language_options, "second", "first", :selected => current_user.language))
|
= select_tag('email_inviter[locale]', options_from_collection_for_select(available_language_options, "second", "first", :selected => current_user.language))
|
||||||
|
|
||||||
%br
|
%br
|
||||||
|
|
|
||||||
|
|
@ -1240,7 +1240,6 @@ en:
|
||||||
tags:
|
tags:
|
||||||
title: "Posts tagged: %{tags}"
|
title: "Posts tagged: %{tags}"
|
||||||
contacts_title: "People who dig this tag"
|
contacts_title: "People who dig this tag"
|
||||||
tag_prefill_text: "The thing about %{tag_name} is... "
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
title: "Public Activity"
|
title: "Public Activity"
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ Feature: invitation acceptance
|
||||||
And I follow "awesome_button"
|
And I follow "awesome_button"
|
||||||
And I confirm the alert
|
And I confirm the alert
|
||||||
Then I should be on the stream page
|
Then I should be on the stream page
|
||||||
|
And I close the publisher
|
||||||
|
|
||||||
Scenario: accept invitation from user
|
Scenario: accept invitation from user
|
||||||
Given I have been invited by bob
|
Given I have been invited by bob
|
||||||
|
|
@ -27,6 +28,7 @@ Feature: invitation acceptance
|
||||||
And I follow "awesome_button"
|
And I follow "awesome_button"
|
||||||
And I confirm the alert
|
And I confirm the alert
|
||||||
Then I should be on the stream page
|
Then I should be on the stream page
|
||||||
|
And I close the publisher
|
||||||
And I log out
|
And I log out
|
||||||
And I sign in as "bob@bob.bob"
|
And I sign in as "bob@bob.bob"
|
||||||
And I follow "By email"
|
And I follow "By email"
|
||||||
|
|
|
||||||
24
features/desktop/posts_from_tag_page.feature
Normal file
24
features/desktop/posts_from_tag_page.feature
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
@javascript
|
||||||
|
Feature: Posting from the tag page
|
||||||
|
In order to share my opinion on cats
|
||||||
|
I want to post from the tag page
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given I am on the home page
|
||||||
|
And a user with username "alice"
|
||||||
|
When I sign in as "alice@alice.alice"
|
||||||
|
And I am on the tag page for "cats"
|
||||||
|
|
||||||
|
Scenario: posting some text
|
||||||
|
Given I expand the publisher
|
||||||
|
And I have turned off jQuery effects
|
||||||
|
And I append "I like cats." to the publisher
|
||||||
|
And I press "Share"
|
||||||
|
|
||||||
|
Then "#cats I like cats." should be post 1
|
||||||
|
|
||||||
|
When I am on the home page
|
||||||
|
Then "#cats I like cats." should be post 1
|
||||||
|
|
||||||
|
When I am on the tag page for "cats"
|
||||||
|
Then "#cats I like cats." should be post 1
|
||||||
|
|
@ -14,6 +14,7 @@ Feature: new user registration
|
||||||
And I follow "awesome_button"
|
And I follow "awesome_button"
|
||||||
And I confirm the alert
|
And I confirm the alert
|
||||||
Then I should be on the stream page
|
Then I should be on the stream page
|
||||||
|
And I close the publisher
|
||||||
And I should not see "awesome_button"
|
And I should not see "awesome_button"
|
||||||
|
|
||||||
Scenario: new user tries to XSS itself
|
Scenario: new user tries to XSS itself
|
||||||
|
|
@ -36,6 +37,24 @@ Feature: new user registration
|
||||||
When I follow "awesome_button"
|
When I follow "awesome_button"
|
||||||
And I confirm the alert
|
And I confirm the alert
|
||||||
Then I should be on the stream page
|
Then I should be on the stream page
|
||||||
|
And I close the publisher
|
||||||
|
|
||||||
|
Scenario: new user without any tags posts first status message
|
||||||
|
When I follow "awesome_button"
|
||||||
|
And I confirm the alert
|
||||||
|
Then I should be on the stream page
|
||||||
|
When I submit the publisher
|
||||||
|
Then "Hey everyone, I'm #NewHere." should be post 1
|
||||||
|
|
||||||
|
Scenario: new user with some tags posts first status message
|
||||||
|
When I fill in the following:
|
||||||
|
| profile_first_name | some name |
|
||||||
|
And I fill in "tags" with "#rockstar"
|
||||||
|
And I press the first ".as-result-item" within "#as-results-tags"
|
||||||
|
And I follow "awesome_button"
|
||||||
|
Then I should be on the stream page
|
||||||
|
When I submit the publisher
|
||||||
|
Then "Hey everyone, I'm #NewHere. I'm interested in #rockstar." should be post 1
|
||||||
|
|
||||||
Scenario: closing a popover clears getting started
|
Scenario: closing a popover clears getting started
|
||||||
When I follow "awesome_button"
|
When I follow "awesome_button"
|
||||||
|
|
@ -44,6 +63,7 @@ Feature: new user registration
|
||||||
And I have turned off jQuery effects
|
And I have turned off jQuery effects
|
||||||
And I wait for the popovers to appear
|
And I wait for the popovers to appear
|
||||||
And I click close on all the popovers
|
And I click close on all the popovers
|
||||||
|
And I close the publisher
|
||||||
Then I should not see "Welcome to diaspora*"
|
Then I should not see "Welcome to diaspora*"
|
||||||
|
|
||||||
Scenario: user fills in bogus data - client side validation
|
Scenario: user fills in bogus data - client side validation
|
||||||
|
|
|
||||||
|
|
@ -38,13 +38,9 @@ class Stream::Tag < Stream::Base
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def tag_prefill_text
|
|
||||||
I18n.translate('streams.tags.tag_prefill_text', :tag_name => display_tag_name)
|
|
||||||
end
|
|
||||||
|
|
||||||
# @return [Hash]
|
# @return [Hash]
|
||||||
def publisher_opts
|
def publisher_opts
|
||||||
{:prefill => "#{tag_prefill_text}", :open => true}
|
{:open => true}
|
||||||
end
|
end
|
||||||
|
|
||||||
def construct_post_query
|
def construct_post_query
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue