summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2015-07-30 20:31:27 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2015-09-14 12:58:45 +0200
commitc39db52cfa4115f9790ba6b3ffa66052a097765e (patch)
tree15037a23cded425ffbde9845593b7c8ad8d2cd72 /core
parent211a2437840ec6897e377a5025f85aec27618263 (diff)
downloadnextcloud-server-c39db52cfa4115f9790ba6b3ffa66052a097765e.tar.gz
nextcloud-server-c39db52cfa4115f9790ba6b3ffa66052a097765e.zip
Use srcset to select best avatar size
* Allow the browser to select the best available avatar for the screen
Diffstat (limited to 'core')
-rw-r--r--core/templates/layout.user.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index 0910047032d..4d9e3ae93d5 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -67,8 +67,10 @@
<?php if ($_['enableAvatars']): ?>
<div class="avatardiv<?php if ($_['userAvatarSet']) { print_unescaped(' avatardiv-shown'); } else { print_unescaped('" style="display: none'); } ?>">
<?php if ($_['userAvatarSet']): ?>
- <img src="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 32]));?>?requesttoken=<?php p(urlencode($_['requesttoken'])); ?>"
- alt="">
+ <img alt="" width="32" height="32"
+ src="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 32]));?>"
+ srcset="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 64]));?> 2x, <?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 128]));?> 4x"
+ >
<?php endif; ?>
</div>
<?php endif; ?>