From 774fc5378bc89ccfa05ba613ffae96addd3427cf Mon Sep 17 00:00:00 2001 From: sarven Date: Mon, 19 Jan 2009 22:40:21 +0000 Subject: user_profile markup --- actions/showstream.php | 126 +++++++++++++++++++++++++++++-------------------- 1 file changed, 76 insertions(+), 50 deletions(-) (limited to 'actions') diff --git a/actions/showstream.php b/actions/showstream.php index aaa55b330..60270cfd7 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'); -- cgit v1.2.3-54-g00ecf From 8e8c5805862344b82f2b1b0a30cb376ec5d91160 Mon Sep 17 00:00:00 2001 From: sarven Date: Mon, 19 Jan 2009 23:19:05 +0000 Subject: showPageTitle() and showPageNoticeBlock() and using url on nickname instead of fullname --- actions/showstream.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'actions') diff --git a/actions/showstream.php b/actions/showstream.php index 60270cfd7..39c74f0ee 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -132,7 +132,12 @@ class ShowstreamAction extends Action function showPageTitle() { - // Don't show the H1; we have one in the profile block + $this->element('h1', NULL, $this->profile->nickname._("'s profile")); + } + + function showPageNoticeBlock() + { + return; } function showExportData() @@ -238,17 +243,16 @@ class ShowstreamAction extends Action $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->element('span', 'fn', $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->element('a', array('href' => $this->profile->profileurl, + 'rel' => 'me', 'class' => 'fn nickname url uid'), + $this->profile->nickname); $this->elementEnd('dd'); $this->elementEnd('dl'); -- cgit v1.2.3-54-g00ecf From ec1249d3ad05b20e06b94dd4052d299eb8c1c17d Mon Sep 17 00:00:00 2001 From: sarven Date: Tue, 20 Jan 2009 04:57:15 +0000 Subject: User statistics markup --- actions/showstream.php | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'actions') diff --git a/actions/showstream.php b/actions/showstream.php index 39c74f0ee..ead8521e6 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -455,31 +455,39 @@ class ShowstreamAction extends Action $notices->profile_id = $this->profile->id; $notice_count = (int) $notices->count(); - $this->elementStart('div', array('id' => 'statistics', + $this->elementStart('div', array('id' => 'user_statistics', 'class' => 'section')); - $this->element('h2', 'statistics', _('Statistics')); + $this->element('h2', null, _('Statistics')); // Other stats...? - $this->elementStart('dl', 'statistics'); - $this->element('dt', 'membersince', _('Member since')); - $this->element('dd', 'membersince', date('j M Y', + $this->elementStart('dl', 'user_member-since'); + $this->element('dt', null, _('Member since')); + $this->element('dd', null, date('j M Y', strtotime($this->profile->created))); + $this->elementEnd('dl'); - $this->elementStart('dt', 'subscriptions'); + $this->elementStart('dl', 'user_subscriptions'); + $this->elementStart('dt'); $this->element('a', array('href' => common_local_url('subscriptions', array('nickname' => $this->profile->nickname))), _('Subscriptions')); $this->elementEnd('dt'); - $this->element('dd', 'subscriptions', (is_int($subs_count)) ? $subs_count : '0'); - $this->elementStart('dt', 'subscribers'); + $this->element('dd', null, (is_int($subs_count)) ? $subs_count : '0'); + $this->elementEnd('dl'); + + $this->elementStart('dl', 'user_subscribers'); + $this->elementStart('dt'); $this->element('a', array('href' => common_local_url('subscribers', array('nickname' => $this->profile->nickname))), _('Subscribers')); $this->elementEnd('dt'); $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'); + $this->elementEnd('dl'); + + $this->elementStart('dl', 'user_notices'); + $this->element('dt', null, _('Notices')); + $this->element('dd', null, (is_int($notice_count)) ? $notice_count : '0'); $this->elementEnd('dl'); $this->elementEnd('div'); -- cgit v1.2.3-54-g00ecf From 7f60558cbbe6f7cd862d9e9cf11667f29d8b08d8 Mon Sep 17 00:00:00 2001 From: sarven Date: Tue, 20 Jan 2009 05:04:41 +0000 Subject: User subscriptions markup --- actions/showstream.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'actions') diff --git a/actions/showstream.php b/actions/showstream.php index ead8521e6..23013b007 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -382,14 +382,14 @@ class ShowstreamAction extends Action $subs_count = $subs->find(); - $this->elementStart('div', array('id' => 'subscriptions', + $this->elementStart('div', array('id' => 'user_subscriptions', 'class' => 'section')); $this->element('h2', null, _('Subscriptions')); if ($subs_count > 0) { - $this->elementStart('ul', array('id' => 'subscriptions_avatars')); + $this->elementStart('ul', 'users'); for ($i = 0; $i < min($subs_count, SUBSCRIPTIONS); $i++) { @@ -411,15 +411,16 @@ class ShowstreamAction extends Action $other->nickname, 'href' => $other->profileurl, 'rel' => 'contact', - 'class' => 'subscription fn url')); + 'class' => 'url')); $avatar = $other->getAvatar(AVATAR_MINI_SIZE); $this->element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_MINI_SIZE)), 'width' => AVATAR_MINI_SIZE, 'height' => AVATAR_MINI_SIZE, - 'class' => 'avatar mini photo', + 'class' => 'avatar photo', 'alt' => ($other->fullname) ? $other->fullname : $other->nickname)); + $this->element('span', 'fn nickname', $other->nickname); $this->elementEnd('a'); $this->elementEnd('li'); } @@ -428,11 +429,11 @@ class ShowstreamAction extends Action } if ($subs_count > SUBSCRIPTIONS) { - $this->elementStart('p', array('id' => 'subscriptions_viewall')); + $this->elementStart('p'); $this->element('a', array('href' => common_local_url('subscriptions', array('nickname' => $this->profile->nickname)), - 'class' => 'moresubscriptions'), + 'class' => 'mores'), _('All subscriptions')); $this->elementEnd('p'); } -- cgit v1.2.3-54-g00ecf From 918bd84c0d22251d30289b6bed41d4d2d417f591 Mon Sep 17 00:00:00 2001 From: sarven Date: Tue, 20 Jan 2009 05:06:46 +0000 Subject: Removed extra div --- actions/showstream.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'actions') diff --git a/actions/showstream.php b/actions/showstream.php index 23013b007..c8a6db675 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -338,8 +338,6 @@ class ShowstreamAction extends Action } $this->elementEnd('ul'); $this->elementEnd('div'); - - $this->elementEnd('div'); } function showRemoteSubscribeLink() -- cgit v1.2.3-54-g00ecf From 27308afe8509d14ae2efc20cd806fa8541eee017 Mon Sep 17 00:00:00 2001 From: sarven Date: Tue, 20 Jan 2009 05:11:45 +0000 Subject: Added mark_hash for content (i.e., to indicate tags with the character '#') --- actions/showstream.php | 1 + 1 file changed, 1 insertion(+) (limited to 'actions') diff --git a/actions/showstream.php b/actions/showstream.php index c8a6db675..b877f5df3 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -289,6 +289,7 @@ class ShowstreamAction extends Action $this->elementStart('ul', 'tags xoxo'); foreach ($tags as $tag) { $this->elementStart('li'); + $this->element('span', 'mark_hash', '#'); $this->element('a', array('rel' => 'tag', 'href' => common_local_url('peopletag', array('tag' => $tag))), -- cgit v1.2.3-54-g00ecf From 96dc058bfa499e4acf9248b116eada2009d72371 Mon Sep 17 00:00:00 2001 From: sarven Date: Tue, 20 Jan 2009 05:58:35 +0000 Subject: Using nickname only for uid --- actions/showstream.php | 17 +++++++++-------- theme/base/css/display.css | 17 ++++++++++------- 2 files changed, 19 insertions(+), 15 deletions(-) (limited to 'actions') diff --git a/actions/showstream.php b/actions/showstream.php index b877f5df3..1d79ea30d 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -239,6 +239,15 @@ class ShowstreamAction extends Action $this->elementEnd('dd'); $this->elementEnd('dl'); + $this->elementStart('dl', 'user_nickname'); + $this->element('dt', null, _('Nickname')); + $this->elementStart('dd'); + $this->element('a', array('href' => $this->profile->profileurl, + 'rel' => 'me', 'class' => 'nickname url uid'), + $this->profile->nickname); + $this->elementEnd('dd'); + $this->elementEnd('dl'); + if ($this->profile->fullname) { $this->elementStart('dl', 'user_fn'); $this->element('dt', null, _('Full name')); @@ -247,14 +256,6 @@ class ShowstreamAction extends Action $this->elementEnd('dd'); $this->elementEnd('dl'); } - $this->elementStart('dl', 'user_nickname'); - $this->element('dt', null, _('Nickname')); - $this->elementStart('dd'); - $this->element('a', array('href' => $this->profile->profileurl, - 'rel' => 'me', 'class' => 'fn nickname url uid'), - $this->profile->nickname); - $this->elementEnd('dd'); - $this->elementEnd('dl'); if ($this->profile->location) { $this->elementStart('dl', 'user_location'); diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 59429cf72..406ba3f9a 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -489,7 +489,7 @@ margin-bottom:0; /* user_profile */ #user_profile { position:relative; -width:633px; +width:475px; min-height:123px; float:left; margin-bottom:17px; @@ -514,7 +514,7 @@ width:96px; #user_profile .user_tags { float:left; clear:left; -margin-left:125px; +margin-left:113px; width:322px; margin-bottom:4px; } @@ -524,21 +524,24 @@ margin-bottom:4px; width:auto; clear:none; } -#user_profile .user_nickname { +#user_profile .user_fn { margin-left:11px; +margin-left:4px; +margin-right:4px; +font-weight:bold; } #user_profile .user_nickname .nickname { font-style:italic; font-weight:bold; -margin-left:4px; -margin-right:4px; } -#user_profile .user_nickname dd:before { +#user_profile .user_fn dd:before { content: "("; +font-weight:normal; } -#user_profile .user_nickname dd:after { +#user_profile .user_fn dd:after { content: ")"; +font-weight:normal; } #user_profile dt { -- cgit v1.2.3-54-g00ecf