[aur-dev] [PATCH 2/2] Sync account editing page with archweb

Lukas Fleischer archlinux at cryptocrack.de
Fri Sep 21 10:55:39 EDT 2012


Synchronize the layout of the account editing page with the profiles
page from archweb.

Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
---
 web/template/account_edit_form.php | 181 ++++++++++++++++---------------------
 1 file changed, 76 insertions(+), 105 deletions(-)

diff --git a/web/template/account_edit_form.php b/web/template/account_edit_form.php
index b1cb749..477edca 100644
--- a/web/template/account_edit_form.php
+++ b/web/template/account_edit_form.php
@@ -1,7 +1,7 @@
 <?php if ($A == "UpdateAccount"): ?>
-<form action="<?php echo get_user_uri($U) . 'update/'; ?>" method="post">
+<form id="edit-profile-form" action="<?php echo get_user_uri($U) . 'update/'; ?>" method="post">
 <?php else: ?>
-<form action="<?php echo get_uri('/register/'); ?>" method="post">
+<form id="edit-profile-form" action="<?php echo get_uri('/register/'); ?>" method="post">
 <?php endif; ?>
 	<fieldset>
 		<input type="hidden" name="Action" value="<?php echo $A ?>" />
@@ -10,106 +10,84 @@
 		<input type="hidden" name="token" value="<?php print htmlspecialchars($_COOKIE['AURSID']) ?>" />
 		<?php endif; ?>
 	</fieldset>
-	<table>
-		<tr>
-			<td colspan="2"> </td>
-		</tr>
-
-		<tr>
-			<td align="left"><?php echo __("Username") ?>:</td>
-			<td align="left"><input type="text" size="30" maxlength="64" name="U" value="<?php echo htmlspecialchars($U,ENT_QUOTES) ?>" /> (<?php echo __("required") ?>)</td>
-		</tr>
+	<fieldset>
+		<p>
+			<label for="id_username"><?php echo __("Username") ?>:</label>
+			<input type="text" size="30" maxlength="64" name="U" id="id_username" value="<?php echo htmlspecialchars($U,ENT_QUOTES) ?>" /> (<?php echo __("required") ?>)
+		</p>
 		<?php
 		# Only TUs or Devs can promote/demote/suspend a user
 		if ($UTYPE == "Trusted User" || $UTYPE == "Developer"):
 		?>
-		<tr>
-			<td align="left"><?php echo __("Account Type") ?>:</td>
-			<td align="left">
-				<select name=T>
-					<?php if ($T == "User"): ?>
-					<option value="1" selected><?php echo __("Normal user") ?>
-					<?php else: ?>
-					<option value="1"><?php echo __("Normal user") ?>
-					<?php endif; ?>
-					<?php if ($T == "Trusted User"): ?>
-					<option value="2" selected><?php echo __("Trusted user") ?>
-					<?php else: ?>
-					<option value="2"><?php echo __("Trusted user") ?>
-					<?php endif; ?>
-					<?php
-					# Only developers can make another account a developer
-					if ($UTYPE == "Developer"):
-					?>
-					<option value="3"
-					<?php $T == "Developer" ? print " selected>" : print ">";
-					print __("Developer")."\n"; ?>
-					<?php endif; ?>
-				</select>
-			</td>
-		</tr>
-
-		<tr>
-			<td align="left"><?php echo __("Account Suspended") ?>:</td>
+		<p>
+			<label for="id_type"><?php echo __("Account Type") ?>:</label>
+			<select name="T" id="id_type">
+				<?php if ($T == "User"): ?>
+				<option value="1" selected><?php echo __("Normal user") ?>
+				<?php else: ?>
+				<option value="1"><?php echo __("Normal user") ?>
+				<?php endif; ?>
+				<?php if ($T == "Trusted User"): ?>
+				<option value="2" selected><?php echo __("Trusted user") ?>
+				<?php else: ?>
+				<option value="2"><?php echo __("Trusted user") ?>
+				<?php endif; ?>
+				<?php
+				# Only developers can make another account a developer
+				if ($UTYPE == "Developer"):
+				?>
+				<option value="3"
+				<?php $T == "Developer" ? print " selected>" : print ">";
+				print __("Developer")."\n"; ?>
+				<?php endif; ?>
+			</select>
+		</p>
 
+		<p>
+			<label for="id_suspended"><?php echo __("Account Suspended") ?>:</label>
 			<?php if ($S): ?>
-			<td align="left"><input type="checkbox" name="S" checked="checked" />
+			<input type="checkbox" name="S" id="id_suspended" checked="checked" />
 			<?php else: ?>
-			<td align="left"><input type="checkbox" name="S" />
+			<input type="checkbox" name="S" id="id_suspended" />
 			<?php endif; ?>
-		</tr>
+		</p>
 		<?php endif; ?>
 
