diff --git a/app/controllers/dashboards_controller.rb b/app/controllers/dashboards_controller.rb index 414f5956ac77a34ab3663b452e6384fa3a818da1..e09e182f8a6484c051c256afdaf2994f57876dda 100644 --- a/app/controllers/dashboards_controller.rb +++ b/app/controllers/dashboards_controller.rb @@ -4,10 +4,12 @@ class DashboardsController < ApplicationController def index @posts = Post.paginate :page => params[:page], :order => 'created_at DESC' + @latest_status_message = StatusMessage.newest(current_user) end def ostatus @posts = OstatusPost.paginate :page => params[:page], :order => 'created_at DESC' + @latest_status_message = StatusMessage.newest(current_user) render :index end diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 44bdaf63ff33eae8850066f362c94e527b29e335..25fcdf2af71a50fcc316b5e98d49138525924ae6 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -8,7 +8,9 @@ class PeopleController < ApplicationController def show @person= Person.where(:id => params[:id]).first @person_profile = @person.profile - @person_posts = Post.where(:person_id => @person.id).sort(:created_at.desc) + @person_posts = Post.where(:person_id => @person.id).paginate :page => params[:page], :order => 'created_at DESC' + @latest_status_message = StatusMessage.newest(@person) + @post_count = @person_posts.count end def destroy diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8024717d81341d5b245e6ab1a74a39e126430a02..2a9d7eda22e3ef5ae5d518d44a62a7caa9994b9b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -57,5 +57,9 @@ module ApplicationHelper def new_request(request_count) "new_requests" if request_count > 0 end + + def post_yield_tag(post) + (':' + post.id.to_s).to_sym + end end diff --git a/app/helpers/status_messages_helper.rb b/app/helpers/status_messages_helper.rb index 2e933d7843f1ec2ee8e9768e8b7316857fdbd106..a5655a9e35f27c168f97fd84bd6d22d22e8b4d2b 100644 --- a/app/helpers/status_messages_helper.rb +++ b/app/helpers/status_messages_helper.rb @@ -1,7 +1,7 @@ module StatusMessagesHelper def my_latest_message - message = StatusMessage.my_newest + message = @latest_status_message unless message.nil? return message.message + " - " + how_long_ago(message) else diff --git a/app/views/people/_sidebar.html.haml b/app/views/people/_sidebar.html.haml index f9a205e1ccc183c53893e4e73057857eab802ca2..438da560e3081c843af7eea7de542390306c45c4 100644 --- a/app/views/people/_sidebar.html.haml +++ b/app/views/people/_sidebar.html.haml @@ -12,5 +12,4 @@ - for author in @subscribed_persons %li= link_to author.username, author_path(author) -= link_to "add a new person", requests_path - += link_to "add a new person", requests_path \ No newline at end of file diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index ee089231586e65f878950d736a679c920d4df707..54524ab08526e84cd92c1dbedcf29507382ab71a 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -1,29 +1,34 @@ .span-20.last - %h1= "#{@person.real_name}" - = link_to 'remove friend', @person, :confirm => 'Are you sure?', :method => :delete -%p - %b Active? -%p - = @person.active -- if @person_profile - %p - %b First Name - %p - = @person_profile.first_name - %p - %b Last Name - %p - = @person_profile.last_name - %p - %b url - %p - = @person.url + #profile + %h1 + = person_image_link(@person) + = "#{@person.real_name}" + .button.right + = link_to 'remove friend', @person, :confirm => 'Are you sure?', :method => :delete + + %h4{:style => "font-size:small"} + %ul{:style => "list-style-type: none"} + %li + %i= "last seen: #{how_long_ago(@person_posts.first)}" + %li + %i= "friends since: #{how_long_ago(@person)}" -.span-20 - - if @person.posts - %h3 stream - %ul#stream - - for post in @person_posts - = render type_partial(post), :post => post - - else - %h3 no posts to display! + %h1 + #latest_message= "\"#{@latest_status_message.message}\"" + + %p + %b url: + = @person.url + + + + + .span-20 + - if @person.posts + %h3= "stream - #{@post_count} item(s)" + %ul#stream + - for post in @person_posts + = render type_partial(post), :post => post + = will_paginate @person_posts + - else + %h3 no posts to display! diff --git a/app/views/posts/_debug.haml b/app/views/posts/_debug.haml index 75f85306807769233e13ea87a09277bffc772352..ad1b3f1d828d55219b71ef710852dc1f9968593b 100644 --- a/app/views/posts/_debug.haml +++ b/app/views/posts/_debug.haml @@ -1,6 +1,6 @@ #debug_info %h5 DEBUG INFO - #debug_more{:visability => "hidden"} + #debug_more{ :style => "display:none;" } %ul %li %b params diff --git a/app/views/shared/_post_wrapper.haml b/app/views/shared/_post_wrapper.haml new file mode 100644 index 0000000000000000000000000000000000000000..bdba9db700bd28e792e7a1f438c6136f9b532037 --- /dev/null +++ b/app/views/shared/_post_wrapper.haml @@ -0,0 +1,4 @@ +%li.message{:id => post.id, :class => ("mine" if mine?(post))} + = person_image_link(post.person) + = yield post_yield_tag(post) + = = render type_partial(post), :post => post \ No newline at end of file diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index c1a4ea7d15bcd469dc77eea1adb0892e62dbf364..00b3cfc0069aceb3f259b04a6f257a4a40b667df 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -201,7 +201,7 @@ ul.comment_set { margin-top: -5px; padding-bottom: 8px; } -#stream img.person_picture { +#stream img.person_picture, #profile img.person_picture { border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; @@ -223,7 +223,8 @@ ul.comment_set { font-weight: normal; } .destroy_link { - display: none; } + display: none; + font-size: smaller; } .request_buttons { position: absolute; diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 018a55c8b9a57ab5335b70303b8a871f07a08187..d65b0c44f74c049357d84382f153a6276ee078b3 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -242,8 +242,8 @@ ul.comment_set :top -5px :padding :bottom 8px - -#stream + +#stream, #profile img.person_picture :border-radius 3px :-webkit-border-radius 3px @@ -254,7 +254,8 @@ ul.comment_set :float left :margin :right 10px - + + .pagination a :padding 3px @@ -270,6 +271,7 @@ ul.comment_set .destroy_link :display none + :font-size smaller .request_buttons :position absolute