From a6c5f420fab52adf968662724b27d87a7f5e8f85 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 21 Dec 2010 12:39:37 -0800 Subject: [PATCH] giving more pixels to photos on their show pages --- app/controllers/photos_controller.rb | 9 ++++- app/views/photos/show.html.haml | 27 ++++++++----- app/views/shared/_author_info.html.haml | 2 +- app/views/status_messages/show.html.haml | 5 ++- public/stylesheets/sass/application.sass | 50 ++++++++---------------- 5 files changed, 46 insertions(+), 47 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index f86a40376..b8d316f83 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -134,7 +134,14 @@ class PhotosController < ApplicationController @parent = @photo.status_message #if photo is not an attachment, fetch comments for self - unless @parent + if @parent + @additional_photos = @photo.status_message.photos + if @additional_photos + @next_photo = @additional_photos[@additional_photos.index(@photo)+1] + @prev_photo = @additional_photos[@additional_photos.index(@photo)-1] + @next_photo ||= @additional_photos.first + end + else @parent = @photo end diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index 08ef3f0ed..40387c681 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -5,9 +5,18 @@ - content_for :head do = include_javascripts :photos -= render 'shared/author_info', :person => @photo.person, :post => @photo - .span-15.append-1.last + #photo_controls + .right + =link_to "← previous", @prev_photo, :rel => 'prefetch' + \/ + =link_to "next →", @next_photo, :rel => 'prefetch' + + - if @photo.status_message_id + =link_to "← view original post", @photo.status_message + - else + \. + #photo_container #show_photo{:data=>{:guid=>@photo.id}} -if @ownership @@ -19,12 +28,13 @@ #caption = @photo.caption + %hr + .photo_options{:data=>{:actor=>"#{@photo.person.owner.id}",:actor_person=>"#{@photo.person.id}",:image_url=>"#{@photo.url(:thumb_large)}"}} = link_to t('.make_profile_photo'), {:controller => "photos", :action => "make_profile_photo", :photo_id => @photo.id}, :remote => true, :class => 'make_profile_photo' | = link_to t('.edit'), '#', :id => "edit_photo_toggle" - %br -if @ownership @@ -38,17 +48,16 @@ = button_to t('.delete_photo'), @photo, :confirm => t('are_you_sure'), :method => :delete .span-8.last - - if @photo.status_message_id - #original_post_info - %h4{:style=>"position:relative;"} - = t('.original_post') - = link_to "#{t('.view')} →", @photo.status_message + #original_post_info + = render 'shared/author_info', :person => @photo.person, :post => @photo + + - if @photo.status_message_id %p = @photo.status_message.message %p - - for photo in @photo.status_message.photos + - for photo in @additional_photos = link_to (image_tag photo.url(:thumb_small)), object_path(photo) %h4= t('_comments') diff --git a/app/views/shared/_author_info.html.haml b/app/views/shared/_author_info.html.haml index d0f85a0f7..79685aaf0 100644 --- a/app/views/shared/_author_info.html.haml +++ b/app/views/shared/_author_info.html.haml @@ -1,7 +1,7 @@ #author_info = person_image_link(person) .from - %h3 + %h4 = person.name - if post.public? diff --git a/app/views/status_messages/show.html.haml b/app/views/status_messages/show.html.haml index 84d456569..13e3ffcc4 100644 --- a/app/views/status_messages/show.html.haml +++ b/app/views/status_messages/show.html.haml @@ -3,8 +3,6 @@ -# the COPYRIGHT file. -= render 'shared/author_info', :person => @status_message.person, :post => @status_message - .span-15.append-1.last #show_text %p @@ -24,6 +22,9 @@ = link_to t('.destroy'), @status_message, :confirm => t('are_you_sure'), :method => :delete .span-8.last + #original_post_info + = render 'shared/author_info', :person => @status_message.person, :post => @status_message + %h4{:style=>"margin-bottom:5px;"}= t('_comments') %ul{:class => 'stream show', :id => 'status_message_stream'} %li.message{:data=>{:guid=>@status_message.id}} diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index d30b5513f..9b30e1c7f 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -264,15 +264,17 @@ header #author_info :position relative - :margin - :bottom 12px img :position relative - :top 3px + :top 0px :display inline-block - :height 40px - :width 40px + :height 30px + :width 30px + + .avatar + :-webkit-box-shadow none + :box-shadow none .from :display inline-block @@ -292,12 +294,6 @@ header :margin :right 2em - .aspect_badge - :position relative - :top -2px - :font - :size small - :padding 2px 4px li.message @@ -681,29 +677,8 @@ li.message:hover :background :color #fff - :padding 10px - :bottom 30px - :margin - :bottom 2em - - :-webkit-box-shadow 0 2px 4px #333 - :-moz-box-shadow 0 2px 4px #333 - :box-shadow 0 2px 4px #333 - - :-webkit-border-radius 3px - :-moz-border-radius 3px - :border-radius 3px - - :max-width 100% - img - :z-index 2 - :position relative :max-width 100% - :margin - :bottom 10px - :border 1px solid #eee - :bottom 1px solid #ddd #photo_spinner :z-index 1 @@ -1407,9 +1382,10 @@ input[type="search"] :-moz-border-radius 5px :border-radius 5px - .photo_options - :color #999 + :color #ddd + :text + :align center ul.aspects :margin 0 @@ -2150,3 +2126,9 @@ ul.notifications_for_day :background none :border :bottom 1px solid #eee + +#photo_controls + :color #ddd + :position relative + :margin + :bottom 1em