make presentation of remote subscribe nicer

darcs-hash:20080610143709-84dde-ce586d1ca5bb73bdeef8b254f8835f599b769714.gz
This commit is contained in:
Evan Prodromou 2008-06-10 10:37:09 -04:00
parent e16016a096
commit cb0dfba149

View File

@ -46,7 +46,7 @@ class ShowstreamAction extends StreamAction {
} }
# Looks like we're good; start output # Looks like we're good; start output
# For YADIS discovery, we also have a <meta> tag # For YADIS discovery, we also have a <meta> tag
header('X-XRDS-Location: '. common_local_url('xrds', array('nickname' => header('X-XRDS-Location: '. common_local_url('xrds', array('nickname' =>
@ -61,9 +61,9 @@ class ShowstreamAction extends StreamAction {
} }
$this->show_sidebar($profile); $this->show_sidebar($profile);
$this->show_notices($profile); $this->show_notices($profile);
common_show_footer(); common_show_footer();
} }
@ -78,7 +78,7 @@ class ShowstreamAction extends StreamAction {
'content' => common_local_url('xrds', array('nickname' => 'content' => common_local_url('xrds', array('nickname' =>
$user->nickname)))); $user->nickname))));
} }
function no_such_user() { function no_such_user() {
common_user_error('No such user'); common_user_error('No such user');
} }
@ -111,7 +111,7 @@ class ShowstreamAction extends StreamAction {
common_element_end('div'); common_element_end('div');
} }
function show_profile($profile) { function show_profile($profile) {
common_element_start('div', 'profile'); common_element_start('div', 'profile');
@ -156,14 +156,22 @@ class ShowstreamAction extends StreamAction {
} }
function show_remote_subscribe_form($profile) { function show_remote_subscribe_form($profile) {
common_element_start('form', array('id' => 'remotesubscribe', 'method' => 'POST', common_element_start('form', array('id' => 'remotesubscribe',
'method' => 'POST',
'action' => common_local_url('remotesubscribe'))); 'action' => common_local_url('remotesubscribe')));
common_hidden('nickname', $profile->nickname); common_hidden('nickname', $profile->nickname);
common_input('profile', _t('Profile')); common_element('input', array('name' => 'profile',
common_submit('submit',_t('Subscribe')); 'type' => 'text',
'id' => 'profile',
'size' => '15'));
common_element('input', array('type' => 'submit',
'id' => 'submit',
'name' => 'submit',
'value' => _t('Subscribe'),
'class' => 'button'));
common_element_end('form'); common_element_end('form');
} }
function show_unsubscribe_form($profile) { function show_unsubscribe_form($profile) {
common_element_start('form', array('id' => 'unsubscribe', 'method' => 'POST', common_element_start('form', array('id' => 'unsubscribe', 'method' => 'POST',
'action' => common_local_url('unsubscribe'))); 'action' => common_local_url('unsubscribe')));
@ -179,7 +187,7 @@ class ShowstreamAction extends StreamAction {
function show_subscriptions($profile) { function show_subscriptions($profile) {
global $config; global $config;
# XXX: add a limit # XXX: add a limit
$subs = DB_DataObject::factory('subscription'); $subs = DB_DataObject::factory('subscription');
$subs->subscriber = $profile->id; $subs->subscriber = $profile->id;
@ -201,9 +209,9 @@ class ShowstreamAction extends StreamAction {
if ($idx % SUBSCRIPTIONS_PER_ROW == 1) { if ($idx % SUBSCRIPTIONS_PER_ROW == 1) {
common_element_start('div', 'row'); common_element_start('div', 'row');
} }
$other = Profile::staticGet($subs->subscribed); $other = Profile::staticGet($subs->subscribed);
common_element_start('a', array('title' => ($other->fullname) ? common_element_start('a', array('title' => ($other->fullname) ?
$other->fullname : $other->fullname :
$other->nickname, $other->nickname,
@ -218,11 +226,11 @@ class ShowstreamAction extends StreamAction {
$other->fullname : $other->fullname :
$other->nickname)); $other->nickname));
common_element_end('a'); common_element_end('a');
if ($idx % SUBSCRIPTIONS_PER_ROW == 0) { if ($idx % SUBSCRIPTIONS_PER_ROW == 0) {
common_element_end('div'); common_element_end('div');
} }
if ($idx == SUBSCRIPTIONS) { if ($idx == SUBSCRIPTIONS) {
break; break;
} }
@ -298,24 +306,24 @@ class ShowstreamAction extends StreamAction {
if ($page > 1) { if ($page > 1) {
common_element_start('span', 'floatLeft width25'); common_element_start('span', 'floatLeft width25');
common_element('a', array('href' => common_local_url('showstream', common_element('a', array('href' => common_local_url('showstream',
array('nickname' => $profile->nickname, array('nickname' => $profile->nickname,
'page' => $page-1)), 'page' => $page-1)),
'class' => 'newer'), 'class' => 'newer'),
_t('Newer')); _t('Newer'));
common_element_end('span'); common_element_end('span');
} }
if ($cnt > NOTICES_PER_PAGE) { if ($cnt > NOTICES_PER_PAGE) {
common_element_start('span', 'floatRight width25'); common_element_start('span', 'floatRight width25');
common_element('a', array('href' => common_local_url('showstream', common_element('a', array('href' => common_local_url('showstream',
array('nickname' => $profile->nickname, array('nickname' => $profile->nickname,
'page' => $page+1)), 'page' => $page+1)),
'class' => 'older'), 'class' => 'older'),
_t('Older')); _t('Older'));
common_element_end('span'); common_element_end('span');
} }
# XXX: show a link for the next page # XXX: show a link for the next page
common_element_end('div'); common_element_end('div');
} }
@ -339,7 +347,7 @@ class ShowstreamAction extends StreamAction {
common_element_end('div'); common_element_end('div');
} }
function show_notice($notice) { function show_notice($notice) {
$profile = $notice->getProfile(); $profile = $notice->getProfile();
# XXX: RDFa # XXX: RDFa