diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 73e92d385..c7e2979b1 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,7 +1,7 @@ class UsersController < ApplicationController before_filter :authenticate_user!, :except => [:new, :create] + def index - @groups_array = current_user.groups.collect{|x| [x.to_s, x.id]} unless params[:q] diff --git a/app/helpers/people_helper.rb b/app/helpers/people_helper.rb index 60c971f47..fd9ff371c 100644 --- a/app/helpers/people_helper.rb +++ b/app/helpers/people_helper.rb @@ -2,10 +2,10 @@ module PeopleHelper def search_or_index if params[:q] - " results for #{q}" + " results for #{params[:q]}" else " people on this pod" end end -end \ No newline at end of file +end diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 006872e5b..da2b73eb8 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -38,6 +38,7 @@ %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 "settings", edit_user_path(current_user) + %li= link_to "search", users_path %li= link_to "logout", destroy_user_session_path - else = link_to "login", new_user_session_path diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 670739246..e4c884d83 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -1,11 +1,11 @@ +%h1.big_text + .back + = link_to "⇧ home", root_path + + Editing your profile + = form_for @user do |f| - %h1.big_text - .back - = link_to "⇧ home", root_path - - Editing your profile - = f.error_messages diff --git a/app/views/users/index.html.haml b/app/views/users/index.html.haml index 3f0d01435..bbd50ddd0 100644 --- a/app/views/users/index.html.haml +++ b/app/views/users/index.html.haml @@ -1,17 +1,32 @@ -= (@people.count-1).to_s + search_or_index +%h1.big_text + .back + = link_to "⇧ home", root_path + + Search + +%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 %tr %th real name %th email %th url - - for person in @people - - unless person.id == current_user.person.id + - for person in @people %tr %td= person.real_name %td= person.email %td= person.url -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) %td %td ^-you have a friend request from this person @@ -19,8 +34,9 @@ %td %td friend request pending -else + %td %td = form_for Request.new do |f| = f.select(:group_id, @groups_array) = f.hidden_field :destination_url, :value => person.email - = f.submit + = f.submit "add friend"