From 52baa4618e5ec6413b1982a5512b9ee2ce3ca24c Mon Sep 17 00:00:00 2001 From: Larissa Reis Date: Sun, 24 Apr 2016 22:21:10 -0300 Subject: [PATCH] Adapt external person attributes and current_user to allow for external login --- app/concerns/authenticated_system.rb | 2 +- app/controllers/my_profile/email_templates_controller.rb | 2 +- app/controllers/public/profile_controller.rb | 6 +++--- app/controllers/public/search_controller.rb | 2 +- app/helpers/application_helper.rb | 22 +++++++++++----------- app/models/concerns/external_user.rb | 3 ++- app/models/concerns/profile_entity.rb | 30 ++++++++++++++++++++++++++++++ app/models/environment.rb | 3 +-- app/models/external_person.rb | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- app/models/profile.rb | 30 ------------------------------ app/models/user.rb | 2 +- app/views/account/welcome.html.erb | 2 +- app/views/enterprise_registration/basic_information.html.erb | 4 ++-- app/views/environment_role_manager/affiliate.html.erb | 2 +- app/views/layouts/_user.html.erb | 1 + app/views/profile_members/affiliate.html.erb | 2 +- db/migrate/20160420140141_create_external_person.rb | 4 +++- plugins/organization_ratings/controllers/organization_ratings_plugin_profile_controller.rb | 2 +- plugins/organization_ratings/views/organization_ratings_plugin_profile/_new_rating_fields.html.erb | 8 ++++---- plugins/organization_ratings/views/shared/_make_report_block.html.erb | 6 +++--- plugins/responsive/lib/ext/application_helper.rb | 10 +++++----- plugins/sniffer/views/blocks/interests.html.erb | 2 +- plugins/solr/lib/solr_plugin/search_helper.rb | 4 ++-- 23 files changed, 151 insertions(+), 76 deletions(-) diff --git a/app/concerns/authenticated_system.rb b/app/concerns/authenticated_system.rb index c08eef2..955ae51 100644 --- a/app/concerns/authenticated_system.rb +++ b/app/concerns/authenticated_system.rb @@ -27,7 +27,7 @@ module AuthenticatedSystem @current_user ||= begin user = nil if session[:external] - user = User.new + user = User.new #FIXME: User needs to have at least email user.external_person_id = session[:external] else id = session[:user] diff --git a/app/controllers/my_profile/email_templates_controller.rb b/app/controllers/my_profile/email_templates_controller.rb index e15e4b6..02a68c9 100644 --- a/app/controllers/my_profile/email_templates_controller.rb +++ b/app/controllers/my_profile/email_templates_controller.rb @@ -64,7 +64,7 @@ class EmailTemplatesController < ApplicationController private def template_params - {:profile_name => current_user.name, :environment_name => environment.name } + {:profile_name => current_person.name, :environment_name => environment.name } end def template_params_allowed params diff --git a/app/controllers/public/profile_controller.rb b/app/controllers/public/profile_controller.rb index cccc352..0cfaeb2 100644 --- a/app/controllers/public/profile_controller.rb +++ b/app/controllers/public/profile_controller.rb @@ -176,7 +176,7 @@ class ProfileController < PublicController end def unblock - if current_user.person.is_admin?(profile.environment) + if current_person.is_admin?(profile.environment) profile.unblock session[:notice] = _("You have unblocked %s successfully. ") % profile.name redirect_to :controller => 'profile', :action => 'index' @@ -187,7 +187,7 @@ class ProfileController < PublicController end def leave_scrap - sender = params[:sender_id].nil? ? current_user.person : Person.find(params[:sender_id]) + sender = params[:sender_id].nil? ? current_person : Person.find(params[:sender_id]) receiver = params[:receiver_id].nil? ? @profile : Person.find(params[:receiver_id]) @scrap = Scrap.new(params[:scrap]) @scrap.sender= sender @@ -270,7 +270,7 @@ class ProfileController < PublicController def remove_scrap begin - scrap = current_user.person.scraps(params[:scrap_id]) + scrap = current_person.scraps(params[:scrap_id]) scrap.destroy finish_successful_removal 'Scrap successfully removed.' rescue diff --git a/app/controllers/public/search_controller.rb b/app/controllers/public/search_controller.rb index ed70791..dff3c15 100644 --- a/app/controllers/public/search_controller.rb +++ b/app/controllers/public/search_controller.rb @@ -247,7 +247,7 @@ class SearchController < PublicController def visible_profiles(klass, *extra_relations) relations = [:image, :domains, :environment, :preferred_domain] relations += extra_relations - if current_user && current_user.person.is_admin? + if current_user && current_person.is_admin? @environment.send(klass.name.underscore.pluralize).includes(relations) else @environment.send(klass.name.underscore.pluralize).visible.includes(relations) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e5d3561..c36fdc0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -146,12 +146,12 @@ module ApplicationHelper end def link_to_cms(text, profile = nil, options = {}) - profile ||= current_user.login + profile ||= current_person.identifier link_to text, myprofile_path(:controller => 'cms', :profile => profile), options end def link_to_profile(text, profile = nil, options = {}) - profile ||= current_user.login + profile ||= current_person.identifier link_to text, profile_path(:profile => profile) , options end @@ -160,7 +160,7 @@ module ApplicationHelper end def link_if_permitted(link, permission = nil, target = nil) - if permission.nil? || current_user.person.has_permission?(permission, target) + if permission.nil? || current_person.has_permission?(permission, target) link else nil @@ -813,8 +813,8 @@ module ApplicationHelper {s_('contents|More viewed') => {href: url_for({host: host, controller: 'search', action: 'contents', filter: 'more_popular'})}}, {s_('contents|Most commented') => {href: url_for({host: host, controller: 'search', action: 'contents', filter: 'more_comments'})}} ] - if logged_in? && !current_user.external_person_id - links.push(_('New content') => modal_options({:href => url_for({:controller => 'cms', :action => 'new', :profile => current_user.login, :cms => true})})) + if logged_in? + links.push(_('New content') => modal_options({:href => url_for({:controller => 'cms', :action => 'new', :profile => current_person.identifier, :cms => true})})) end link_to(content_tag(:span, _('Contents'), :class => 'icon-menu-articles'), {:controller => "search", :action => 'contents', :category_path => nil}, :id => 'submenu-contents') + @@ -829,9 +829,9 @@ module ApplicationHelper {s_('people|More active') => {href: url_for({host: host, controller: 'search', action: 'people', filter: 'more_active'})}}, {s_('people|More popular') => {href: url_for({host: host, controller: 'search', action: 'people', filter: 'more_popular'})}} ] - if logged_in? && !current_user.external_person_id - links.push(_('My friends') => {:href => url_for({:profile => current_user.login, :controller => 'friends'})}) - links.push(_('Invite friends') => {:href => url_for({:profile => current_user.login, :controller => 'invite', :action => 'friends'})}) + if logged_in? + links.push(_('My friends') => {:href => url_for({:profile => current_person.identifier, :controller => 'friends'})}) + links.push(_('Invite friends') => {:href => url_for({:profile => current_person.identifier, :controller => 'invite', :action => 'friends'})}) end link_to(content_tag(:span, _('People'), :class => 'icon-menu-people'), {:controller => "search", :action => 'people', :category_path => ''}, :id => 'submenu-people') + @@ -846,9 +846,9 @@ module ApplicationHelper {s_('communities|More active') => {href: url_for({host: host, controller: 'search', action: 'communities', filter: 'more_active'})}}, {s_('communities|More popular') => {href: url_for({host: host, controller: 'search', action: 'communities', filter: 'more_popular'})}} ] - if logged_in? && !current_user.external_person_id - links.push(_('My communities') => {:href => url_for({:profile => current_user.login, :controller => 'memberships'})}) - links.push(_('New community') => {:href => url_for({:profile => current_user.login, :controller => 'memberships', :action => 'new_community'})}) + if logged_in? + links.push(_('My communities') => {:href => url_for({:profile => current_person.identifier, :controller => 'memberships'})}) + links.push(_('New community') => {:href => url_for({:profile => current_person.identifier, :controller => 'memberships', :action => 'new_community'})}) end link_to(content_tag(:span, _('Communities'), :class => 'icon-menu-community'), {:controller => "search", :action => 'communities'}, :id => 'submenu-communities') + diff --git a/app/models/concerns/external_user.rb b/app/models/concerns/external_user.rb index 702e02a..07b45e1 100644 --- a/app/models/concerns/external_user.rb +++ b/app/models/concerns/external_user.rb @@ -49,8 +49,9 @@ module ExternalUser webfinger = OpenStruct.new( identifier: user['user']['person']['identifier'], name: user['user']['person']['name'], + created_at: user['user']['person']['created_at'], domain: domain, - email_md5: Digest::MD5.hexdigest(user['user']['email']) + email: user['user']['email'] ) u.external_person_id = ExternalPerson.get_or_create(webfinger).id return u diff --git a/app/models/concerns/profile_entity.rb b/app/models/concerns/profile_entity.rb index 47807e4..16541c0 100644 --- a/app/models/concerns/profile_entity.rb +++ b/app/models/concerns/profile_entity.rb @@ -35,4 +35,34 @@ module ProfileEntity true end + # returns +false+ + def person? + self.kind_of?(Person) + end + + def enterprise? + self.kind_of?(Enterprise) + end + + def organization? + self.kind_of?(Organization) + end + + def community? + self.kind_of?(Community) + end + + include ActionView::Helpers::TextHelper + def short_name(chars = 40) + if self[:nickname].blank? + if chars + truncate self.name, length: chars, omission: '...' + else + self.name + end + else + self[:nickname] + end + end + end diff --git a/app/models/environment.rb b/app/models/environment.rb index 3f7a779..02bddc2 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -1010,8 +1010,7 @@ class Environment < ApplicationRecord end def has_federated_network?(domain) - # FIXME: Should return whether "domain" is whitelisted in this environment as a federated network - true + self.federated_networks.map(&:url).any? {|url| /http[s]?:\/\/#{domain}\/?/ =~ url } end private diff --git a/app/models/external_person.rb b/app/models/external_person.rb index 6eee16e..0fe0991 100644 --- a/app/models/external_person.rb +++ b/app/models/external_person.rb @@ -6,7 +6,7 @@ class ExternalPerson < ActiveRecord::Base validates_uniqueness_of :identifier, scope: :source - attr_accessible :source, :email_md5_hash + attr_accessible :source, :email, :created_at def self.get_or_create(webfinger) user = ExternalPerson.find_by(identifier: webfinger.identifier, source: webfinger.domain) @@ -14,7 +14,8 @@ class ExternalPerson < ActiveRecord::Base user = ExternalPerson.create!(identifier: webfinger.identifier, name: webfinger.name, source: webfinger.domain, - email_md5_hash: webfinger.email_md5 + email: webfinger.email, + created_at: webfinger.created_at ) end user @@ -24,12 +25,83 @@ class ExternalPerson < ActiveRecord::Base "http://#{self.source}/#{self.identifier}" end + alias :public_profile_url :url + def avatar - "http://#{self.source}/plugin/gravatar_provider/h/#{self.email_md5_hash}" + "http://#{self.source}/plugin/gravatar_provider/h/#{Digest::MD5.hexdigest(self.email)}" + end + + def admin_url + "http://#{self.source}/myprofile/#{self.identifier}" + end + + def profile_custom_icon(gravatar_default=nil) + self.avatar end def preferred_login_redirection environment.redirection_after_login end + def person? + true + end + + def is_admin?(environment = nil) + false + end + + def lat + nil + end + def lng + nil + end + + def role_assignments + RoleAssignment.none + end + + def favorite_enterprises + Enterprise.none + end + + def memberships + Profile.none + end + + def friendships + Profile.none + end + + def follows?(profile) + false + end + + def is_a_friend?(person) + false + end + + def already_request_friendship?(person) + false + end + + class ExternalPerson::Image + attr_accessor :path + def initialize(path) + self.path = path + end + def public_filename(size = nil) + self.path + end + + def content_type + 'image/png' + end + end + + def image + ExternalPerson::Image.new(avatar) + end + end diff --git a/app/models/profile.rb b/app/models/profile.rb index 0c998f5..d44d8aa 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -549,23 +549,6 @@ class Profile < ApplicationRecord environment end - # returns +false+ - def person? - self.kind_of?(Person) - end - - def enterprise? - self.kind_of?(Enterprise) - end - - def organization? - self.kind_of?(Organization) - end - - def community? - self.kind_of?(Community) - end - # returns false. def is_validation_entity? false @@ -803,19 +786,6 @@ private :generate_url, :url_options !forbidden.include?(cat.class) end - include ActionView::Helpers::TextHelper - def short_name(chars = 40) - if self[:nickname].blank? - if chars - truncate self.name, length: chars, omission: '...' - else - self.name - end - else - self[:nickname] - end - end - def custom_header self[:custom_header] || environment && environment.custom_header end diff --git a/app/models/user.rb b/app/models/user.rb index 3817b07..8d7ab7e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -149,7 +149,7 @@ class User < ApplicationRecord u.generate_private_token_if_not_exist return u end - + return User.external_authenticate(login, password, environment) end diff --git a/app/views/account/welcome.html.erb b/app/views/account/welcome.html.erb index 17c9ed3..6dedc00 100644 --- a/app/views/account/welcome.html.erb +++ b/app/views/account/welcome.html.erb @@ -4,7 +4,7 @@ <%= _('%s was successfuly activated. Now you may go to your control panel or to the control panel of your enterprise') % @enterprise.name %> <%= button_bar do %> - <%= button 'forward', _('Go to my control panel'), :action => 'index', :controller => 'profile_editor', :profile => current_user.person.identifier %> + <%= button 'forward', _('Go to my control panel'), :action => 'index', :controller => 'profile_editor', :profile => current_person.identifier %> <%= button 'forward', _('Go to my enterprise control panel') % @enterprise.name, :action => 'index', :controller => 'profile_editor', :profile => @enterprise.identifier %> <% end %> <% end %> diff --git a/app/views/enterprise_registration/basic_information.html.erb b/app/views/enterprise_registration/basic_information.html.erb index ff8e897..ac28201 100644 --- a/app/views/enterprise_registration/basic_information.html.erb +++ b/app/views/enterprise_registration/basic_information.html.erb @@ -9,7 +9,7 @@ <%= button_bar do %> - <%= button :back, _('Go back'), { :profile => current_user.person.identifier, :action=>"enterprises", :controller=>"profile" }%> + <%= button :back, _('Go back'), { :profile => current_person.identifier, :action=>"enterprises", :controller=>"profile" }%> <% end %> <% else %>
@@ -37,7 +37,7 @@ <%= template_options(:enterprises, 'create_enterprise')%> <%= button_bar do %> - <%= submit_button('next', _('Next'), :cancel => {:profile => current_user.person.identifier, :action=>"enterprises", :controller=>"profile"}) %> + <%= submit_button('next', _('Next'), :cancel => {:profile => current_person.identifier, :action=>"enterprises", :controller=>"profile"}) %> <% end %> <% end %> <% end %> diff --git a/app/views/environment_role_manager/affiliate.html.erb b/app/views/environment_role_manager/affiliate.html.erb index ceb3ba3..937f0e0 100644 --- a/app/views/environment_role_manager/affiliate.html.erb +++ b/app/views/environment_role_manager/affiliate.html.erb @@ -2,7 +2,7 @@ <%= form_tag( {:action => 'give_role'}, {:method => :post}) do %> <%= select_tag 'role', options_for_select(@roles.map{|r|[r.name,r.id]}) %> - <%= hidden_field_tag 'person', current_user.person.id %> + <%= hidden_field_tag 'person', current_person.id %> <%= button_bar do %> <%= submit_button('affiliate', _('Affiliate', :cancel => {:action => 'index'}) %> <% end %> diff --git a/app/views/layouts/_user.html.erb b/app/views/layouts/_user.html.erb index e29674f..439630d 100644 --- a/app/views/layouts/_user.html.erb +++ b/app/views/layouts/_user.html.erb @@ -1,5 +1,6 @@
<% user = (session[:user] && User.find_by(id: session[:user])) || nil %> + <% user ||= (session[:external] && User.new(:external_person_id => session[:external])) || nil %> <% if user.present? %> <% user = user.person %> diff --git a/app/views/profile_members/affiliate.html.erb b/app/views/profile_members/affiliate.html.erb index 2c37284..65ebe3c 100644 --- a/app/views/profile_members/affiliate.html.erb +++ b/app/views/profile_members/affiliate.html.erb @@ -2,7 +2,7 @@ <%= form_tag( {:action => 'give_role'}, {:method => :post}) do %> <%= select_tag 'role', options_for_select(@roles.map{|r|[r.name,r.id]}) %> - <%= hidden_field_tag 'person', current_user.person.id %> + <%= hidden_field_tag 'person', current_person.id %> <%= button_bar do %> <%= submit_button('affiliate', _('Affiliate'), :cancel => {:action => 'index'}) %> <% end %> diff --git a/db/migrate/20160420140141_create_external_person.rb b/db/migrate/20160420140141_create_external_person.rb index 2beaec5..f1c5c4e 100644 --- a/db/migrate/20160420140141_create_external_person.rb +++ b/db/migrate/20160420140141_create_external_person.rb @@ -4,9 +4,11 @@ class CreateExternalPerson < ActiveRecord::Migration t.string :name t.string :identifier t.string :source - t.string :email_md5_hash + t.string :email t.integer :environment_id t.boolean :visible, default: true + t.datetime :created_at + t.datetime :updated_at end end end diff --git a/plugins/organization_ratings/controllers/organization_ratings_plugin_profile_controller.rb b/plugins/organization_ratings/controllers/organization_ratings_plugin_profile_controller.rb index 17db4b1..8f0086b 100644 --- a/plugins/organization_ratings/controllers/organization_ratings_plugin_profile_controller.rb +++ b/plugins/organization_ratings/controllers/organization_ratings_plugin_profile_controller.rb @@ -38,7 +38,7 @@ class OrganizationRatingsPluginProfileController < ProfileController def create_new_rate @rating = OrganizationRating.new(params[:organization_rating]) - @rating.person = current_user.person + @rating.person = current_person @rating.organization = profile @rating.value = params[:organization_rating_value] if params[:organization_rating_value] diff --git a/plugins/organization_ratings/views/organization_ratings_plugin_profile/_new_rating_fields.html.erb b/plugins/organization_ratings/views/organization_ratings_plugin_profile/_new_rating_fields.html.erb index 0c39045..7656565 100644 --- a/plugins/organization_ratings/views/organization_ratings_plugin_profile/_new_rating_fields.html.erb +++ b/plugins/organization_ratings/views/organization_ratings_plugin_profile/_new_rating_fields.html.erb @@ -9,11 +9,11 @@
- <%= link_to profile_image(current_user.person, :portrait), current_user.person.url %> + <%= link_to profile_image(current_person, :portrait), current_person.url %>
- <%= link_to current_user.person.name, current_user.person.url %> + <%= link_to current_person.name, current_person.url %>
@@ -59,14 +59,14 @@
<% elsif env_organization_ratings_config.vote_once %>
- <%= _("Hi, %s! The administrators set that you can vote") % current_user.name %> + <%= _("Hi, %s! The administrators set that you can vote") % current_person.name %> <%= _("only once") %> <%= _("for this %s.") % profile.class.name.downcase %> <%= render :partial => 'shared/rating_button', :locals => { :disabled => true } %>
<% else %>
- <%= _("Hi, %s! The administrators set the minimum time of") % current_user.name %> + <%= _("Hi, %s! The administrators set the minimum time of") % current_person.name %> <%= _("%d hour(s)") % env_organization_ratings_config.cooldown %> <%= _("between each evaluation.") %> diff --git a/plugins/organization_ratings/views/shared/_make_report_block.html.erb b/plugins/organization_ratings/views/shared/_make_report_block.html.erb index 2a0006f..d2fdf51 100644 --- a/plugins/organization_ratings/views/shared/_make_report_block.html.erb +++ b/plugins/organization_ratings/views/shared/_make_report_block.html.erb @@ -1,5 +1,5 @@ -<% logged_in_image = link_to profile_image(current_user.person, :portrait), current_user.person.url if current_user %> -<% logged_in_name = link_to current_user.person.name, current_user.person.url if current_user %> +<% logged_in_image = link_to profile_image(current_person, :portrait), current_person.url if current_user %> +<% logged_in_name = link_to current_person.name, current_person.url if current_user %> <% logged_out_image = image_tag('plugins/organization_ratings/public/images/user-not-logged.png') %>
@@ -26,4 +26,4 @@
<% end %>
-
\ No newline at end of file + diff --git a/plugins/responsive/lib/ext/application_helper.rb b/plugins/responsive/lib/ext/application_helper.rb index c1e6675..d2b40cb 100644 --- a/plugins/responsive/lib/ext/application_helper.rb +++ b/plugins/responsive/lib/ext/application_helper.rb @@ -140,7 +140,7 @@ module ApplicationHelper [s_('contents|Most commented'), {host: host, controller: :search, action: :contents, filter: 'more_comments'}], ] if logged_in? - links.push [_('New content'), '', modal_options({href: url_for({controller: 'cms', action: 'new', profile: current_user.login, cms: true})})] + links.push [_('New content'), '', modal_options({href: url_for({controller: 'cms', action: 'new', profile: current_person.identifier, cms: true})})] end content_tag :li, class: 'dropdown' do @@ -170,8 +170,8 @@ module ApplicationHelper [s_('people|More popular'), {host: host, controller: :search, action: :people, filter: 'more_popular'}], ] if logged_in? - links.push [_('My friends'), {profile: current_user.login, controller: 'friends'}] - links.push [_('Invite friends'), {profile: current_user.login, controller: 'invite', action: 'friends'}] + links.push [_('My friends'), {profile: current_person.identifier, controller: 'friends'}] + links.push [_('Invite friends'), {profile: current_person.identifier, controller: 'invite', action: 'friends'}] end content_tag :li, class: 'dropdown' do @@ -201,8 +201,8 @@ module ApplicationHelper [s_('communities|More popular'), {host: host, controller: :search, action: :communities, filter: 'more_popular'}], ] if logged_in? - links.push [_('My communities'), {profile: current_user.login, controller: 'memberships'}] - links.push [_('New community'), {profile: current_user.login, controller: 'memberships', action: 'new_community'}] + links.push [_('My communities'), {profile: current_person.identifier, controller: 'memberships'}] + links.push [_('New community'), {profile: current_person.identifier, controller: 'memberships', action: 'new_community'}] end content_tag :li, class: 'dropdown' do diff --git a/plugins/sniffer/views/blocks/interests.html.erb b/plugins/sniffer/views/blocks/interests.html.erb index 81268d3..9ece880 100644 --- a/plugins/sniffer/views/blocks/interests.html.erb +++ b/plugins/sniffer/views/blocks/interests.html.erb @@ -8,7 +8,7 @@
- <% if logged_in? and (current_user.person.is_admin?(environment) or profile.admins.include?(current_user.person)) %> + <% if logged_in? and (current_person.is_admin?(environment) or profile.admins.include?(current_person)) %> <%= _('Edit %{inputs} and %{block.interests}') % { :inputs => link_to(_("products' inputs"), :controller => :manage_products, :action => :index), :interests => link_to(_('declared interests'), :controller => :sniffer_plugin_myprofile, :action => :edit), diff --git a/plugins/solr/lib/solr_plugin/search_helper.rb b/plugins/solr/lib/solr_plugin/search_helper.rb index 1d6851a..2e6f9f2 100644 --- a/plugins/solr/lib/solr_plugin/search_helper.rb +++ b/plugins/solr/lib/solr_plugin/search_helper.rb @@ -12,9 +12,9 @@ module SolrPlugin::SearchHelper :products => ActiveSupport::OrderedHash[ :none, {:label => _('Relevance')}, :more_recent, {:label => c_('More recent'), :solr_opts => {:sort => 'updated_at desc, score desc'}}, :name, {:label => _('Name'), :solr_opts => {:sort => 'solr_plugin_name_sortable asc'}}, - :closest, {:label => _('Closest to me'), :if => proc{ logged_in? && (profile=current_user.person).lat && profile.lng }, + :closest, {:label => _('Closest to me'), :if => proc{ logged_in? && (profile=current_person).lat && profile.lng }, :solr_opts => {:sort => "geodist() asc", - :latitude => proc{ current_user.person.lat }, :longitude => proc{ current_user.person.lng }}}, + :latitude => proc{ current_person.lat }, :longitude => proc{ current_person.lng }}}, ], :events => ActiveSupport::OrderedHash[ :none, {:label => _('Relevance')}, :name, {:label => _('Name'), :solr_opts => {:sort => 'solr_plugin_name_sortable asc'}}, -- libgit2 0.21.2