move instructions up to the "whats up" area

darcs-hash:20080618035739-84dde-a562cffe186780d5f03cf53798ea249b2bda9fb1.gz
This commit is contained in:
Evan Prodromou 2008-06-17 23:57:39 -04:00
parent fddcfd75c5
commit 56de872740
8 changed files with 87 additions and 34 deletions

View File

@ -23,20 +23,25 @@ require_once(INSTALLDIR.'/lib/settingsaction.php');
class AvatarAction extends SettingsAction { class AvatarAction extends SettingsAction {
function show_form($msg=NULL, $success=false) { function show_top($arr) {
common_show_header(_t('Avatar'), NULL, NULL, array($this, 'settings_menu')); $msg = $arr[0];
$success = $arr[1];
if ($msg) { if ($msg) {
$this->message($msg, $success); $this->message($msg, $success);
} else { } else {
common_element('div', 'instructions', common_element('div', 'instructions',
_t('You can upload a new "avatar" (user picture) here. ' . _t('Upload a new "avatar" (user image) here. ' .
'You can\'t edit the picture after you upload it, so you should ' . 'You can\'t edit the picture after you upload it, so ' .
'edit it in your desktop image-manipulation software first. ' . 'make sure it\'s more or less square. ' .
'Everything works best if your picture is more or less square. ' . 'It must be under the site license, also. ' .
'And remember: your image will be released under the site license, ' . 'Use a picture that belongs to you and that you ' .
'So don\'t upload images that don\'t belong to you or that you don\'t ' .
'want to share.')); 'want to share.'));
} }
$this->settings_menu();
}
function show_form($msg=NULL, $success=false) {
common_show_header(_t('Avatar'), NULL, array($msg, $success), array($this, 'show_top'));
$user = common_current_user(); $user = common_current_user();
$profile = $user->getProfile(); $profile = $user->getProfile();

View File

@ -60,14 +60,7 @@ class LoginAction extends Action {
} }
function show_form($error=NULL) { function show_form($error=NULL) {
common_show_header(_t('Login')); common_show_header(_t('Login'), NULL, $error, array($this, 'show_top'));
if ($error) {
common_element('div', array('class' => 'error'), $error);
} else {
common_element('div', 'instructions',
_t('Login with your username and password. ' .
'Don\'t have a username yet? Choose register above. '));
}
common_element_start('form', array('method' => 'POST', common_element_start('form', array('method' => 'POST',
'id' => 'login', 'id' => 'login',
'action' => common_local_url('login'))); 'action' => common_local_url('login')));
@ -77,4 +70,14 @@ class LoginAction extends Action {
common_element_end('form'); common_element_end('form');
common_show_footer(); common_show_footer();
} }
function show_top($error=NULL) {
if ($error) {
common_element('p', 'error', $error);
} else {
common_element('p', 'instructions',
_t('Login with your username and password. ' .
'Don\'t have a username yet? Choose register above. '));
}
}
} }

View File

@ -23,14 +23,21 @@ require_once(INSTALLDIR.'/lib/settingsaction.php');
class PasswordAction extends SettingsAction { class PasswordAction extends SettingsAction {
function show_form($msg=NULL, $success=false) { function show_top($arr) {
common_show_header(_t('Change password'), NULL, NULL, array($this, 'settings_menu')); $msg = $arr[0];
$success = $arr[1];
if ($msg) { if ($msg) {
$this->message($msg, $success); $this->message($msg, $success);
} else { } else {
common_element('div', 'instructions', common_element('div', 'instructions',
_t('You can change your password here. Choose a good one!')); _t('You can change your password here. Choose a good one!'));
} }
$this->settings_menu();
}
function show_form($msg=NULL, $success=false) {
common_show_header(_t('Change password'), NULL,
array($msg, $success), array($this, 'show_top'));
common_element_start('form', array('method' => 'POST', common_element_start('form', array('method' => 'POST',
'id' => 'password', 'id' => 'password',
'action' => 'action' =>

View File

@ -23,18 +23,25 @@ require_once(INSTALLDIR.'/lib/settingsaction.php');
class ProfilesettingsAction extends SettingsAction { class ProfilesettingsAction extends SettingsAction {
function show_form($msg=NULL, $success=false) { function show_top($arr) {
$user = common_current_user(); $msg = $arr[0];
$profile = $user->getProfile(); $success = $arr[1];
common_show_header(_t('Profile settings'), NULL, NULL, array($this, 'settings_menu'));
if ($msg) { if ($msg) {
$this->message($msg, $success); $this->message($msg, $success);
} else { } else {
common_element('div', 'instructions', common_element('div', 'instructions',
_t('You can update your personal profile info here '. _t('You can update your personal profile info here '.
'so people know more about you. ')); 'so people know more about you.'));
} }
$this->settings_menu();
}
function show_form($msg=NULL, $success=false) {
$user = common_current_user();
$profile = $user->getProfile();
common_show_header(_t('Profile settings'), NULL, array($msg, $success),
array($this, 'show_top'));
common_element_start('form', array('method' => 'POST', common_element_start('form', array('method' => 'POST',
'id' => 'profilesettings', 'id' => 'profilesettings',
'action' => 'action' =>

View File

@ -115,16 +115,19 @@ class RegisterAction extends Action {
return $result; return $result;
} }
function show_top($error=NULL) {
if ($error) {
common_element('p', 'error', $error);
} else {
common_element('p', 'instructions',
_t('You can create a new account to start posting notices.'));
}
}
function show_form($error=NULL) { function show_form($error=NULL) {
global $config; global $config;
common_show_header(_t('Register')); common_show_header(_t('Register'), NULL, $error, array($this, 'show_top'));
if ($error) {
common_element('div', 'error', $error);
} else {
common_element('div', 'instructions',
_t('You can create a new account to start posting notices. '));
}
common_element_start('form', array('method' => 'POST', common_element_start('form', array('method' => 'POST',
'id' => 'login', 'id' => 'login',
'action' => common_local_url('register'))); 'action' => common_local_url('register')));

View File

@ -40,7 +40,9 @@ class ShownoticeAction extends StreamAction {
# Looks like we're good; show the header # Looks like we're good; show the header
common_show_header($profile->nickname."'s status on ".common_date_string($notice->created)); common_show_header($profile->nickname."'s status on ".common_date_string($notice->created),
NULL, $user,
array($this, 'show_top'));
common_element_start('ul', array('id' => 'notices')); common_element_start('ul', array('id' => 'notices'));
$this->show_notice($notice); $this->show_notice($notice);
@ -49,6 +51,14 @@ class ShownoticeAction extends StreamAction {
common_show_footer(); common_show_footer();
} }
function show_top($user) {
$cur = common_current_user();
if ($cur && $cur->id == $user->id) {
common_notice_form();
}
}
function no_such_notice() { function no_such_notice() {
common_user_error('No such notice.'); common_user_error('No such notice.');
} }

View File

@ -41,11 +41,20 @@ class SubscribedAction extends Action {
} }
$page = $this->arg('page') || 1; $page = $this->arg('page') || 1;
common_show_header($profile->nickname . ": " . _t('Subscribers')); common_show_header($profile->nickname . ": " . _t('Subscribers'),
NULL, $profile,
array($this, 'show_top'));
$this->show_subscribed($profile, $page); $this->show_subscribed($profile, $page);
common_show_footer(); common_show_footer();
} }
function show_top($profile) {
$user = common_current_user();
common_element('p', 'instructions',
_t('These are the people who listen to ') .
(($user && ($user->id == $profile->id)) ? _t('your notices.') : ($profile->nickname . _t('\'s notices.'))));
}
function show_subscribed($profile, $page) { function show_subscribed($profile, $page) {
global $config; global $config;

View File

@ -38,11 +38,20 @@ class SubscriptionsAction extends Action {
$this->no_such_user(); $this->no_such_user();
} }
$page = $this->arg('page') || 1; $page = $this->arg('page') || 1;
common_show_header($profile->nickname . ": " . _t('Subscriptions')); common_show_header($profile->nickname . ": " . _t('Subscriptions'),
NULL, $profile,
array($this, 'show_top'));
$this->show_subscriptions($profile, $page); $this->show_subscriptions($profile, $page);
common_show_footer(); common_show_footer();
} }
function show_top($profile) {
$user = common_current_user();
common_element('p', 'instructions',
_t('These are the people whose notices ') .
(($user && ($user->id == $profile->id)) ? _t('you listen to.') : ($profile->nickname . _t(' listens to.'))));
}
function show_subscriptions($profile, $page) { function show_subscriptions($profile, $page) {
$subs = DB_DataObject::factory('subscription'); $subs = DB_DataObject::factory('subscription');