Skip to content

Commit df065bb

Browse files
committed
Add fancy layout
1 parent 6229427 commit df065bb

File tree

5 files changed

+63
-5
lines changed

5 files changed

+63
-5
lines changed

apps/files_sharing/css/public.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,36 @@ thead {
158158
opacity: 1;
159159
cursor: pointer;
160160
}
161+
162+
#body-public #emptycontent h2 {
163+
margin: 10px 0 5px 0;
164+
}
165+
166+
#body-public #emptycontent h2+p {
167+
margin-bottom: 30px;
168+
}
169+
170+
#body-public #emptycontent .icon-folder {
171+
height: 16px;
172+
width: 16px;
173+
background-size: 16px;
174+
display: inline-block;
175+
vertical-align: text-top;
176+
margin-bottom: 0;
177+
}
178+
179+
#body-public #emptycontent .button {
180+
background-size: 32px;
181+
height: 32px;
182+
width: 32px;
183+
background-position: 16px;
184+
opacity: .7;
185+
font-size: 20px;
186+
margin: 20px;
187+
padding: 10px 20px;
188+
padding-left: 64px;
189+
}
190+
191+
#body-public .avatardiv {
192+
margin: 0 auto;
193+
}

apps/files_sharing/js/public.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,10 @@ OCA.Sharing.PublicApp = {
347347
};
348348

349349
$(document).ready(function () {
350+
var $uploadValue = $('#uploadOnlyInterface').val();
351+
if($uploadValue === "1") {
352+
$('.avatardiv').avatar($('#sharingUserId').val(), 128, true);
353+
}
350354
// FIXME: replace with OC.Plugins.register()
351355
if (window.TESTING) {
352356
return;

apps/files_sharing/templates/public.php

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<div id="notification" style="display: none;"></div>
3131
</div>
3232

33+
<input type="hidden" id="sharingUserId" value="<?php p($_['owner']) ?>">
3334
<input type="hidden" id="filesApp" name="filesApp" value="1">
3435
<input type="hidden" id="isPublic" name="isPublic" value="1">
3536
<input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir">
@@ -115,10 +116,30 @@
115116
<?php endif; ?>
116117
</div>
117118
<?php } else { ?>
119+
<input type="hidden" id="uploadOnlyInterface" value="1"/>
118120
<div id="emptycontent" class="">
119-
<div class="icon-upload"></div>
120-
<h2><?php p($l->t('Upload files to %s', [$_['shareOwner']])) ?></h2>
121-
<a href="#" class="inlineblock button">Select</a>
121+
<?php
122+
$avatar = \OC::$server->getAvatarManager();
123+
$hasAvatar = false;
124+
try {
125+
$avatar = $avatar->getAvatar($_['owner']);
126+
if($avatar->get(128) !== false) {
127+
$hasAvatar = true;
128+
}
129+
} catch (\Exception $e) {
130+
$hasAvatar = false;
131+
}
132+
?>
133+
<?php if($hasAvatar === true): ?>
134+
<img class="avatar" style="height: 128px;" src="<?php p(\OC::$server->getURLGenerator()->linkToRouteAbsolute('core.avatar.getAvatar', ['userId' => $_['owner'], 'size' => 256])) ?>">
135+
<?php else: ?>
136+
<div id="displayavatar">
137+
<div class="avatardiv"></div>
138+
</div>
139+
<?php endif; ?>
140+
<h2><?php p($l->t('Upload files to %s', [$_['shareOwner']])) ?></h2>
141+
<p><span class="icon-folder"></span> <?php p($_['filename']) ?></p>
142+
<a href="#" class="button icon-upload"><?php p($l->t('Select')) ?></a>
122143
</div>
123144
<?php } ?>
124145
</div>

core/Controller/AvatarController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function __construct($appName,
8585
IL10N $l10n,
8686
IUserManager $userManager,
8787
IUserSession $userSession,
88-
Folder $userFolder,
88+
Folder $userFolder = null,
8989
ILogger $logger) {
9090
parent::__construct($appName, $request);
9191

@@ -101,6 +101,7 @@ public function __construct($appName,
101101
/**
102102
* @NoAdminRequired
103103
* @NoCSRFRequired
104+
* @PublicPage
104105
*
105106
* @param string $userId
106107
* @param int $size

core/js/share.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,6 @@ OC.Share = _.extend(OC.Share || {}, {
442442
});
443443

444444
$(document).ready(function() {
445-
446445
if(typeof monthNames != 'undefined'){
447446
// min date should always be the next day
448447
var minDate = new Date();

0 commit comments

Comments
 (0)