-		<tr>
-			<td align="left"><?php echo __("Email Address") ?>:</td>
-			<td align="left"><input type="text" size="30" maxlength="64" name="E" value="<?php echo htmlspecialchars($E,ENT_QUOTES) ?>" /> (<?php echo __("required") ?>)</td>
-		</tr>
+		<p>
+			<label for="id_email"><?php echo __("Email Address") ?>:</label>
+			<input type="text" size="30" maxlength="64" name="E" id="id_email" value="<?php echo htmlspecialchars($E,ENT_QUOTES) ?>" /> (<?php echo __("required") ?>)
+		</p>
 
-		<tr>
-			<td align="left"><?php echo __("Password") ?>:</td>
-			<td align="left">
-				<input type="password" size="30" maxlength="32" name="P" value="<?php echo $P ?>" />
-				<?php if ($A != "UpdateAccount"):
-					print " (".__("required").")";
-				endif; ?>
-			</td>
-		</tr>
+		<p>
+			<label for="id_passwd1"><?php echo __("Password") ?>:</label>
+			<input type="password" size="30" maxlength="32" name="P" id="id_passwd1" value="<?php echo $P ?>" />
+			<?php if ($A != "UpdateAccount"): print " (".__("required").")"; endif; ?>
+		</p>
 
-		<tr>
-			<td align="left"><?php echo __("Re-type password") ?>:</td>
-			<td align="left">
-				<input type="password" size="30" maxlength="32" name="C" value="<?php echo $C ?>" />
-				<?php if ($A != "UpdateAccount"):
-					print " (".__("required").")";
-				endif; ?>
-			</td>
-		</tr>
+		<p>
+			<label for="id_passwd2"><?php echo __("Re-type password") ?>:</label>
+			<input type="password" size="30" maxlength="32" name="C" id="id_passwd2" value="<?php echo $C ?>" />
+			<?php if ($A != "UpdateAccount"): print " (".__("required").")"; endif; ?>
+		</p>
 
-		<tr>
-			<td align="left"><?php echo __("Real Name") ?>:</td>
-			<td align="left">
-				<input type="text" size="30" maxlength="32" name="R" value="<?php echo htmlspecialchars($R,ENT_QUOTES) ?>" />
-			</td>
-		</tr>
+		<p>
+			<label for="id_realname"><?php echo __("Real Name") ?>:</label>
+			<input type="text" size="30" maxlength="32" name="R" id="id_realname" value="<?php echo htmlspecialchars($R,ENT_QUOTES) ?>" />
+		</p>
 
-		<tr>
-			<td align="left"><?php echo __("IRC Nick") ?>:</td>
-			<td align="left">
-				<input type="text" size="30" maxlength="32" name="I" value="<?php echo htmlspecialchars($I,ENT_QUOTES) ?>" />
-			</td>
-		</tr>
+		<p>
+			<label for="id_irc"><?php echo __("IRC Nick") ?>:</label>
+			<input type="text" size="30" maxlength="32" name="I" id="id_irc" value="<?php echo htmlspecialchars($I,ENT_QUOTES) ?>" />
+		</p>
 
-		<tr>
-			<td align="left"><?php echo __("PGP Key Fingerprint") ?>:</td>
-<td align="left">
-				<input type="text" size="30" maxlength="50" name="K" value="<?php echo html_format_pgp_fingerprint($K) ?>" />
-			</td>
-		</tr>
+		<p>
+			<label for="id_pgp"><?php echo __("PGP Key Fingerprint") ?>:</label>
+			<input type="text" size="30" maxlength="50" name="K" id="id_pgp" value="<?php echo html_format_pgp_fingerprint($K) ?>" />
+		</p>
 
-		<tr>
-			<td align="left"><?php echo __("Language") ?>:</td>
-			<td align="left">
-				<select name=L>
+		<p>
+			<label for="id_language"><?php echo __("Language") ?>:</label>
+			<select name="L" id="id_language">
 <?php
 	reset($SUPPORTED_LANGS);
 	while (list($code, $lang) = each($SUPPORTED_LANGS)) {
@@ -120,24 +98,17 @@
 		}
 	}
 ?>
-				</select>
-			</td>
-		</tr>
-
-		<tr>
-			<td colspan="2"> </td>
-		</tr>
-		<tr>
-			<td> </td>
-			<td align="left">
-				<?php if ($A == "UpdateAccount"): ?>
-				<input type="submit" class="button" value="<?php echo __("Update") ?>" />  
-				<?php else: ?>
-				<input type="submit" class="button" value="<?php echo __("Create") ?>" />  
-				<?php endif; ?>
-				<input type="reset" class="button" value="<?php echo __("Reset") ?>" />
-			</td>
-		</tr>
+			</select>
+		</p>
 
-	</table>
+		<p>
+			<label></label>
+			<?php if ($A == "UpdateAccount"): ?>
+			<input type="submit" class="button" value="<?php echo __("Update") ?>" />  
+			<?php else: ?>
+			<input type="submit" class="button" value="<?php echo __("Create") ?>" />  
+			<?php endif; ?>
+			<input type="reset" class="button" value="<?php echo __("Reset") ?>" />
+		</p>
+	</fieldset>
 </form>
-- 
1.7.12



More information about the aur-dev mailing list