Cleanup the code
- Extract JS from HTML - Remove search link on message - Remove duplicated invitation modal
This commit is contained in:
parent
1ae838b596
commit
461e4cfd8c
4 changed files with 19 additions and 31 deletions
|
|
@ -11,6 +11,7 @@ app.views.Stream = app.views.InfScroll.extend({
|
|||
this.setupNSFW();
|
||||
this.setupInfiniteScroll();
|
||||
this.markNavSelected();
|
||||
this.initInvitationModal();
|
||||
},
|
||||
|
||||
postClass : app.views.StreamPost,
|
||||
|
|
@ -27,6 +28,12 @@ app.views.Stream = app.views.InfScroll.extend({
|
|||
var streamSelection = $("#stream_selection");
|
||||
streamSelection.find("[data-stream]").removeClass("selected");
|
||||
streamSelection.find("[data-stream='" + activeStream + "']").addClass("selected");
|
||||
},
|
||||
|
||||
initInvitationModal : function() {
|
||||
$(".invitations-link").click(function() {
|
||||
app.helpers.showModal("#invitationsModal");
|
||||
});
|
||||
}
|
||||
});
|
||||
// @license-end
|
||||
|
|
|
|||
|
|
@ -4,26 +4,14 @@
|
|||
|
||||
#no_contacts.empty_message
|
||||
%p.lead
|
||||
= t('.you_should_add_some_more_contacts')
|
||||
= t(".you_should_add_some_more_contacts")
|
||||
|
||||
%p
|
||||
!= t('.try_adding_some_more_contacts',
|
||||
search_link: link_to(t('.search_link_text'), search_path),
|
||||
invite_link: link_to(t('.invite_link_text'),
|
||||
"invitationsModal",
|
||||
id: "invitations-link",
|
||||
!= t(".try_adding_some_more_contacts",
|
||||
invite_link: link_to(t(".invite_link_text"),
|
||||
"#",
|
||||
class: "invitations-link",
|
||||
data: {toggle: "modal"}))
|
||||
|
||||
= render "shared/modal",
|
||||
path: new_user_invitation_path,
|
||||
id: "invitationsModal",
|
||||
title: t("invitations.new.invite_someone_to_join")
|
||||
|
||||
- if AppConfig.settings.community_spotlight.enable?
|
||||
!= t('.or_spotlight', :link => link_to(t(".community_spotlight") , community_spotlight_path))
|
||||
|
||||
-# This will have to be extracte in a JS view
|
||||
:javascript
|
||||
$("#invitations-link").click(function(){
|
||||
app.helpers.showModal("#invitationsModal");
|
||||
});
|
||||
!= t(".or_spotlight", link: link_to(t(".community_spotlight"), community_spotlight_path))
|
||||
|
|
|
|||
|
|
@ -1,15 +1,9 @@
|
|||
= t('.share_this')
|
||||
= t(".share_this")
|
||||
= 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")
|
||||
|
||||
= render 'shared/modal',
|
||||
= render "shared/modal",
|
||||
path: new_user_invitation_path,
|
||||
id: 'invitationsModal',
|
||||
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");
|
||||
});
|
||||
id: "invitationsModal",
|
||||
title: t("invitations.new.invite_someone_to_join")
|
||||
|
|
|
|||
|
|
@ -204,8 +204,7 @@ en:
|
|||
start_talking: "Nobody has said anything yet!"
|
||||
no_contacts_message:
|
||||
you_should_add_some_more_contacts: "You should add some more contacts!"
|
||||
try_adding_some_more_contacts: "You can %{search_link} or %{invite_link} more contacts."
|
||||
search_link_text: "search"
|
||||
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}"
|
||||
community_spotlight: "Community spotlight"
|
||||
|
|
|
|||
Loading…
Reference in a new issue