From 774fc5378bc89ccfa05ba613ffae96addd3427cf Mon Sep 17 00:00:00 2001 From: sarven Date: Mon, 19 Jan 2009 22:40:21 +0000 Subject: [PATCH] user_profile markup --- actions/showstream.php | 126 +++++++++++++++++++++++++---------------- 1 file changed, 76 insertions(+), 50 deletions(-) diff --git a/actions/showstream.php b/actions/showstream.php index aaa55b3306..60270cfd7c 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -219,19 +219,89 @@ class ShowstreamAction extends Action function showProfile() { - $this->elementStart('div', array('id' => 'profile', 'class' => 'vcard')); + $this->elementStart('div', array('id' => 'user_profile', 'class' => 'vcard author')); + $this->element('h2', null, _('User profile')); $avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE); - $this->elementStart('div', array('id' => 'profile_avatar')); + $this->elementStart('dl', 'user_depiction'); + $this->element('dt', null, _('Photo')); + $this->elementStart('dd'); $this->element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_PROFILE_SIZE), - 'class' => 'avatar profile photo', + 'class' => 'photo avatar', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, 'alt' => $this->profile->nickname)); + $this->elementEnd('dd'); + $this->elementEnd('dl'); + + if ($this->profile->fullname) { + $this->elementStart('dl', 'user_fn'); + $this->element('dt', null, _('Full name')); + $this->elementStart('dd'); + $this->element('a', array('href' => $this->profile->homepage, + 'rel' => 'me', 'class' => 'fn url uid'), + $this->profile->fullname); + $this->elementEnd('dd'); + $this->elementEnd('dl'); + } + + $this->elementStart('dl', 'user_nickname'); + $this->element('dt', null, _('Nickname')); + $this->elementStart('dd'); + $this->element('span', 'fn nickname', $this->profile->nickname); + $this->elementEnd('dd'); + $this->elementEnd('dl'); + + if ($this->profile->location) { + $this->elementStart('dl', 'user_location'); + $this->element('dt', null, _('Location')); + $this->element('dd', 'location', $this->profile->location); + $this->elementEnd('dl'); + } + + if ($this->profile->homepage) { + $this->elementStart('dl', 'user_url'); + $this->element('dt', null, _('URL')); + $this->elementStart('dd'); + $this->element('a', array('href' => $this->profile->homepage, + 'rel' => 'me', 'class' => 'url'), + $this->profile->homepage); + $this->elementEnd('dd'); + $this->elementEnd('dl'); + } + + if ($this->profile->bio) { + $this->elementStart('dl', 'user_note'); + $this->element('dt', null, _('Note')); + $this->element('dd', 'note', $this->profile->bio); + $this->elementEnd('dl'); + } + + $tags = Profile_tag::getTags($this->profile->id, $this->profile->id); + if (count($tags) > 0) { + $this->elementStart('dl', 'user_tags'); + $this->element('dt', null, _('Tags')); + $this->elementStart('dd', 'tags'); + $this->elementStart('ul', 'tags xoxo'); + foreach ($tags as $tag) { + $this->elementStart('li'); + $this->element('a', array('rel' => 'tag', + 'href' => common_local_url('peopletag', + array('tag' => $tag))), + $tag); + $this->elementEnd('li'); + } + $this->elementEnd('ul'); + $this->elementEnd('dd'); + $this->elementEnd('dl'); + } + $this->elementEnd('div'); - $this->elementStart('ul', array('id' => 'profile_actions')); - $this->elementStart('li', array('id' => 'profile_subscribe')); + $this->elementStart('div', array('id' => 'user_actions')); + $this->element('h2', null, _('User actions')); + $this->elementStart('ul'); + $this->elementStart('li', array('id' => 'user_subscribe')); $cur = common_current_user(); if ($cur) { if ($cur->id != $this->profile->id) { @@ -252,7 +322,7 @@ class ShowstreamAction extends Action if ($cur && $cur->id != $this->profile->id) { $blocked = $cur->hasBlocked($this->profile); - $this->elementStart('li', array('id' => 'profile_block')); + $this->elementStart('li', array('id' => 'user_block')); if ($blocked) { $bf = new BlockForm($this, $this->profile); $bf->show(); @@ -262,33 +332,7 @@ class ShowstreamAction extends Action } $this->elementEnd('li'); } - $this->elementEnd('ul'); - - $this->elementEnd('div'); - - $this->elementStart('div', array('id' => 'profile_information')); - - if ($this->profile->fullname) { - $this->element('h1', array('class' => 'fn'), $this->profile->fullname . ' (' . $this->profile->nickname . ')'); - } else { - $this->element('h1', array('class' => 'fn nickname'), $this->profile->nickname); - } - - if ($this->profile->location) { - $this->element('p', 'location', $this->profile->location); - } - if ($this->profile->bio) { - $this->element('p', 'description note', $this->profile->bio); - } - if ($this->profile->homepage) { - $this->elementStart('p', 'website'); - $this->element('a', array('href' => $this->profile->homepage, - 'rel' => 'me', 'class' => 'url'), - $this->profile->homepage); - $this->elementEnd('p'); - } - $this->elementEnd('div'); $this->elementEnd('div'); @@ -394,7 +438,6 @@ class ShowstreamAction extends Action function showStatistics() { - // XXX: WORM cache this $subs = new Subscription(); $subs->subscriber = $this->profile->id; @@ -433,23 +476,6 @@ class ShowstreamAction extends Action $this->element('dd', 'subscribers', (is_int($subbed_count)) ? $subbed_count : '0'); $this->element('dt', 'notices', _('Notices')); $this->element('dd', 'notices', (is_int($notice_count)) ? $notice_count : '0'); - // XXX: link these to something - $this->element('dt', 'tags', _('Tags')); - $this->elementStart('dd', 'tags'); - $tags = Profile_tag::getTags($this->profile->id, $this->profile->id); - - $this->elementStart('ul', 'tags xoxo'); - foreach ($tags as $tag) { - $this->elementStart('li'); - $this->element('a', array('rel' => 'bookmark tag', - 'href' => common_local_url('peopletag', - array('tag' => $tag))), - $tag); - $this->elementEnd('li'); - } - $this->elementEnd('ul'); - $this->elementEnd('dd'); - $this->elementEnd('dl'); $this->elementEnd('div'); -- 2.39.5