Merge pull request #6492 from marienfressinaud/6062-add-search-and-invte-links-when-no-contacts

Add invite links when no contacts
This commit is contained in:
Dennis Schubert 2015-10-21 01:20:59 +02:00
commit 1338725308
4 changed files with 25 additions and 18 deletions

View file

@ -11,6 +11,7 @@ app.views.Stream = app.views.InfScroll.extend({
this.setupNSFW(); this.setupNSFW();
this.setupInfiniteScroll(); this.setupInfiniteScroll();
this.markNavSelected(); this.markNavSelected();
this.initInvitationModal();
}, },
postClass : app.views.StreamPost, postClass : app.views.StreamPost,
@ -27,6 +28,12 @@ app.views.Stream = app.views.InfScroll.extend({
var streamSelection = $("#stream_selection"); var streamSelection = $("#stream_selection");
streamSelection.find("[data-stream]").removeClass("selected"); streamSelection.find("[data-stream]").removeClass("selected");
streamSelection.find("[data-stream='" + activeStream + "']").addClass("selected"); streamSelection.find("[data-stream='" + activeStream + "']").addClass("selected");
},
initInvitationModal : function() {
$(".invitations-link").click(function() {
app.helpers.showModal("#invitationsModal");
});
} }
}); });
// @license-end // @license-end

View file

@ -3,10 +3,15 @@
-# the COPYRIGHT file. -# the COPYRIGHT file.
#no_contacts.empty_message #no_contacts.empty_message
= t('.you_should_add_some_more_contacts') %p.lead
%br = t(".you_should_add_some_more_contacts")
%br
= t('.try_adding_some_more_contacts')
- if AppConfig.settings.community_spotlight.enable?
!= t('.or_spotlight', :link => link_to(t(".community_spotlight") , community_spotlight_path))
%p
!= t(".try_adding_some_more_contacts",
invite_link: link_to(t(".invite_link_text"),
"#",
class: "invitations-link",
data: {toggle: "modal"}))
- if AppConfig.settings.community_spotlight.enable?
!= t(".or_spotlight", link: link_to(t(".community_spotlight"), community_spotlight_path))

View file

@ -1,15 +1,9 @@
= t('.share_this') = t(".share_this")
= invite_link(current_user.invitation_code) = invite_link(current_user.invitation_code)
#invitations-button.btn.btn-link{ "data-toggle" => "modal"} .invitations-link.btn.btn-link#invitations-button{"data-toggle" => "modal"}
= t(".by_email") = t(".by_email")
= render 'shared/modal', = render "shared/modal",
path: new_user_invitation_path, path: new_user_invitation_path,
id: 'invitationsModal', id: "invitationsModal",
title: t('invitations.new.invite_someone_to_join') title: t("invitations.new.invite_someone_to_join")
-# This will have to be extracte in a JS view
:javascript
$("#invitations-button").click(function(){
app.helpers.showModal("#invitationsModal");
});

View file

@ -204,7 +204,8 @@ en:
start_talking: "Nobody has said anything yet!" start_talking: "Nobody has said anything yet!"
no_contacts_message: no_contacts_message:
you_should_add_some_more_contacts: "You should add some more contacts!" you_should_add_some_more_contacts: "You should add some more contacts!"
try_adding_some_more_contacts: "You can search or invite more contacts." try_adding_some_more_contacts: "You can search or %{invite_link} more contacts."
invite_link_text: "invite"
or_spotlight: "Or you can share with %{link}" or_spotlight: "Or you can share with %{link}"
community_spotlight: "Community spotlight" community_spotlight: "Community spotlight"
aspect_listings: aspect_listings: