diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-05-20 13:47:59 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-05-20 13:47:59 -0400 |
commit | 6f6aed821387075de8c22da55c5620c04cda0dc1 (patch) | |
tree | 8716a289525c274c03c7c1a2910fbdf465f343aa | |
parent | 8e81943c2c6588be7e4c695172e757243b7a0d74 (diff) |
better forms for new theme
darcs-hash:20080520174759-84dde-7206aeef3246b2304d463b121a6b17c7f3f2f6d5.gz
-rw-r--r-- | actions/login.php | 16 | ||||
-rw-r--r-- | actions/newnotice.php | 4 | ||||
-rw-r--r-- | actions/password.php | 5 | ||||
-rw-r--r-- | actions/profilesettings.php | 5 | ||||
-rw-r--r-- | actions/register.php | 33 | ||||
-rw-r--r-- | actions/showstream.php | 4 | ||||
-rw-r--r-- | doc/TODO | 2 | ||||
-rw-r--r-- | lib/util.php | 13 |
8 files changed, 27 insertions, 55 deletions
diff --git a/actions/login.php b/actions/login.php index c9d887300..89d06ee4d 100644 --- a/actions/login.php +++ b/actions/login.php @@ -61,24 +61,12 @@ class LoginAction extends Action { common_element_start('form', array('method' => 'POST', 'id' => 'login', 'action' => common_local_url('login'))); - common_element('label', array('for' => 'nickname'), - _t('Name')); - common_element('input', array('name' => 'nickname', - 'type' => 'text', - 'id' => 'nickname')); - common_element('label', array('for' => 'password'), - _t('Password')); - common_element('input', array('name' => 'password', - 'type' => 'password', - 'id' => 'password')); + common_input('nickname', _t('Nickname')); + common_password('password', _t('Password')); common_element('input', array('name' => 'submit', 'type' => 'submit', 'id' => 'submit', 'value' => _t('Login'))); - common_element('input', array('name' => 'cancel', - 'type' => 'button', - 'id' => 'cancel', - 'value' => _t('Cancel'))); common_element_end('form'); common_show_footer(); } diff --git a/actions/newnotice.php b/actions/newnotice.php index 8ea28360a..fed3278a4 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -57,11 +57,11 @@ class NewnoticeAction extends Action { common_element_start('form', array('id' => 'newnotice', 'method' => 'POST', 'action' => common_local_url('newnotice'))); common_element('span', 'nickname', $profile->nickname); - common_element('textarea', array('rows' => 4, 'cols' => 80, + common_element('textarea', array('rows' => 3, 'cols' => 60, 'name' => 'content', 'id' => 'content'), ' '); - common_element('input', array('type' => 'submit', 'value' => 'Send')); + common_submit('submit', _t('Send')); common_element_end('form'); common_show_footer(); } diff --git a/actions/password.php b/actions/password.php index 4174b6d01..6eba136ce 100644 --- a/actions/password.php +++ b/actions/password.php @@ -34,10 +34,7 @@ class PasswordAction extends SettingsAction { common_password('oldpassword', _t('Old password')); common_password('newpassword', _t('New password')); common_password('confirm', _t('Confirm')); - common_element('input', array('name' => 'submit', - 'type' => 'submit', - 'id' => 'submit', - 'value' => _t('Change'))); + common_submit('submit', _t('Change')); common_element_end('form'); common_show_footer(); } diff --git a/actions/profilesettings.php b/actions/profilesettings.php index 15c455fe2..ab8175901 100644 --- a/actions/profilesettings.php +++ b/actions/profilesettings.php @@ -46,10 +46,7 @@ class ProfilesettingsAction extends SettingsAction { ($this->arg('bio')) ? $this->arg('bio') : $profile->bio); common_input('location', _t('Location'), ($this->arg('location')) ? $this->arg('location') : $profile->location); - common_element('input', array('name' => 'submit', - 'type' => 'submit', - 'id' => 'submit', - 'value' => _t('Save'))); + common_submit('submit', _t('Save')); common_element_end('form'); common_show_footer(); } diff --git a/actions/register.php b/actions/register.php index fcf371d3a..f9402b98f 100644 --- a/actions/register.php +++ b/actions/register.php @@ -107,34 +107,11 @@ class RegisterAction extends Action { common_element_start('form', array('method' => 'POST', 'id' => 'login', 'action' => common_local_url('register'))); - common_element('label', array('for' => 'nickname'), - _t('Name')); - common_element('input', array('name' => 'nickname', - 'type' => 'text', - 'id' => 'nickname')); - common_element('label', array('for' => 'password'), - _t('Password')); - common_element('input', array('name' => 'password', - 'type' => 'password', - 'id' => 'password')); - common_element('label', array('for' => 'confirm'), - _t('Confirm')); - common_element('input', array('name' => 'confirm', - 'type' => 'password', - 'id' => 'confirm')); - common_element('label', array('for' => 'email'), - _t('Email')); - common_element('input', array('name' => 'email', - 'type' => 'text', - 'id' => 'email')); - common_element('input', array('name' => 'submit', - 'type' => 'submit', - 'id' => 'submit', - 'value' => _t('Register'))); - common_element('input', array('name' => 'cancel', - 'type' => 'button', - 'id' => 'cancel', - 'value' => _t('Cancel'))); + common_input('nickname', _t('Nickname')); + common_password('password', _t('Password')); + common_password('confirm', _t('Confirm')); + common_input('email', _t('Email')); + common_submit('submit', _t('Register')); common_element_end('form'); common_show_footer(); } diff --git a/actions/showstream.php b/actions/showstream.php index 6cd4773ee..0db76806d 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -83,11 +83,11 @@ class ShowstreamAction extends StreamAction { function notice_form() { common_element_start('form', array('id' => 'newnotice', 'method' => 'POST', 'action' => common_local_url('newnotice'))); - common_element('textarea', array('rows' => 4, 'cols' => 80, + common_element('textarea', array('rows' => 3, 'cols' => 60, 'name' => 'content', 'id' => 'content'), ' '); - common_element('input', array('type' => 'submit', 'value' => 'Send')); + common_submit('submit', _t('Send')); common_element_end('form'); } @@ -25,7 +25,7 @@ + common_redirect() + configuration system ($config) + release 0.1 -- design from Open Source Web Designs ++ design from Open Source Web Designs + add H1 to each page + add H2 for each page section - doc action diff --git a/lib/util.php b/lib/util.php index 24f0e5dd8..83fbb4a5b 100644 --- a/lib/util.php +++ b/lib/util.php @@ -194,6 +194,7 @@ function common_menu_item($url, $text, $title=NULL) { } function common_input($id, $label, $value=NULL) { + common_element_start('p'); common_element('label', array('for' => $id), $label); $attrs = array('name' => $id, 'type' => 'text', @@ -202,14 +203,26 @@ function common_input($id, $label, $value=NULL) { $attrs['value'] = htmlspecialchars($value); } common_element('input', $attrs); + comon_element_end('p'); } function common_password($id, $label) { + common_element_start('p'); common_element('label', array('for' => $id), $label); $attrs = array('name' => $id, 'type' => 'password', 'id' => $id); common_element('input', $attrs); + comon_element_end('p'); +} + +function common_submit($id, $label) { + common_element_start('p'); + common_element('input', array('type' => 'submit', + 'id' => $id, + 'name' => $id, + 'value' => $label)); + comon_element_end('p'); } # salted, hashed passwords are stored in the DB |