Remove some old views, clean up routes, clean up.
This commit is contained in:
parent
f0df1ec8df
commit
8d853a88a3
11 changed files with 14 additions and 94 deletions
|
|
@ -9,7 +9,6 @@ class PhotosController < ApplicationController
|
|||
respond_to :json, :only => :show
|
||||
|
||||
def index
|
||||
@aspect = :profile
|
||||
@post_type = :photos
|
||||
@person = Person.find_by_id(params[:person_id])
|
||||
|
||||
|
|
@ -96,11 +95,6 @@ class PhotosController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@photo = Photo.new
|
||||
respond_with @photo
|
||||
end
|
||||
|
||||
def destroy
|
||||
photo = current_user.my_posts.where(:_id => params[:id]).first
|
||||
|
||||
|
|
|
|||
|
|
@ -27,10 +27,6 @@ class RequestsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@request = Request.new
|
||||
end
|
||||
|
||||
def create
|
||||
aspect = current_user.aspect_by_id(params[:request][:into])
|
||||
account = params[:request][:to].strip
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ class ServicesController < ApplicationController
|
|||
end
|
||||
|
||||
def create
|
||||
|
||||
auth = request.env['omniauth.auth']
|
||||
|
||||
provider = auth['provider']
|
||||
|
|
|
|||
|
|
@ -58,33 +58,6 @@ class StatusMessagesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
def index
|
||||
@aspect = :profile
|
||||
@post_type = :status_messages
|
||||
|
||||
@person = Person.find(params[:person_id].to_id)
|
||||
|
||||
if @person
|
||||
@profile = @person.profile
|
||||
@contact = current_user.contact_for(@person)
|
||||
@is_contact = @person != current_user.person && @contact
|
||||
|
||||
if @contact
|
||||
@aspects_with_person = @contact.aspects
|
||||
else
|
||||
@pending_request = current_user.pending_requests.find_by_person_id(@person.id)
|
||||
end
|
||||
|
||||
@posts = current_user.visible_posts(:_type => 'StatusMessage', :person_id => @person.id).paginate :page => params[:page], :order => 'created_at DESC'
|
||||
render 'people/show'
|
||||
|
||||
else
|
||||
flash[:error] = I18n.t 'people.show.does_not_exist'
|
||||
redirect_to people_path
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
@status_message = current_user.my_posts.where(:_id => params[:id]).first
|
||||
if @status_message
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
%h2
|
||||
= t('.send_invitation')
|
||||
= form_for User.new, :url => invitation_path(User) do |f|
|
||||
= devise_error_messages!
|
||||
%p
|
||||
= f.label :email , t('email')
|
||||
= f.text_field :email
|
||||
%p= f.submit t('.send_an_invitation')
|
||||
/= link_to "Home", after_sign_in_path_for(resource_name)
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
-# Copyright (c) 2010, Diaspora Inc. This file is
|
||||
-# licensed under the Affero General Public License version 3 or later. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
- title t('.new_photo')
|
||||
|
||||
= form_for( @photo, :html => {:multipart => true}) do |f|
|
||||
= f.error_messages
|
||||
%p
|
||||
= f.file_field :image
|
||||
= f.submit t('.post_it'), :class => 'button'
|
||||
|
||||
%p= link_to t('.back_to_list'), photos_path
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
-# Copyright (c) 2010, Diaspora Inc. This file is
|
||||
-# licensed under the Affero General Public License version 3 or later. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
%ul
|
||||
%h3= link_to post.class, object_path(post)
|
||||
- for field in object_fields(post)
|
||||
%li= "#{field}: #{post.attributes[field]}"
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
-# Copyright (c) 2010, Diaspora Inc. This file is
|
||||
-# licensed under the Affero General Public License version 3 or later. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
= @log.to_s
|
||||
|
|
@ -3,12 +3,11 @@
|
|||
# the COPYRIGHT file.
|
||||
|
||||
Diaspora::Application.routes.draw do
|
||||
resources :status_messages, :only => [:create, :destroy, :show]
|
||||
resources :comments, :except => [:index]
|
||||
resources :requests, :except => [:edit, :update]
|
||||
resources :status_messages, :only => [:create, :destroy, :show]
|
||||
resources :comments, :only => [:create]
|
||||
resources :requests, :only => [:destroy, :create]
|
||||
resources :services
|
||||
|
||||
resources :people
|
||||
resources :people do
|
||||
resources :status_messages
|
||||
resources :photos
|
||||
|
|
@ -18,24 +17,24 @@ Diaspora::Application.routes.draw do
|
|||
match '/auth/:provider/callback' => 'services#create'
|
||||
|
||||
match 'photos/make_profile_photo' => 'photos#make_profile_photo'
|
||||
resources :photos, :except => [:index]
|
||||
resources :photos, :except => [:index]
|
||||
|
||||
devise_for :users, :controllers => {:registrations => "registrations",
|
||||
:password => "devise/passwords",
|
||||
:invitations => "invitations"}
|
||||
# added public route to user
|
||||
match 'public/:username', :to => 'users#public'
|
||||
match 'getting_started', :to => 'users#getting_started', :as => 'getting_started'
|
||||
match 'users/export', :to => 'users#export'
|
||||
match 'users/export_photos', :to => 'users#export_photos'
|
||||
match 'login', :to => 'users#sign_up'
|
||||
resources :users, :except => [:create, :new, :show]
|
||||
match 'public/:username', :to => 'users#public'
|
||||
match 'getting_started', :to => 'users#getting_started', :as => 'getting_started'
|
||||
match 'users/export', :to => 'users#export'
|
||||
match 'users/export_photos',:to => 'users#export_photos'
|
||||
match 'login', :to => 'users#sign_up'
|
||||
resources :users, :except => [:create, :new, :show]
|
||||
|
||||
match 'aspects/move_contact', :to => 'aspects#move_contact', :as => 'move_contact'
|
||||
match 'aspects/add_to_aspect',:to => 'aspects#add_to_aspect', :as => 'add_to_aspect'
|
||||
match 'aspects/move_contact', :to => 'aspects#move_contact', :as => 'move_contact'
|
||||
match 'aspects/add_to_aspect', :to => 'aspects#add_to_aspect', :as => 'add_to_aspect'
|
||||
match 'aspects/remove_from_aspect',:to => 'aspects#remove_from_aspect', :as => 'remove_from_aspect'
|
||||
match 'aspects/manage', :to => 'aspects#manage'
|
||||
resources :aspects, :except => [:edit]
|
||||
match 'aspects/manage', :to => 'aspects#manage'
|
||||
resources :aspects, :except => [:edit]
|
||||
|
||||
#public routes
|
||||
match 'webfinger', :to => 'publics#webfinger'
|
||||
|
|
|
|||
|
|
@ -47,12 +47,6 @@ describe PhotosController do
|
|||
assigns[:person].should == user2.person
|
||||
assigns[:posts].should == []
|
||||
end
|
||||
|
||||
it 'sets the aspect to profile' do
|
||||
get :index, :person_id => user.person.id.to_s
|
||||
assigns[:aspect].should == :profile
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
describe '#show' do
|
||||
|
|
|
|||
Loading…
Reference in a new issue