]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
better forms for new theme
authorEvan Prodromou <evan@prodromou.name>
Tue, 20 May 2008 17:47:59 +0000 (13:47 -0400)
committerEvan Prodromou <evan@prodromou.name>
Tue, 20 May 2008 17:47:59 +0000 (13:47 -0400)
darcs-hash:20080520174759-84dde-7206aeef3246b2304d463b121a6b17c7f3f2f6d5.gz

actions/login.php
actions/newnotice.php
actions/password.php
actions/profilesettings.php
actions/register.php
actions/showstream.php
doc/TODO
lib/util.php

index c9d887300140f2cd94014fab1346de62a986b277..89d06ee4d9a30c551bc11384c79b6061f48073e0 100644 (file)
@@ -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();
        }
index 8ea28360af4ab20a2d7595aba0be4624ee468a22..fed3278a47f1b0b5489a253f3b27c5b47a78cd77 100644 (file)
@@ -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();
        }
index 4174b6d013c3a6968ef4a2718c7840a304215ff8..6eba136cebaaf60ca642e25a41bfc6c16e8fa026 100644 (file)
@@ -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();
        }
index 15c455fe2e33579a2f58550c61fe93e4cb2e41a0..ab8175901aa805c76689031376c91ee94ab1a85f 100644 (file)
@@ -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();
        }
index fcf371d3a26f4234c0eb581fac7c66124935612e..f9402b98f4f251dc60889d72b316d1afc68b51f4 100644 (file)
@@ -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();
        }
index 6cd4773ee73e699c2d7b5bf03e0f1c313f9bf7f9..0db76806d9e783fe67c5730ecad7898bf4d61f48 100644 (file)
@@ -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');
        }
 
index 4d320b978af4eedd083c68de900df63e879c70a4..338a298ddeed818d540fa5111d4823286d86b502 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -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
index 24f0e5dd8b530e2e3d43097b4186f70add97339c..83fbb4a5b0fb19bc558e7b270b393b0cf1f076ea 100644 (file)
@@ -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