[aur-dev] [PATCH] account_details.php: Add link to edit a user's account
This improves the ability to edit a user's account directly through UI features rather than manually appending 'edit' to the URL or searching for the account and selecting edit. Signed-off-by: canyonknight <canyonknight@gmail.com> --- web/template/account_details.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/template/account_details.php b/web/template/account_details.php index 02ed32b..1f10bc1 100644 --- a/web/template/account_details.php +++ b/web/template/account_details.php @@ -53,6 +53,10 @@ <th>Links:</th> <td> <a href="<?= get_uri('/packages/'); ?>?K=<?= $row['Username'] ?>&SeB=m"><?= __("View this user's packages") ?></a> + <?php if (can_edit_account($atype, $row, uid_from_sid($_COOKIE['AURSID']))): ?> + <br /> + <a href="<?= get_user_uri($row['Username']); ?>edit"><?= __("Edit this user's account") ?></a> + <?php endif; ?> </td> </tr> </table> -- 1.8.5.3
On Mon, 20 Jan 2014 at 02:29:33, canyonknight wrote:
This improves the ability to edit a user's account directly through UI features rather than manually appending 'edit' to the URL or searching for the account and selecting edit.
Signed-off-by: canyonknight <canyonknight@gmail.com> --- web/template/account_details.php | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/web/template/account_details.php b/web/template/account_details.php index 02ed32b..1f10bc1 100644 --- a/web/template/account_details.php +++ b/web/template/account_details.php @@ -53,6 +53,10 @@ <th>Links:</th> <td> <a href="<?= get_uri('/packages/'); ?>?K=<?= $row['Username'] ?>&SeB=m"><?= __("View this user's packages") ?></a> + <?php if (can_edit_account($atype, $row, uid_from_sid($_COOKIE['AURSID']))): ?> + <br /> + <a href="<?= get_user_uri($row['Username']); ?>edit"><?= __("Edit this user's account") ?></a> + <?php endif; ?>
Yes, this is useful. Do we want an unordered list instead of links separated by newlines here? The downside of converting this into a list is that most users will only see one item. So maybe use a <ul></ul> with "list-style-type: none;"?
</td> </tr> </table> -- 1.8.5.3
On Mon, Jan 20, 2014 at 9:39 AM, Lukas Fleischer <archlinux@cryptocrack.de> wrote:
On Mon, 20 Jan 2014 at 02:29:33, canyonknight wrote:
This improves the ability to edit a user's account directly through UI features rather than manually appending 'edit' to the URL or searching for the account and selecting edit.
Signed-off-by: canyonknight <canyonknight@gmail.com> --- web/template/account_details.php | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/web/template/account_details.php b/web/template/account_details.php index 02ed32b..1f10bc1 100644 --- a/web/template/account_details.php +++ b/web/template/account_details.php @@ -53,6 +53,10 @@ <th>Links:</th> <td> <a href="<?= get_uri('/packages/'); ?>?K=<?= $row['Username'] ?>&SeB=m"><?= __("View this user's packages") ?></a> + <?php if (can_edit_account($atype, $row, uid_from_sid($_COOKIE['AURSID']))): ?> + <br /> + <a href="<?= get_user_uri($row['Username']); ?>edit"><?= __("Edit this user's account") ?></a> + <?php endif; ?>
Yes, this is useful. Do we want an unordered list instead of links separated by newlines here? The downside of converting this into a list is that most users will only see one item. So maybe use a <ul></ul> with "list-style-type: none;"?
Sounds like a good compromise. I'll re-submit.
</td> </tr> </table> -- 1.8.5.3
This improves the ability to edit a user's account directly through UI features rather than manually appending 'edit' to the URL or searching for the account and selecting edit. Signed-off-by: canyonknight <canyonknight@gmail.com> --- web/html/css/aur.css | 5 +++++ web/template/account_details.php | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/web/html/css/aur.css b/web/html/css/aur.css index a8fb009..b78ce3e 100644 --- a/web/html/css/aur.css +++ b/web/html/css/aur.css @@ -33,3 +33,8 @@ text-decoration: underline; color: #666; } + +.arch-bio-entry ul { + list-style: none; + padding: 0; +} diff --git a/web/template/account_details.php b/web/template/account_details.php index 02ed32b..680a52e 100644 --- a/web/template/account_details.php +++ b/web/template/account_details.php @@ -51,9 +51,12 @@ </tr> <tr> <th>Links:</th> - <td> - <a href="<?= get_uri('/packages/'); ?>?K=<?= $row['Username'] ?>&SeB=m"><?= __("View this user's packages") ?></a> - </td> + <td><ul> + <li><a href="<?= get_uri('/packages/'); ?>?K=<?= $row['Username'] ?>&SeB=m"><?= __("View this user's packages") ?></a></li> + <?php if (can_edit_account($atype, $row, uid_from_sid($_COOKIE['AURSID']))): ?> + <li><a href="<?= get_user_uri($row['Username']); ?>edit"><?= __("Edit this user's account") ?></a></li> + <?php endif; ?> + </ul></td> </tr> </table> </td> -- 1.8.5.3
On Sat, 01 Feb 2014 at 20:03:09, canyonknight wrote:
This improves the ability to edit a user's account directly through UI features rather than manually appending 'edit' to the URL or searching for the account and selecting edit.
Signed-off-by: canyonknight <canyonknight@gmail.com> --- web/html/css/aur.css | 5 +++++ web/template/account_details.php | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-)
Awesome, thanks!
participants (2)
-
canyonknight
-
Lukas Fleischer