Skip to content
Extraits de code Groupes Projets
Valider 84cc5980 rédigé par maxwell's avatar maxwell
Parcourir les fichiers

MS a couple of small bug fixes when updateing user profile....starting to...

MS a couple of small bug fixes when updateing user profile....starting to attept friend index/search page
parent ff412770
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -31,6 +31,7 @@ class RequestsController < ApplicationController
end
def create
puts params.inspect
rel_hash = relationship_flow(params[:request][:destination_url])
Rails.logger.debug("Sending request: #{rel_hash}")
@request = current_user.send_request(rel_hash, params[:request][:group])
......
class UsersController < ApplicationController
before_filter :authenticate_user!, :except => [:new, :create]
def index
unless params[:q]
@people = Person.all
render :index
else
@people = Person.search(params[:q])
end
end
def show
@user= User.first(:id => params[:id])
......@@ -16,12 +24,13 @@ class UsersController < ApplicationController
@user = User.where(:id => params[:id]).first
if @user.update_profile(params[:user])
flash[:notice] = "Successfully updated user."
redirect_to @user
flash[:notice] = "Successfully updated your profile"
redirect_to @user.person
else
render :action => 'edit'
end
end
end
module PeopleHelper
def search_or_index
if params[:q]
" results for #{q}"
else
" people on this pod"
end
end
end
\ No newline at end of file
......@@ -29,6 +29,7 @@ module RequestsHelper
action = :none
url = nil
local_person = Person.by_webfinger identifier
puts local_person.inspect
if local_person
action = (local_person == current_user.person ? :none : :friend)
url = local_person.receive_url
......
%h1.big_text
.back
= link_to '⇧ home', root_path
Friends
.button.right
= link_to 'Add Friend', requests_path
/ %h1.big_text
/ .back
/ = link_to '⇧ home', root_path
/ Friends
/ .button.right
/ = link_to 'Add Friend', requests_path
= @people.count.to_s + search_or_index
%table
%tr
%th real name
......
- title "Users"
= @people.count.to_s + search_or_index
%table
%tr
%th Real Name
%th real name
%th email
%th Password
- for user in @users
%th url
- for person in @people
%tr
%td= user.real_name
%td= user.email
%td= user.encrypted_password
%td= person.real_name
%td= person.email
%td= person.url
%td
%select{ :class => "group_selector", :style=>"display:inline;"}
%option Add to group
%option
- for group in current_user.groups
%option{:value => group.id}= group.name
%td= link_to "add as friend", requests_path(:request => {:destination_url => person.email}), :class => "submit", :method => "post"
\ No newline at end of file
Diaspora::Application.routes.draw do
resources :people
resources :users, :only => [:edit, :show, :update]
resources :users #, :only => [:edit, :show, :update]
resources :status_messages
resources :comments
resources :requests
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter