diff --git a/app/assets/javascripts/app/router.js b/app/assets/javascripts/app/router.js index e5c0b3d92..c71222ff8 100644 --- a/app/assets/javascripts/app/router.js +++ b/app/assets/javascripts/app/router.js @@ -106,6 +106,7 @@ app.Router = Backbone.Router.extend({ {tagText: decodeURIComponent(name).toLowerCase()} ); $("#author_info").prepend(followedTagsAction.render().el) + app.tags = new app.views.Tags({tagName: name}); } this._hideInactiveStreamLists(); }, diff --git a/app/assets/javascripts/app/views/publisher_view.js b/app/assets/javascripts/app/views/publisher_view.js index 1c3e83313..99f9e926e 100644 --- a/app/assets/javascripts/app/views/publisher_view.js +++ b/app/assets/javascripts/app/views/publisher_view.js @@ -149,6 +149,7 @@ app.views.Publisher = Backbone.View.extend({ setText: function(txt) { this.el_input.val(txt); this.el_hiddenInput.val(txt); + this.prefillText = txt; this.el_input.trigger('input'); this.handleTextchange(); @@ -482,7 +483,7 @@ app.views.Publisher = Backbone.View.extend({ }, _beforeUnload: function(e) { - if(this._submittable()){ + if(this._submittable() && this.el_input.val() != this.prefillText){ var confirmationMessage = Diaspora.I18n.t("confirm_unload"); (e || window.event).returnValue = confirmationMessage; //Gecko + IE return confirmationMessage; //Webkit, Safari, Chrome, etc. diff --git a/app/assets/javascripts/app/views/tags_view.js b/app/assets/javascripts/app/views/tags_view.js new file mode 100644 index 000000000..2f736a206 --- /dev/null +++ b/app/assets/javascripts/app/views/tags_view.js @@ -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 + diff --git a/app/views/invitations/new_blueprint.html.haml b/app/views/invitations/new_blueprint.html.haml index 4cd957bb9..3e488cc60 100644 --- a/app/views/invitations/new_blueprint.html.haml +++ b/app/views/invitations/new_blueprint.html.haml @@ -25,7 +25,7 @@ %br %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)) %br diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 6497bcd59..e41deb7ea 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -1240,7 +1240,6 @@ en: tags: title: "Posts tagged: %{tags}" contacts_title: "People who dig this tag" - tag_prefill_text: "%{tag_name} " public: title: "Public Activity" diff --git a/features/desktop/accepts_invitation.feature b/features/desktop/accepts_invitation.feature index 330b58d76..cf6923e04 100644 --- a/features/desktop/accepts_invitation.feature +++ b/features/desktop/accepts_invitation.feature @@ -13,6 +13,7 @@ Feature: invitation acceptance And I follow "awesome_button" And I confirm the alert Then I should be on the stream page + And I close the publisher Scenario: accept invitation from user Given I have been invited by bob @@ -27,6 +28,7 @@ Feature: invitation acceptance And I follow "awesome_button" And I confirm the alert Then I should be on the stream page + And I close the publisher And I log out And I sign in as "bob@bob.bob" And I follow "By email" diff --git a/features/desktop/posts_from_tag_page.feature b/features/desktop/posts_from_tag_page.feature new file mode 100644 index 000000000..6fa16f86c --- /dev/null +++ b/features/desktop/posts_from_tag_page.feature @@ -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 diff --git a/features/desktop/signs_up.feature b/features/desktop/signs_up.feature index 1ab057369..d5529f641 100644 --- a/features/desktop/signs_up.feature +++ b/features/desktop/signs_up.feature @@ -14,6 +14,7 @@ Feature: new user registration And I follow "awesome_button" And I confirm the alert Then I should be on the stream page + And I close the publisher And I should not see "awesome_button" Scenario: new user tries to XSS itself @@ -36,6 +37,24 @@ Feature: new user registration When I follow "awesome_button" And I confirm the alert 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 When I follow "awesome_button" @@ -44,6 +63,7 @@ Feature: new user registration And I have turned off jQuery effects And I wait for the popovers to appear And I click close on all the popovers + And I close the publisher Then I should not see "Welcome to diaspora*" Scenario: user fills in bogus data - client side validation diff --git a/lib/stream/tag.rb b/lib/stream/tag.rb index 9817a24a8..afb6175a2 100644 --- a/lib/stream/tag.rb +++ b/lib/stream/tag.rb @@ -38,13 +38,9 @@ class Stream::Tag < Stream::Base private - def tag_prefill_text - I18n.translate('streams.tags.tag_prefill_text', :tag_name => display_tag_name) - end - # @return [Hash] def publisher_opts - {:prefill => "#{tag_prefill_text}", :open => true} + {:open => true} end def construct_post_query