MS added friend search, and allow for autodiscover
This commit is contained in:
parent
c98c52ad14
commit
756278f498
4 changed files with 19 additions and 6 deletions
|
|
@ -1,9 +1,11 @@
|
||||||
class UsersController < ApplicationController
|
class UsersController < ApplicationController
|
||||||
before_filter :authenticate_user!, :except => [:new, :create]
|
before_filter :authenticate_user!, :except => [:new, :create]
|
||||||
def index
|
|
||||||
|
|
||||||
|
def index
|
||||||
|
puts "awesome"
|
||||||
@groups_array = current_user.groups.collect{|x| [x.to_s, x.id]}
|
@groups_array = current_user.groups.collect{|x| [x.to_s, x.id]}
|
||||||
|
|
||||||
|
puts params.inspect
|
||||||
unless params[:q]
|
unless params[:q]
|
||||||
@people = Person.all
|
@people = Person.all
|
||||||
render :index
|
render :index
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ module PeopleHelper
|
||||||
|
|
||||||
def search_or_index
|
def search_or_index
|
||||||
if params[:q]
|
if params[:q]
|
||||||
" results for #{q}"
|
" results for #{params[:q]}"
|
||||||
else
|
else
|
||||||
" people on this pod"
|
" people on this pod"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@
|
||||||
%li.name= link_to current_user.real_name, current_user.person
|
%li.name= link_to current_user.real_name, current_user.person
|
||||||
%li= link_to "requests (#{@request_count})", requests_path, :class => new_request(@request_count)
|
%li= link_to "requests (#{@request_count})", requests_path, :class => new_request(@request_count)
|
||||||
%li= link_to "settings", edit_user_path(current_user)
|
%li= link_to "settings", edit_user_path(current_user)
|
||||||
|
%li= link_to "search", users_path
|
||||||
%li= link_to "logout", destroy_user_session_path
|
%li= link_to "logout", destroy_user_session_path
|
||||||
- else
|
- else
|
||||||
= link_to "login", new_user_session_path
|
= link_to "login", new_user_session_path
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,26 @@
|
||||||
= (@people.count-1).to_s + search_or_index
|
%p
|
||||||
|
=form_tag '/users', :method => "get" do
|
||||||
|
= text_field_tag :q
|
||||||
|
= submit_tag "search"
|
||||||
|
= link_to "reset", users_path
|
||||||
|
|
||||||
|
= (@people.count).to_s + search_or_index
|
||||||
%table
|
%table
|
||||||
%tr
|
%tr
|
||||||
%th real name
|
%th real name
|
||||||
%th email
|
%th email
|
||||||
%th url
|
%th url
|
||||||
- for person in @people
|
- for person in @people
|
||||||
- unless person.id == current_user.person.id
|
|
||||||
%tr
|
%tr
|
||||||
%td= person.real_name
|
%td= person.real_name
|
||||||
%td= person.email
|
%td= person.email
|
||||||
%td= person.url
|
%td= person.url
|
||||||
|
|
||||||
-if current_user.friends.include? person
|
-if current_user.friends.include? person
|
||||||
|
|
||||||
|
- elsif person.id == current_user.person.id
|
||||||
|
%td
|
||||||
|
%td thats you!
|
||||||
-elsif current_user.pending_requests.find_by_person_id(person.id)
|
-elsif current_user.pending_requests.find_by_person_id(person.id)
|
||||||
%td
|
%td
|
||||||
%td ^-you have a friend request from this person
|
%td ^-you have a friend request from this person
|
||||||
|
|
@ -19,6 +28,7 @@
|
||||||
%td
|
%td
|
||||||
%td friend request pending
|
%td friend request pending
|
||||||
-else
|
-else
|
||||||
|
%td
|
||||||
%td
|
%td
|
||||||
= form_for Request.new do |f|
|
= form_for Request.new do |f|
|
||||||
= f.select(:group_id, @groups_array)
|
= f.select(:group_id, @groups_array)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue