From 77790ab7687c6ef6c86f502c27158ef71cdffa76 Mon Sep 17 00:00:00 2001 From: sarven Date: Mon, 19 Jan 2009 21:56:55 +0000 Subject: [PATCH 1/8] Featuerd profile list markup Minor class change to (un)subscribeform.php --- lib/profilelist.php | 53 ++++++++++++++++++++++------------------- lib/subscribeform.php | 15 +++++++++++- lib/unsubscribeform.php | 14 ++++++++++- 3 files changed, 55 insertions(+), 27 deletions(-) diff --git a/lib/profilelist.php b/lib/profilelist.php index fdc71ab8df..24b3573857 100644 --- a/lib/profilelist.php +++ b/lib/profilelist.php @@ -68,7 +68,7 @@ class ProfileList extends Widget function show() { - $this->out->elementStart('ul', array('id' => 'profiles', 'class' => 'profile_list')); + $this->out->elementStart('ul', 'profiles'); $cnt = 0; @@ -87,51 +87,40 @@ class ProfileList extends Widget function showProfile() { - $this->out->elementStart('li', array('class' => 'profile_single', - 'id' => 'profile-' . $this->profile->id)); + $this->out->elementStart('li', array('class' => 'profile vcard', + 'id' => 'profile-' . $this->profile->id)); $user = common_current_user(); - if ($user && $user->id != $this->profile->id) { - # XXX: special-case for user looking at own - # subscriptions page - if ($user->isSubscribed($this->profile)) { - $usf = new UnsubscribeForm($this->out, $this->profile); - $usf->show(); - } else { - $sf = new SubscribeForm($this->out, $this->profile); - $sf->show(); - } - } + + $this->out->elementStart('div', array('id' => 'user_profile', + 'class' => 'vcard')); $avatar = $this->profile->getAvatar(AVATAR_STREAM_SIZE); - $this->out->elementStart('a', array('href' => $this->profile->profileurl)); + $this->out->elementStart('a', array('href' => $this->profile->profileurl, + 'class' => 'url')); $this->out->element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE), - 'class' => 'avatar stream', + 'class' => 'photo avatar', 'width' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE, 'alt' => ($this->profile->fullname) ? $this->profile->fullname : $this->profile->nickname)); - $this->out->elementEnd('a'); - $this->out->elementStart('p'); - $this->out->elementStart('a', array('href' => $this->profile->profileurl, - 'class' => 'nickname')); + $this->out->elementStart('span', 'nickname'); $this->out->raw($this->highlight($this->profile->nickname)); + $this->out->elementEnd('span'); $this->out->elementEnd('a'); + if ($this->profile->fullname) { - $this->out->text(' | '); - $this->out->elementStart('span', 'fullname'); + $this->out->elementStart('span', 'fn'); $this->out->raw($this->highlight($this->profile->fullname)); $this->out->elementEnd('span'); } if ($this->profile->location) { - $this->out->text(' | '); $this->out->elementStart('span', 'location'); $this->out->raw($this->highlight($this->profile->location)); $this->out->elementEnd('span'); } - $this->out->elementEnd('p'); if ($this->profile->homepage) { $this->out->elementStart('p', 'website'); $this->out->elementStart('a', array('href' => $this->profile->homepage)); @@ -188,6 +177,20 @@ class ProfileList extends Widget $this->showOwnerControls($this->profile); } + $this->out->elementEnd('div'); + + if ($user && $user->id != $this->profile->id) { + # XXX: special-case for user looking at own + # subscriptions page + if ($user->isSubscribed($this->profile)) { + $usf = new UnsubscribeForm($this->out, $this->profile); + $usf->show(); + } else { + $sf = new SubscribeForm($this->out, $this->profile); + $sf->show(); + } + } + $this->out->elementEnd('li'); } @@ -202,4 +205,4 @@ class ProfileList extends Widget { return htmlspecialchars($text); } -} \ No newline at end of file +} diff --git a/lib/subscribeform.php b/lib/subscribeform.php index 996729a281..8b69efd1ac 100644 --- a/lib/subscribeform.php +++ b/lib/subscribeform.php @@ -80,6 +80,19 @@ class SubscribeForm extends Form return 'subscribe-' . $this->profile->id; } + + /** + * class of the form + * + * @return string of the form class + */ + + function formClass() + { + return 'form_subscribe'; + } + + /** * Action of the form * @@ -114,4 +127,4 @@ class SubscribeForm extends Form { $this->out->submit('submit', _('Subscribe')); } -} \ No newline at end of file +} diff --git a/lib/unsubscribeform.php b/lib/unsubscribeform.php index a724bb3122..b222f0e54d 100644 --- a/lib/unsubscribeform.php +++ b/lib/unsubscribeform.php @@ -80,6 +80,18 @@ class UnsubscribeForm extends Form return 'unsubscribe-' . $this->profile->id; } + + /** + * class of the form + * + * @return string of the form class + */ + + function formClass() + { + return 'form_unsubscribe'; + } + /** * Action of the form * @@ -114,4 +126,4 @@ class UnsubscribeForm extends Form { $this->out->submit('submit', _('Unsubscribe')); } -} \ No newline at end of file +} From 774fc5378bc89ccfa05ba613ffae96addd3427cf Mon Sep 17 00:00:00 2001 From: sarven Date: Mon, 19 Jan 2009 22:40:21 +0000 Subject: [PATCH 2/8] 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'); - $this->elementStart('ul', array('id' => 'profile_actions')); + 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('li', array('id' => 'profile_subscribe')); + $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('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'); From 8e8c5805862344b82f2b1b0a30cb376ec5d91160 Mon Sep 17 00:00:00 2001 From: sarven Date: Mon, 19 Jan 2009 23:19:05 +0000 Subject: [PATCH 3/8] showPageTitle() and showPageNoticeBlock() and using url on nickname instead of fullname --- actions/showstream.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/actions/showstream.php b/actions/showstream.php index 60270cfd7c..39c74f0ee6 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'); From ec1249d3ad05b20e06b94dd4052d299eb8c1c17d Mon Sep 17 00:00:00 2001 From: sarven Date: Tue, 20 Jan 2009 04:57:15 +0000 Subject: [PATCH 4/8] User statistics markup --- actions/showstream.php | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/actions/showstream.php b/actions/showstream.php index 39c74f0ee6..ead8521e6f 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'); From 7f60558cbbe6f7cd862d9e9cf11667f29d8b08d8 Mon Sep 17 00:00:00 2001 From: sarven Date: Tue, 20 Jan 2009 05:04:41 +0000 Subject: [PATCH 5/8] User subscriptions markup --- actions/showstream.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/actions/showstream.php b/actions/showstream.php index ead8521e6f..23013b007b 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'); } From 918bd84c0d22251d30289b6bed41d4d2d417f591 Mon Sep 17 00:00:00 2001 From: sarven Date: Tue, 20 Jan 2009 05:06:46 +0000 Subject: [PATCH 6/8] Removed extra div --- actions/showstream.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/actions/showstream.php b/actions/showstream.php index 23013b007b..c8a6db6756 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() From 27308afe8509d14ae2efc20cd806fa8541eee017 Mon Sep 17 00:00:00 2001 From: sarven Date: Tue, 20 Jan 2009 05:11:45 +0000 Subject: [PATCH 7/8] Added mark_hash for content (i.e., to indicate tags with the character '#') --- actions/showstream.php | 1 + 1 file changed, 1 insertion(+) diff --git a/actions/showstream.php b/actions/showstream.php index c8a6db6756..b877f5df35 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))), From 96dc058bfa499e4acf9248b116eada2009d72371 Mon Sep 17 00:00:00 2001 From: sarven Date: Tue, 20 Jan 2009 05:58:35 +0000 Subject: [PATCH 8/8] Using nickname only for uid --- actions/showstream.php | 17 +++++++++-------- theme/base/css/display.css | 17 ++++++++++------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/actions/showstream.php b/actions/showstream.php index b877f5df35..1d79ea30d2 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 59429cf726..406ba3f9ac 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 {