diff --git a/app/assets/javascripts/app/router.js b/app/assets/javascripts/app/router.js index d7bb3042c3389f978cc54c6d8c250bf9f99211c7..160123505b2d1f96c6067259461f429c45bbddb5 100644 --- a/app/assets/javascripts/app/router.js +++ b/app/assets/javascripts/app/router.js @@ -18,7 +18,7 @@ app.Router = Backbone.Router.extend({ "mentions(/)": "stream", "notifications(/)": "notifications", "p/:id(/)": "singlePost", - "people(/)": "pageWithAspectMembershipDropdowns", + "people(/)": "peopleSearch", "people/:id(/)": "profile", "people/:id/contacts(/)": "profile", "people/:id/photos(/)": "photos", @@ -137,6 +137,14 @@ app.Router = Backbone.Router.extend({ new app.views.Notifications({el: "#notifications_container"}); }, + peopleSearch: function() { + this._loadContacts(); + this.renderAspectMembershipDropdowns($(document)); + $(".invitations-link").click(function() { + app.helpers.showModal("#invitationsModal"); + }); + }, + photos: function(guid) { this._loadContacts(); this.renderPage(function() { @@ -214,11 +222,6 @@ app.Router = Backbone.Router.extend({ app.contacts = new app.collections.Contacts(app.parsePreload("contacts")); }, - pageWithAspectMembershipDropdowns: function() { - this._loadContacts(); - this.renderAspectMembershipDropdowns($(document)); - }, - renderAspectMembershipDropdowns: function($context) { $context.find(".aspect_membership_dropdown.placeholder").each(function() { var personId = $(this).data("personId"); diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 117005596cf98af7ec24c53bab21a49c35e9cd65..8d952a2986d5e5d0b4301486da5578f010de8bc3 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -1044,7 +1044,7 @@ en: invitations: invites: "Invites" invite_your_friends: "Invite your friends" - by_email: "By email" + by_email: "Invite people by email" share_this: "Share this link via email, blog, or social networks!" public_explain: control_your_audience: "Control your audience" diff --git a/features/desktop/invitations.feature b/features/desktop/invitations.feature index 0d7059bf9ec03f93a3e6dfd4b27bc7d8091deec6..5aafd11dff0557dcf1b3fd5d3157ff8e594b080e 100644 --- a/features/desktop/invitations.feature +++ b/features/desktop/invitations.feature @@ -48,3 +48,14 @@ Feature: Invitations And I press "Send an invitation" Then I should have 1 Devise email delivery And I should not see "change your notification settings" in the last sent email + + Scenario: sends an invitation from the people search page + When I sign in as "alice@alice.alice" + And I search for "test" + Then I should see "Users matching test" within "#search_title" + When I click on selector "#invitations-button" + And I fill in the following: + | email_inviter_emails | alex@example.com | + And I press "Send an invitation" + Then I should have 1 Devise email delivery + And I should not see "change your notification settings" in the last sent email