MS IZ profile page has more useful info, but ultimatly kinda ugly
This commit is contained in:
parent
97daaf81c2
commit
bdca2348a6
10 changed files with 56 additions and 37 deletions
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -58,4 +58,8 @@ module ApplicationHelper
|
||||||
"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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,3 @@
|
||||||
%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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
%b First Name
|
|
||||||
%p
|
|
||||||
= @person_profile.first_name
|
|
||||||
%p
|
|
||||||
%b Last Name
|
|
||||||
%p
|
|
||||||
= @person_profile.last_name
|
|
||||||
%p
|
|
||||||
%b url
|
|
||||||
%p
|
|
||||||
= @person.url
|
|
||||||
|
|
||||||
.span-20
|
%h4{:style => "font-size:small"}
|
||||||
- if @person.posts
|
%ul{:style => "list-style-type: none"}
|
||||||
%h3 stream
|
%li
|
||||||
%ul#stream
|
%i= "last seen: #{how_long_ago(@person_posts.first)}"
|
||||||
- for post in @person_posts
|
%li
|
||||||
= render type_partial(post), :post => post
|
%i= "friends since: #{how_long_ago(@person)}"
|
||||||
- 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!
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
4
app/views/shared/_post_wrapper.haml
Normal file
4
app/views/shared/_post_wrapper.haml
Normal 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
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,7 @@ ul.comment_set
|
||||||
: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
|
||||||
|
|
@ -255,6 +255,7 @@ ul.comment_set
|
||||||
: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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue