From 06dd98afe870c650ce98358bba5214f1e8b5028a Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 7 May 2016 22:56:03 -0400 Subject: Improve avatar upload form --- app/ServiceProvider/RouteProvider.php | 1 + app/Template/avatar_file/show.php | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'app') diff --git a/app/ServiceProvider/RouteProvider.php b/app/ServiceProvider/RouteProvider.php index 30d23a51..30e7b648 100644 --- a/app/ServiceProvider/RouteProvider.php +++ b/app/ServiceProvider/RouteProvider.php @@ -158,6 +158,7 @@ class RouteProvider implements ServiceProviderInterface $container['route']->addRoute('user/:user_id/integrations', 'user', 'integrations'); $container['route']->addRoute('user/:user_id/authentication', 'user', 'authentication'); $container['route']->addRoute('user/:user_id/2fa', 'twofactor', 'index'); + $container['route']->addRoute('user/:user_id/avatar', 'AvatarFile', 'show'); // Groups $container['route']->addRoute('groups', 'group', 'index'); diff --git a/app/Template/avatar_file/show.php b/app/Template/avatar_file/show.php index 266a2ccb..9f19a1ab 100644 --- a/app/Template/avatar_file/show.php +++ b/app/Template/avatar_file/show.php @@ -4,17 +4,20 @@ avatar->render($user['id'], $user['username'], $user['name'], $user['email'], $user['avatar_path'], '') ?> +
+ + url->link(t('Remove my image'), 'AvatarFile', 'remove', array('user_id' => $user['id']), true, 'btn btn-red') ?> + +
+ +
+ +

form->csrf() ?> - form->label(t('Upload my avatar image'), 'avatar') ?> form->file('avatar') ?>
- - url->link(t('Remove my image'), 'AvatarFile', 'remove', array('user_id' => $user['id']), true, 'btn btn-red') ?> - - - - url->link(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?> +
-- cgit v1.2.3