Skip to content

Commit

Permalink
Merge pull request #3714 from marpo60/refactor
Browse files Browse the repository at this point in the history
Housekeeping
  • Loading branch information
jhass committed Nov 22, 2012
2 parents c5be6be + 75c943e commit 5f6e03c
Show file tree
Hide file tree
Showing 30 changed files with 16 additions and 530 deletions.
2 changes: 0 additions & 2 deletions app/assets/templates/composer-controls_tpl.jst.hbs

This file was deleted.

24 changes: 0 additions & 24 deletions app/assets/templates/flow_tpl.jst.hbs

This file was deleted.

14 changes: 0 additions & 14 deletions app/assets/templates/framer-content_tpl.jst.hbs

This file was deleted.

4 changes: 0 additions & 4 deletions app/assets/templates/framer-controls_tpl.jst.hbs

This file was deleted.

5 changes: 0 additions & 5 deletions app/assets/templates/post-new_tpl.jst.hbs

This file was deleted.

51 changes: 0 additions & 51 deletions app/assets/templates/profile_tpl.jst.hbs

This file was deleted.

13 changes: 0 additions & 13 deletions app/assets/templates/wallpaper-form_tpl.jst.hbs

This file was deleted.

30 changes: 15 additions & 15 deletions app/controllers/people_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,6 @@ def tag_index
respond_with @people
end

def hashes_for_people(people, aspects)
ids = people.map{|p| p.id}
contacts = {}
Contact.unscoped.where(:user_id => current_user.id, :person_id => ids).each do |contact|
contacts[contact.person_id] = contact
end

people.map{|p|
{:person => p,
:contact => contacts[p.id],
:aspects => aspects}
}
end

def show
@person = Person.find_from_guid_or_username(params)

Expand Down Expand Up @@ -162,6 +148,8 @@ def aspect_membership_dropdown
end
end

private

def redirect_if_tag_search
if search_query.starts_with?('#')
if search_query.length > 1
Expand All @@ -173,7 +161,19 @@ def redirect_if_tag_search
end
end

private
def hashes_for_people(people, aspects)
ids = people.map{|p| p.id}
contacts = {}
Contact.unscoped.where(:user_id => current_user.id, :person_id => ids).each do |contact|
contacts[contact.person_id] = contact
end

people.map{|p|
{:person => p,
:contact => contacts[p.id],
:aspects => aspects}
}
end

def search_query
@search_query ||= params[:q] || params[:term] || ''
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/layout_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def translation_missing_warnings
end

def include_base_css_framework(use_bootstrap=false)
if use_bootstrap || @aspect == :getting_started || @page == :experimental
if use_bootstrap || @aspect == :getting_started
stylesheet_link_tag 'bootstrap-complete'
else
stylesheet_link_tag 'blueprint', :media => 'screen'
Expand Down
9 changes: 0 additions & 9 deletions app/helpers/people_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ def search_header
end
end

def request_partial single_aspect_form
if single_aspect_form
'requests/new_request_with_aspect_to_person'

else
'requests/new_request_to_person'
end
end

def search_or_index
if search_query
I18n.t 'people.helper.results_for',:params => search_query
Expand Down
8 changes: 0 additions & 8 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,6 @@ def self.find_for_database_authentication(conditions={})
where(conditions).first
end

# @param [Person] person
# @return [Boolean] whether this user can add person as a contact.
def can_add?(person)
return false if self.person == person
return false if self.contact_for(person).present?
true
end

def confirm_email(token)
return false if token.blank? || token != confirm_email_token
self.email = unconfirmed_email
Expand Down
30 changes: 0 additions & 30 deletions app/views/aspects/_aspect_contacts.haml

This file was deleted.

9 changes: 0 additions & 9 deletions app/views/aspects/_aspect_list_item.haml

This file was deleted.

18 changes: 0 additions & 18 deletions app/views/aspects/index.mobile.haml

This file was deleted.

5 changes: 0 additions & 5 deletions app/views/aspects/update.js.erb

This file was deleted.

47 changes: 0 additions & 47 deletions app/views/invitations/edit.html.haml

This file was deleted.

26 changes: 0 additions & 26 deletions app/views/invitations/edit.mobile.haml

This file was deleted.

3 changes: 0 additions & 3 deletions app/views/invitations/token_not_found.html.haml

This file was deleted.

12 changes: 0 additions & 12 deletions app/views/likes/_likes_container.haml

This file was deleted.

6 changes: 0 additions & 6 deletions app/views/notifications/_popup.haml

This file was deleted.

9 changes: 0 additions & 9 deletions app/views/people/_add_contact_small.haml

This file was deleted.

Loading

0 comments on commit 5f6e03c

Please sign in to comment.