Skip to content

Commit 1338725

Browse files
committed
Merge pull request diaspora#6492 from marienfressinaud/6062-add-search-and-invte-links-when-no-contacts
Add invite links when no contacts
2 parents 800be9b + 461e4cf commit 1338725

File tree

4 files changed

+25
-18
lines changed

4 files changed

+25
-18
lines changed

app/assets/javascripts/app/views/stream_view.js

+7
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ app.views.Stream = app.views.InfScroll.extend({
1111
this.setupNSFW();
1212
this.setupInfiniteScroll();
1313
this.markNavSelected();
14+
this.initInvitationModal();
1415
},
1516

1617
postClass : app.views.StreamPost,
@@ -27,6 +28,12 @@ app.views.Stream = app.views.InfScroll.extend({
2728
var streamSelection = $("#stream_selection");
2829
streamSelection.find("[data-stream]").removeClass("selected");
2930
streamSelection.find("[data-stream='" + activeStream + "']").addClass("selected");
31+
},
32+
33+
initInvitationModal : function() {
34+
$(".invitations-link").click(function() {
35+
app.helpers.showModal("#invitationsModal");
36+
});
3037
}
3138
});
3239
// @license-end

app/views/aspects/_no_contacts_message.haml

+11-6
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
-# the COPYRIGHT file.
44
55
#no_contacts.empty_message
6-
= t('.you_should_add_some_more_contacts')
7-
%br
8-
%br
9-
= t('.try_adding_some_more_contacts')
10-
- if AppConfig.settings.community_spotlight.enable?
11-
!= t('.or_spotlight', :link => link_to(t(".community_spotlight") , community_spotlight_path))
6+
%p.lead
7+
= t(".you_should_add_some_more_contacts")
8+
9+
%p
10+
!= t(".try_adding_some_more_contacts",
11+
invite_link: link_to(t(".invite_link_text"),
12+
"#",
13+
class: "invitations-link",
14+
data: {toggle: "modal"}))
1215

16+
- if AppConfig.settings.community_spotlight.enable?
17+
!= t(".or_spotlight", link: link_to(t(".community_spotlight"), community_spotlight_path))

app/views/shared/_invitations.haml

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
= t('.share_this')
1+
= t(".share_this")
22
= invite_link(current_user.invitation_code)
3-
#invitations-button.btn.btn-link{ "data-toggle" => "modal"}
3+
.invitations-link.btn.btn-link#invitations-button{"data-toggle" => "modal"}
44
= t(".by_email")
55
6-
= render 'shared/modal',
6+
= render "shared/modal",
77
path: new_user_invitation_path,
8-
id: 'invitationsModal',
9-
title: t('invitations.new.invite_someone_to_join')
10-
11-
-# This will have to be extracte in a JS view
12-
:javascript
13-
$("#invitations-button").click(function(){
14-
app.helpers.showModal("#invitationsModal");
15-
});
8+
id: "invitationsModal",
9+
title: t("invitations.new.invite_someone_to_join")

config/locales/diaspora/en.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ en:
204204
start_talking: "Nobody has said anything yet!"
205205
no_contacts_message:
206206
you_should_add_some_more_contacts: "You should add some more contacts!"
207-
try_adding_some_more_contacts: "You can search or invite more contacts."
207+
try_adding_some_more_contacts: "You can search or %{invite_link} more contacts."
208+
invite_link_text: "invite"
208209
or_spotlight: "Or you can share with %{link}"
209210
community_spotlight: "Community spotlight"
210211
aspect_listings:

0 commit comments

Comments
 (0)