Merge pull request #398 from pixelfed/frontend-ui-refactor

Frontend ui refactor
This commit is contained in:
daniel 2018-08-20 20:40:14 -06:00 committed by GitHub
commit 84c10e3d13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 8 deletions

View file

@ -44,29 +44,33 @@ class SettingsController extends Controller
$user = Auth::user();
$profile = $user->profile;
$validate = config('pixelfed.enforce_email_verification');
if($user->email != $email) {
$changes = true;
$user->email = $email;
$user->email_verified_at = null;
// Prevent old verifications from working
EmailVerification::whereUserId($user->id)->delete();
if($validate) {
$user->email_verified_at = null;
// Prevent old verifications from working
EmailVerification::whereUserId($user->id)->delete();
}
}
// Only allow email to be updated if not yet verified
if(!$changes && $user->email_verified_at) {
if(!$validate || !$changes && $user->email_verified_at) {
if($profile->name != $name) {
$changes = true;
$user->name = $name;
$profile->name = $name;
}
if($profile->website != $website) {
if(!$profile->website || $profile->website != $website) {
$changes = true;
$profile->website = $website;
}
if($profile->bio != $bio) {
if(!$profile->bio || !$profile->bio != $bio) {
$changes = true;
$profile->bio = $bio;
}

View file

@ -70,13 +70,14 @@
</a>
</div>
</div>
<p class="lead">
<p class="lead mb-0">
<span class="font-weight-bold">{{$user->name}}</span>
@if($user->remote_url)
<span class="badge badge-info">REMOTE PROFILE</span>
@endif
{{$user->bio}}
</p>
<p class="mb-0 lead">{{$user->bio}}</p>
<p class="mb-0"><a href="{{$user->website}}" class="font-weight-bold" rel="external nofollow noopener" target="_blank">{{str_limit($user->website, 30)}}</a></p>
</div>
</div>
</div>