Add to leftsidebar link to photos index + thumbnails from last 3 photos

This commit is contained in:
carolina 2013-08-06 14:18:23 +02:00 committed by mokus
parent caae0d6af6
commit 9a5691c46a
3 changed files with 11 additions and 2 deletions

View file

@ -81,7 +81,7 @@ class PeopleController < ApplicationController
@aspect = :profile @aspect = :profile
@stream = Stream::Person.new(current_user, @person, :max_time => max_time) @stream = Stream::Person.new(current_user, @person, :max_time => max_time)
@profile = @person.profile @profile = @person.profile
@photos = Photo.where(author_id: @profile.id).limit(3).order('created_at desc')
unless params[:format] == "json" # hovercard unless params[:format] == "json" # hovercard
if current_user if current_user
@block = current_user.blocks.where(:person_id => @person.id).first @block = current_user.blocks.where(:person_id => @person.id).first

View file

@ -14,7 +14,7 @@ class PhotosController < ApplicationController
def index def index
@post_type = :photos @post_type = :photos
@person = Person.find_by_guid(params[:person_id]) @person = Person.find_by_guid(params[:person_id])
@photos = Photo.where(author_id: @person.id).limit(3).order('created_at desc')
if @person if @person
@contact = current_user.contact_for(@person) @contact = current_user.contact_for(@person)

View file

@ -44,5 +44,14 @@
=t('.born') =t('.born')
= birthday_format(person.birthday) = birthday_format(person.birthday)
%li
- unless @photos.blank?
%h4
= link_to t('_photos'), person_photos_path(person)
- for photo in @photos
= image_tag(photo.url(:thumb_small))
%br %br
%br %br