mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-19 04:51:27 +00:00
commit
bc7d431369
8 changed files with 88 additions and 16 deletions
|
@ -1,6 +1,10 @@
|
|||
# Release Notes
|
||||
|
||||
## [Unreleased](https://github.com/pixelfed/pixelfed/compare/v0.11.6...dev)
|
||||
|
||||
### Updates
|
||||
- Update admin dashboard, fix search and dropdown menu ([dac0d083](https://github.com/pixelfed/pixelfed/commit/dac0d083))
|
||||
- Update sudo mode view, fix trusted device checkbox ([8ef900bf](https://github.com/pixelfed/pixelfed/commit/8ef900bf))
|
||||
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
||||
|
||||
## [v0.11.6 (2023-05-03)](https://github.com/pixelfed/pixelfed/compare/v0.11.5...v0.11.6)
|
||||
|
|
23
app/Services/AvatarService.php
Normal file
23
app/Services/AvatarService.php
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use Cache;
|
||||
use App\Profile;
|
||||
|
||||
class AvatarService
|
||||
{
|
||||
public static function get($profile_id)
|
||||
{
|
||||
$exists = Cache::get('avatar:' . $profile_id);
|
||||
if($exists) {
|
||||
return $exists;
|
||||
}
|
||||
|
||||
$profile = Profile::find($profile_id);
|
||||
if(!$profile) {
|
||||
return config('app.url') . '/storage/avatars/default.jpg';
|
||||
}
|
||||
return $profile->avatarUrl();
|
||||
}
|
||||
}
|
10
app/User.php
10
app/User.php
|
@ -7,6 +7,7 @@ use Illuminate\Notifications\Notifiable;
|
|||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use App\Util\RateLimit\User as UserRateLimit;
|
||||
use App\Services\AvatarService;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
|
@ -97,4 +98,13 @@ class User extends Authenticatable
|
|||
return $this->hasMany(AccountInterstitial::class);
|
||||
}
|
||||
|
||||
public function avatarUrl()
|
||||
{
|
||||
if(!$this->profile_id || $this->status) {
|
||||
return config('app.url') . '/storage/avatars/default.jpg';
|
||||
}
|
||||
|
||||
return AvatarService::get($this->profile_id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
BIN
public/js/spa.js
vendored
BIN
public/js/spa.js
vendored
Binary file not shown.
|
@ -1 +1,3 @@
|
|||
/*! @source http://purl.eligrey.com/github/canvas-toBlob.js/blob/master/canvas-toBlob.js */
|
||||
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
||||
|
|
Binary file not shown.
|
@ -1,7 +1,8 @@
|
|||
<nav class="navbar navbar-top navbar-expand navbar-dark bg-primary border-bottom">
|
||||
<div class="container-fluid">
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<form class="navbar-search navbar-search-light form-inline mr-sm-3" id="navbar-search-main" method="get" action="/i/results">
|
||||
<form class="navbar-search navbar-search-light form-inline mr-sm-3" id="navbar-search-main" method="get" action="/i/web">
|
||||
<input type="hidden" name="src" value="ac">
|
||||
<div class="form-group mb-0">
|
||||
<div class="input-group input-group-alternative input-group-merge">
|
||||
<div class="input-group-prepend">
|
||||
|
@ -35,25 +36,57 @@
|
|||
<a class="nav-link pr-0" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<div class="media align-items-center">
|
||||
<span class="avatar avatar-sm rounded-circle">
|
||||
<img alt="avatar" src="{{request()->user()->profile->avatarUrl()}}" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=0';">
|
||||
<img alt="avatar" src="{{request()->user()->avatarUrl()}}" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=0';" width="36" height="36" style="object-fit: cover;">
|
||||
</span>
|
||||
<div class="media-body ml-2 d-none d-lg-block">
|
||||
<span class="mb-0 text-sm font-weight-bold">{{request()->user()->username}}</span>
|
||||
<span class="mb-0 text-sm font-weight-bold">{{request()->user()->username}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right ">
|
||||
<div class="dropdown-header noti-title">
|
||||
<h6 class="text-overflow m-0">Welcome!</h6>
|
||||
</div>
|
||||
<a href="/i/me" class="dropdown-item">
|
||||
<i class="ni ni-single-02"></i>
|
||||
<span>Profile</span>
|
||||
<a href="/i/web" class="dropdown-item d-flex align-items-center">
|
||||
<span style="width:30px;">
|
||||
<i class="far fa-home text-light"></i>
|
||||
</span>
|
||||
<span class="font-weight-bold">Home</span>
|
||||
</a>
|
||||
<a href="/settings/home" class="dropdown-item">
|
||||
<i class="ni ni-settings-gear-65"></i>
|
||||
<span>Settings</span>
|
||||
|
||||
<a href="/i/web/discover" class="dropdown-item d-flex align-items-center">
|
||||
<span style="width:30px;">
|
||||
<i class="far fa-compass text-light"></i>
|
||||
</span>
|
||||
<span class="font-weight-bold">Discover</span>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
|
||||
<a href="/i/me" class="dropdown-item d-flex align-items-center">
|
||||
<span style="width:30px;">
|
||||
<i class="far fa-user text-light"></i>
|
||||
</span>
|
||||
<span class="font-weight-bold">Profile</span>
|
||||
</a>
|
||||
<a href="/settings/home" class="dropdown-item d-flex align-items-center">
|
||||
<span style="width:30px;">
|
||||
<i class="far fa-cog text-light"></i>
|
||||
</span>
|
||||
<span class="font-weight-bold">Settings</span>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
|
||||
<a
|
||||
href="#"
|
||||
class="dropdown-item d-flex align-items-center"
|
||||
onclick="event.preventDefault();document.getElementById('logout-form').submit();">
|
||||
<span style="width:30px;">
|
||||
<i class="far fa-sign-out text-light"></i>
|
||||
</span>
|
||||
<span class="font-weight-bold">{{ __('navmenu.logout') }}</span>
|
||||
</a>
|
||||
<form id="logout-form" action="/logout" method="POST" style="display: none;">
|
||||
@csrf
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -40,9 +40,9 @@
|
|||
@endif
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-checkbox" id="trusted-device">
|
||||
<input type="checkbox" class="custom-control-input" name="trustDevice">
|
||||
<div class="form-group" id="trusted-device-wrapper">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox" class="custom-control-input" name="trustDevice" id="trusted-device">
|
||||
<label class="custom-control-label text-muted" for="trusted-device">Trust this device and don't ask again</label>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -91,7 +91,7 @@
|
|||
email.setAttribute('readonly', 'readonly');
|
||||
email.style.opacity = '20%';
|
||||
|
||||
let trustedDevice = document.getElementById('trusted-device');
|
||||
let trustedDevice = document.getElementById('trusted-device-wrapper');
|
||||
trustedDevice.style.opacity = '20%';
|
||||
|
||||
let btn = document.getElementById('sbtn');
|
||||
|
|
Loading…
Reference in a new issue