MS IZ profile page has more useful info, but ultimatly kinda ugly

This commit is contained in:
maxwell 2010-07-27 14:23:31 -07:00
parent 97daaf81c2
commit bdca2348a6
10 changed files with 56 additions and 37 deletions

View file

@ -4,10 +4,12 @@ class DashboardsController < ApplicationController
def index def index
@posts = Post.paginate :page => params[:page], :order => 'created_at DESC' @posts = Post.paginate :page => params[:page], :order => 'created_at DESC'
@latest_status_message = StatusMessage.newest(current_user)
end end
def ostatus def ostatus
@posts = OstatusPost.paginate :page => params[:page], :order => 'created_at DESC' @posts = OstatusPost.paginate :page => params[:page], :order => 'created_at DESC'
@latest_status_message = StatusMessage.newest(current_user)
render :index render :index
end end

View file

@ -8,7 +8,9 @@ class PeopleController < ApplicationController
def show def show
@person= Person.where(:id => params[:id]).first @person= Person.where(:id => params[:id]).first
@person_profile = @person.profile @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 end
def destroy def destroy

View file

@ -57,5 +57,9 @@ module ApplicationHelper
def new_request(request_count) def new_request(request_count)
"new_requests" if request_count > 0 "new_requests" if request_count > 0
end end
def post_yield_tag(post)
(':' + post.id.to_s).to_sym
end
end end

View file

@ -1,7 +1,7 @@
module StatusMessagesHelper module StatusMessagesHelper
def my_latest_message def my_latest_message
message = StatusMessage.my_newest message = @latest_status_message
unless message.nil? unless message.nil?
return message.message + " - " + how_long_ago(message) return message.message + " - " + how_long_ago(message)
else else

View file

@ -12,5 +12,4 @@
- for author in @subscribed_persons - for author in @subscribed_persons
%li= link_to author.username, author_path(author) %li= link_to author.username, author_path(author)
= link_to "add a new person", requests_path = link_to "add a new person", requests_path

View file

@ -1,29 +1,34 @@
.span-20.last .span-20.last
%h1= "#{@person.real_name}" #profile
= link_to 'remove friend', @person, :confirm => 'Are you sure?', :method => :delete %h1
%p = person_image_link(@person)
%b Active? = "#{@person.real_name}"
%p .button.right
= @person.active = link_to 'remove friend', @person, :confirm => 'Are you sure?', :method => :delete
- if @person_profile
%p %h4{:style => "font-size:small"}
%b First Name %ul{:style => "list-style-type: none"}
%p %li
= @person_profile.first_name %i= "last seen: #{how_long_ago(@person_posts.first)}"
%p %li
%b Last Name %i= "friends since: #{how_long_ago(@person)}"
%p
= @person_profile.last_name
%p
%b url
%p
= @person.url
.span-20 %h1
- if @person.posts #latest_message= "\"#{@latest_status_message.message}\""
%h3 stream
%ul#stream %p
- for post in @person_posts %b url:
= render type_partial(post), :post => post = @person.url
- else
%h3 no posts to display!
.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!

View file

@ -1,6 +1,6 @@
#debug_info #debug_info
%h5 DEBUG INFO %h5 DEBUG INFO
#debug_more{:visability => "hidden"} #debug_more{ :style => "display:none;" }
%ul %ul
%li %li
%b params %b params

View file

@ -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

View file

@ -201,7 +201,7 @@ ul.comment_set {
margin-top: -5px; margin-top: -5px;
padding-bottom: 8px; } padding-bottom: 8px; }
#stream img.person_picture { #stream img.person_picture, #profile img.person_picture {
border-radius: 3px; border-radius: 3px;
-webkit-border-radius: 3px; -webkit-border-radius: 3px;
-moz-border-radius: 3px; -moz-border-radius: 3px;
@ -223,7 +223,8 @@ ul.comment_set {
font-weight: normal; } font-weight: normal; }
.destroy_link { .destroy_link {
display: none; } display: none;
font-size: smaller; }
.request_buttons { .request_buttons {
position: absolute; position: absolute;

View file

@ -242,8 +242,8 @@ ul.comment_set
:top -5px :top -5px
:padding :padding
:bottom 8px :bottom 8px
#stream #stream, #profile
img.person_picture img.person_picture
:border-radius 3px :border-radius 3px
:-webkit-border-radius 3px :-webkit-border-radius 3px
@ -254,7 +254,8 @@ ul.comment_set
:float left :float left
:margin :margin
:right 10px :right 10px
.pagination .pagination
a a
:padding 3px :padding 3px
@ -270,6 +271,7 @@ ul.comment_set
.destroy_link .destroy_link
:display none :display none
:font-size smaller
.request_buttons .request_buttons
:position absolute :position absolute