diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f9e90316f..fc90e9765 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -7,7 +7,6 @@ class ApplicationController < ActionController::Base protect_from_forgery :except => :receive before_filter :ensure_http_referer_is_set before_filter :set_header_data, :except => [:create, :update] - before_filter :set_invites before_filter :set_locale before_filter :set_git_header if (AppConfig[:git_update] && AppConfig[:git_revision]) before_filter :which_action_and_user @@ -54,12 +53,6 @@ class ApplicationController < ActionController::Base params[:page] = params[:page] ? params[:page].to_i : 1 end - def set_invites - if user_signed_in? - @invites = current_user.invites - end - end - def set_git_header headers['X-Git-Update'] = AppConfig[:git_update] headers['X-Git-Revision'] = AppConfig[:git_revision] diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index e0e3941e2..e724858f8 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -7,7 +7,6 @@ class PublicsController < ApplicationController include Diaspora::Parser skip_before_filter :set_header_data - skip_before_filter :set_invites skip_before_filter :which_action_and_user skip_before_filter :set_grammatical_gender before_filter :allow_cross_origin, :only => [:hcard, :host_meta, :webfinger] diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index ce590a6ad..efcaf2e02 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -3,7 +3,6 @@ # the COPYRIGHT file. class TagsController < ApplicationController - skip_before_filter :set_invites skip_before_filter :which_action_and_user skip_before_filter :set_grammatical_gender before_filter :ensure_page, :only => :show diff --git a/app/controllers/vanna_controller.rb b/app/controllers/vanna_controller.rb index f3997de7f..6883b16de 100644 --- a/app/controllers/vanna_controller.rb +++ b/app/controllers/vanna_controller.rb @@ -21,7 +21,6 @@ class VannaController < Vanna::Base before_filter :authenticate_user! before_filter :ensure_http_referer_is_set before_filter :set_header_data, :except => [:create, :update] - before_filter :set_invites before_filter :set_locale before_filter :set_git_header if (AppConfig[:git_update] && AppConfig[:git_revision]) before_filter :which_action_and_user @@ -48,12 +47,6 @@ class VannaController < Vanna::Base params[:page] = params[:page] ? params[:page].to_i : 1 end - def set_invites - if user_signed_in? - @invites = current_user.invites - end - end - def all_aspects @all_aspects ||= current_user.aspects end diff --git a/app/views/aspects/_aspect_contacts.haml b/app/views/aspects/_aspect_contacts.haml index 70871235c..306fa26e7 100644 --- a/app/views/aspects/_aspect_contacts.haml +++ b/app/views/aspects/_aspect_contacts.haml @@ -26,5 +26,5 @@ %br .section %h3= t('shared.invitations.invites') - = render "shared/invitations", :invites => @invites + = render "shared/invitations" diff --git a/app/views/people/index.html.haml b/app/views/people/index.html.haml index 510c84d67..0395314fb 100644 --- a/app/views/people/index.html.haml +++ b/app/views/people/index.html.haml @@ -34,5 +34,5 @@ .span-8.last %h4 = t('.couldnt_find_them_send_invite') - = render "shared/invitations", :invites => @invites + = render "shared/invitations" diff --git a/app/views/shared/_invitations.haml b/app/views/shared/_invitations.haml index 6ebe21c52..a2ef56239 100644 --- a/app/views/shared/_invitations.haml +++ b/app/views/shared/_invitations.haml @@ -1,4 +1,4 @@ --if AppConfig[:open_invitations] || (invites > 0) +-if AppConfig[:open_invitations] - if SERVICES['facebook']['app_id'] !="" - if defined? remote = link_to t('.from_facebook'), friend_finder_path('facebook', :remote => remote), :rel => 'facebox' diff --git a/app/views/shared/_right_sections.html.haml b/app/views/shared/_right_sections.html.haml index 891cb510f..7f63584f8 100644 --- a/app/views/shared/_right_sections.html.haml +++ b/app/views/shared/_right_sections.html.haml @@ -3,6 +3,15 @@ -# the COPYRIGHT file. +- unless AppConfig[:invites_off] + .section + .title + = image_tag('/images/icons/plus.png') + %h5 + = t('shared.invitations.invite_your_friends') + .content + = render "shared/invitations" + - unless has_connected_cubbies? .section .title