diff --git a/app/assets/javascripts/app/pages/contacts.js b/app/assets/javascripts/app/pages/contacts.js index 34a27aa84..7c041026c 100644 --- a/app/assets/javascripts/app/pages/contacts.js +++ b/app/assets/javascripts/app/pages/contacts.js @@ -9,7 +9,8 @@ app.pages.Contacts = Backbone.View.extend({ "click #chat_privilege_toggle" : "toggleChatPrivilege", "click #change_aspect_name" : "showAspectNameForm", "keyup #contact_list_search" : "searchContactList", - "click .conversation_button": "showMessageModal" + "click .conversation_button": "showMessageModal", + "click #invitations-button": "showInvitationsModal" }, initialize: function(opts) { @@ -86,6 +87,10 @@ app.pages.Contacts = Backbone.View.extend({ app.helpers.showModal("#conversationModal"); }, + showInvitationsModal: function() { + app.helpers.showModal("#invitationsModal"); + }, + setupAspectSorting: function() { $("#aspect_nav .list-group").sortable({ items: "a.aspect[data-aspect-id]", diff --git a/app/assets/javascripts/app/router.js b/app/assets/javascripts/app/router.js index e71480f0e..73b8d2ba2 100644 --- a/app/assets/javascripts/app/router.js +++ b/app/assets/javascripts/app/router.js @@ -7,6 +7,7 @@ app.Router = Backbone.Router.extend({ "help": "help", "getting_started": "gettingStarted", "contacts": "contacts", + "community_spotlight": "spotlight", "conversations": "conversations", "user/edit": "settings", "users/sign_up": "registration", @@ -94,6 +95,12 @@ app.Router = Backbone.Router.extend({ this.renderPage(function(){ return new app.pages.SinglePostViewer({ id: id })}); }, + spotlight: function() { + $("#invitations-button").click(function() { + app.helpers.showModal("#invitationsModal"); + }); + }, + renderPage : function(pageConstructor){ app.page && app.page.unbind && app.page.unbind(); //old page might mutate global events $(document).keypress, so unbind before creating app.page = pageConstructor(); //create new page after the world is clean (like that will ever happen) diff --git a/app/views/contacts/_sidebar.html.haml b/app/views/contacts/_sidebar.html.haml index 15ec29812..8ed81bd57 100644 --- a/app/views/contacts/_sidebar.html.haml +++ b/app/views/contacts/_sidebar.html.haml @@ -13,9 +13,3 @@ 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"); - }); diff --git a/app/views/contacts/spotlight.haml b/app/views/contacts/spotlight.haml index 6e16edcc6..47767a482 100644 --- a/app/views/contacts/spotlight.haml +++ b/app/views/contacts/spotlight.haml @@ -1,15 +1,15 @@ - content_for :page_title do = t('contacts.spotlight.community_spotlight') - .container#contacts_container .row .col-md-3 - = render 'contacts/sidebar' + .sidebar + = render "contacts/sidebar" .col-md-9 - #people_stream.stream.contacts - .header + .stream.contacts.framed-content#people_stream + .header.clearfix - if AppConfig.settings.community_spotlight.suggest_email.present? .pull-right = link_to t('contacts.spotlight.suggest_member'), "mailto:#{AppConfig.settings.community_spotlight.suggest_email}", :class => "btn btn-default", :id => "suggest_member" @@ -17,9 +17,9 @@ = t('contacts.spotlight.community_spotlight') #community_spotlight - - unless @people.blank? + - if @people.blank? + .well + = t("contacts.spotlight.no_members") + - else - @people.each do |person| = render 'people/person', :person => person, :contact => current_user.contact_for(person) - - -# if @contacts_size > 0 - = render @contacts diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 28a160864..b961cbf91 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -265,6 +265,7 @@ en: spotlight: community_spotlight: "Community spotlight" suggest_member: "Suggest a member" + no_members: "There are no members yet." conversations: index: