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.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
|
||||||
|
|
|
||||||
|
|
@ -4,26 +4,14 @@
|
||||||
|
|
||||||
#no_contacts.empty_message
|
#no_contacts.empty_message
|
||||||
%p.lead
|
%p.lead
|
||||||
= t('.you_should_add_some_more_contacts')
|
= t(".you_should_add_some_more_contacts")
|
||||||
|
|
||||||
%p
|
%p
|
||||||
!= t('.try_adding_some_more_contacts',
|
!= t(".try_adding_some_more_contacts",
|
||||||
search_link: link_to(t('.search_link_text'), search_path),
|
invite_link: link_to(t(".invite_link_text"),
|
||||||
invite_link: link_to(t('.invite_link_text'),
|
"#",
|
||||||
"invitationsModal",
|
class: "invitations-link",
|
||||||
id: "invitations-link",
|
|
||||||
data: {toggle: "modal"}))
|
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?
|
- if AppConfig.settings.community_spotlight.enable?
|
||||||
!= t('.or_spotlight', :link => link_to(t(".community_spotlight") , community_spotlight_path))
|
!= 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");
|
|
||||||
});
|
|
||||||
|
|
|
||||||
|
|
@ -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");
|
|
||||||
});
|
|
||||||
|
|
|
||||||
|
|
@ -204,8 +204,7 @@ 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_link} or %{invite_link} more contacts."
|
try_adding_some_more_contacts: "You can search or %{invite_link} more contacts."
|
||||||
search_link_text: "search"
|
|
||||||
invite_link_text: "invite"
|
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"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue