Merge pull request #5821 from svbergerem/fix-layout-regression

Fix layout regression: missing header on search page
This commit is contained in:
Jonne Haß 2015-03-28 14:46:23 +01:00
commit 1d5d872d2b
2 changed files with 3 additions and 7 deletions

View file

@ -6,8 +6,6 @@ class PeopleController < ApplicationController
before_action :authenticate_user!, except: [:show, :stream] before_action :authenticate_user!, except: [:show, :stream]
before_action :find_person, only: [:show, :stream, :hovercard] before_action :find_person, only: [:show, :stream, :hovercard]
layout proc { request.format == :mobile ? "application" : "with_header" }, only: %i( show contacts )
respond_to :html, :except => [:tag_index] respond_to :html, :except => [:tag_index]
respond_to :json, :only => [:index, :show] respond_to :json, :only => [:index, :show]
respond_to :js, :only => [:tag_index] respond_to :js, :only => [:tag_index]
@ -91,7 +89,7 @@ class PeopleController < ApplicationController
gon.preloads[:contacts] = { gon.preloads[:contacts] = {
count: Contact.contact_contacts_for(current_user, @person).count(:all), count: Contact.contact_contacts_for(current_user, @person).count(:all),
} }
respond_with @person respond_with @person, layout: "with_header"
end end
format.mobile do format.mobile do
@ -151,7 +149,7 @@ class PeopleController < ApplicationController
} }
@contacts_of_contact = @contacts_of_contact.paginate(:page => params[:page], :per_page => (params[:limit] || 15)) @contacts_of_contact = @contacts_of_contact.paginate(:page => params[:page], :per_page => (params[:limit] || 15))
@hashes = hashes_for_people @contacts_of_contact, @aspects @hashes = hashes_for_people @contacts_of_contact, @aspects
respond_with @person respond_with @person, layout: "with_header"
else else
flash[:error] = I18n.t 'people.show.does_not_exist' flash[:error] = I18n.t 'people.show.does_not_exist'
redirect_to people_path redirect_to people_path

View file

@ -6,8 +6,6 @@ class PhotosController < ApplicationController
before_action :authenticate_user!, :except => :show before_action :authenticate_user!, :except => :show
respond_to :html, :json respond_to :html, :json
layout proc { request.format == :mobile ? "application" : "with_header" }, only: :index
def show def show
@photo = if user_signed_in? @photo = if user_signed_in?
current_user.photos_from(Person.find_by_guid(params[:person_id])).where(id: params[:id]).first current_user.photos_from(Person.find_by_guid(params[:person_id])).where(id: params[:id]).first
@ -34,7 +32,7 @@ class PhotosController < ApplicationController
gon.preloads[:contacts] = { gon.preloads[:contacts] = {
count: Contact.contact_contacts_for(current_user, @person).count(:all), count: Contact.contact_contacts_for(current_user, @person).count(:all),
} }
render 'people/show' render "people/show", layout: "with_header"
end end
format.json{ render_for_api :backbone, :json => @posts, :root => :photos } format.json{ render_for_api :backbone, :json => @posts, :root => :photos }
end end