implemented social identities management page + pw editing page. probably need to fix backend

This commit is contained in:
2018-07-25 23:07:11 +02:00
parent 57911377ef
commit 2e075799f2
35 changed files with 541 additions and 301 deletions
+4
View File
@@ -11,3 +11,7 @@
.fa-large {
font-size: 1.6em;
}
.fa-huge {
font-size: 2em;
}
+8
View File
@@ -18,3 +18,11 @@
display: none;
}
}
.border-dashed {
border-style: dashed !important;
}
.border-dotted {
border-style: dotted !important;
}
+1 -1
View File
@@ -13,7 +13,7 @@
@php(Widget::setLayout(4, 6))
{!! Widget::email('email', 'E-Mail Address')->required()->autofocus() !!}
{!! Widget::text('login', 'Username or E-Mail')->required()->autofocus() !!}
{!! Widget::password('password', 'Password')->required() !!}
{!! Widget::checkbox('remember', 'Remember Me')->checked(false) !!}
+1 -1
View File
@@ -7,7 +7,7 @@
<div class="custom-control custom-checkbox{{ $errors->has($w->name) ? ' is-invalid' : '' }}">
<input type="checkbox" class="custom-control-input"
id="field-{{ $w->name }}"
{{+$w->value?'checked':''}}
{{\MightyPork\Utils\Utils::parseBool($w->value)?'checked':''}}
name="{{ $w->name }}">
<label class="custom-control-label" for="field-{{ $w->name }}">
{{ $w->label }}
+2 -34
View File
@@ -35,25 +35,7 @@
</a>
</li>
@else
<li class="nav-item ml-1 d-md-none">
<a class="nav-link" href="{{ route('logout') }}"
onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
{{-- this is some hack against CSRF - logout only via POST --}}
<i class="fa-sign-out fa-pr"></i>{{ __('Logout') }}
</a>
</li>
<li class="nav-item ml-1 d-md-none">
<a class="nav-link" href="{{ route('user.edit') }}">
<i class="fa-sliders fa-pr"></i>{{ __('Settings') }}
</a>
</li>
<li class="nav-item ml-1 d-md-none">
<a class="nav-link" href="{{ route('user.manage-oauth') }}">
<i class="fa-key-modern fa-pr"></i>{{ __('Security') }}
</a>
</li>
@include('layouts.nav-buttons', ['dropdown' => false])
<li class="nav-item dropdown mobile-only">
<a id="mainNavDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown"
@@ -63,21 +45,7 @@
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="mainNavDropdown">
<a class="dropdown-item" href="{{ route('logout') }}"
onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
{{-- this is some hack against CSRF - logout only via POST --}}
<i class="fa-sign-out fa-pr"></i>{{ __('Logout') }}
</a>
<a class="dropdown-item" href="{{ route('user.edit') }}">
<i class="fa-sliders fa-pr"></i>{{ __('Settings') }}
</a>
<a class="dropdown-item" href="{{ route('user.manage-oauth') }}">
<i class="fa-key-modern fa-pr"></i>{{ __('Security') }}
</a>
@include('layouts.nav-buttons', ['dropdown' => true])
</div>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
@@ -0,0 +1,27 @@
@php
$li = $dropdown ? '' : '<li class="nav-item ml-1 d-md-none">';
$endli = $dropdown ? '' : '</li>';
$aclass = $dropdown ? 'dropdown-item' : 'nav-link';
@endphp
{!! $li !!}
<a class="{{ $aclass }}" href="{{ route('profile.edit') }}">
<i class="fa-sliders fa-pr"></i>{{ __('Settings') }}
</a>
{!! $endli !!}
{!! $li !!}
<a class="{{ $aclass }}" href="{{ route('profile.manage-oauth') }}">
<i class="fa-key-modern fa-pr"></i>{{ __('Security') }}
</a>
{!! $endli !!}
{!! $li !!}
<a class="{{ $aclass }}" href="{{ route('logout') }}"
onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
{{-- this is some hack against CSRF - logout only via POST --}}
<i class="fa-sign-out fa-pr"></i>{{ __('Logout') }}
</a>
{!! $endli !!}
+33
View File
@@ -0,0 +1,33 @@
{{-- Profile edit form --}}
@extends('layouts.app')
@section('content')
<form method="POST" action="{{route('profile.store')}}" class="row justify-content-center"
aria-label="Your Profile">
@csrf
<div class="col-md-10">
@php(Widget::setLayout(3, 7))
{!! Widget::header(1, 'Settings') !!}
{!! Widget::text('title', 'Display Name')->value($user->title)->required()->autofocus()
->help('Shown on your profile page, tables, comments, etc.') !!}
{!! Widget::textarea('bio', 'About Me')->value($user->bio)->height('8em')
->help('This is shown in your profile box') !!}
{!! Widget::text('website', 'Website')->value($user->website)->prepend('<i class="fa-globe"></i>')
->help('Custom clickable link shown on your profile page.') !!}
<div class="row form-group">
<div class="col-md-7 offset-md-3">
<button type="submit" class="btn btn-primary">
<i class="fa-save pr-2"></i>Save Changes
</button>
</div>
</div>
</div>
</form>
@endsection
+140
View File
@@ -0,0 +1,140 @@
{{-- Profile edit form --}}
@extends('layouts.app')
@section('content')
@php(Widget::setLayout(3, 7))
<form method="POST" action="{{route('profile.store')}}" class="row justify-content-center">
@csrf
<div class="col-md-10">
{!! Widget::header(1, 'Login Settings') !!}
{!! Widget::par('Confirm using the save button at the bottom.') !!}
</div>
<div class="col-md-10 mt-3">
{!! Widget::header(2, 'Identifiers') !!}
{!! Widget::par('Caution: Changing username will alter URLs of your tables.') !!}
{!! Widget::text('name', 'Username')->value($user->name)->required()
->prepend('@')
->help('This is part of your vanity URL, and can be also used to login') !!}
{!! Widget::par('E-mail change will apply after you confirm the new address.
We will send you a confirmation link when you submit the form.', 'text-justify') !!}
{!! Widget::email('email', 'E-Mail Address')->value($user->email)->required()
->help('Used to login and for password resets.') !!}
</div>
<div class="col-md-10 mt-3">
{!! Widget::header(2, 'Password Change') !!}
{!! Widget::par('Leave empty to keep your current password (if any).') !!}
{!! Widget::password('new_password', 'New Password') !!}
{!! Widget::password('new_password_confirmation', 'Confirm New Password') !!}
</div>
<div class="col-md-10 mt-3">
<div class="row form-group">
<div class="col-md-7 offset-md-3">
<button type="submit" class="btn btn-primary">
<i class="fa-save pr-2"></i>Apply Changes
</button>
</div>
</div>
</div>
<div class="col-md-10 mt-3">
{!! Widget::header(2, 'OAuth2 Logins') !!}
{!! Widget::par('
Here you can remove identities you do not wish to use anymore.
To completely revoke the authorization, also remove the app
from your provider\'s settings.
', 'text-justify')!!}
<?php
$icons = [
'github' => 'github',
'facebook' => 'facebook-square',
'google' => 'google',
];
?>
@if(!count($user->socialIdentities))
<div class="row form-group">
<div class="col-md-7 offset-md-3 border border-primary border-dashed rounded">
No identities connected.
</div>
</div>
@else
@foreach($user->socialIdentities as $identity)
<div class="row form-group">
<div class="col-md-3 col-form-label text-md-right">
<a href="{{route('forget-identity', ['id' => $identity->getKey()])}}" class="btn btn-danger" role="button">Forget</a>
</div>
<div class="col-md-7 border border-primary rounded p-1 pl-0">
<table>
<tr>
<td rowspan=4>
<i class="fa-{{ $icons[$identity->provider] }} fa-huge py-3 px-4"></i>
</td>
<th>Nickname</th>
<td class="pl-2">{{ $identity->nick_name }}</td>
</tr>
<tr>
<th>Full Name</th>
<td class="pl-2">{{ $identity->full_name }}</td>
</tr>
<tr>
<th>E-Mail</th>
<td class="pl-2">{{ $identity->email }}</td>
</tr>
<tr>
<th>User ID</th>
<td class="pl-2">{{ $identity->provider_user_id }}</td>
</tr>
</table>
</div>
</div>
@endforeach
@endif
{!! Widget::par(
'Click the buttons below to add a new OAuth2 identity.
You will be redirected to the authorization form.',
'text-justify'
)!!}
<div class="row form-group">
<div class="col-md-3 col-form-label text-md-right">
Add identity
</div>
<div class="col-md-7">
@set('services.oauth_providers.github.client_id')
<a type="submit" href="{{route('oauth-github-authorize')}}" class="btn btn-dark">
<i class="fa-github pr-1"></i>
{{ __('GitHub') }}
</a>
@endset
@set('services.oauth_providers.google.client_id')
<a type="submit" href="{{route('oauth-google-authorize')}}" class="btn btn-dark">
<i class="fa-google pr-1"></i>
{{ __('Google') }}
</a>
@endset
@set('services.oauth_providers.facebook.client_id')
<a type="submit" href="{{route('oauth-facebook-authorize')}}" class="btn btn-dark">
<i class="fa-facebook-square pr-1"></i>
{{ __('Facebook') }}
</a>
@endset
</div>
</div>
</div>
</form>
@endsection
@@ -16,7 +16,7 @@
<i class="fa-user-circle-o fa-pr fa-large"></i>{{ $user->title }}
@if(authed() && user()->is($user))
<a href="{{route('user.edit')}}" class="btn ml-auto">Edit</a>
<a href="{{route('profile.edit')}}" class="btn ml-auto">Edit</a>
@endif
</div>
@@ -84,7 +84,7 @@
@endif
</div>
@include('user._table-list')
@include('profile._table-list')
</div>
</div>
-49
View File
@@ -1,49 +0,0 @@
{{-- Profile edit form --}}
@extends('layouts.app')
@section('content')
<form method="POST" action="{{route('user.store')}}" class="row justify-content-center"
aria-label="Your Profile">
@csrf
<div class="col-md-10">
@php(Widget::setLayout(3, 7))
{!! Widget::header(1, 'Settings') !!}
{!! Widget::text('title', 'Display Name')->value($user->title)->required()->autofocus()
->help('Shown on your profile page, tables, comments, etc.') !!}
{!! Widget::text('name', 'Username')->value($user->name)->required()
->prepend('@')
->help('Part of your vanity URL. Caution: changing this will alter URLs of your tables.') !!}
{!! Widget::textarea('bio', 'About Me')->value($user->bio)->height('8em')
->help('This is shown in your profile box') !!}
{!! Widget::text('website', 'Website')->value($user->website)->prepend('<i class="fa-globe"></i>')
->help('Custom clickable link shown on your profile page.') !!}
{!! Widget::email('email', 'E-Mail Address')->value($user->email)->required()
->help('Used to login and for password resets.
This field is protected; a change will be applied only after you confirm
the new e-mail address via a confirmation link we\'ll send you to it.') !!}
{!! Widget::header(3, 'Password Change') !!}
{!! Widget::par('Leave empty to keep your current password (if any).') !!}
{!! Widget::password('new_password', 'New Password') !!}
{!! Widget::password('new_password_confirmation', 'Confirm New Password') !!}
<div class="row form-group">
<div class="col-md-7 offset-md-3">
<button type="submit" class="btn btn-primary">
<i class="fa-save pr-2"></i>Apply Changes
</button>
</div>
</div>
</div>
</form>
@endsection
-15
View File
@@ -1,15 +0,0 @@
{{-- Profile edit form --}}
@extends('layouts.app')
@section('content')
<div class="row justify-content-center">
<div class="col-md-10">
@php(Widget::setLayout(3, 7))
{!! Widget::header(1, 'Logins') !!}
<p>TODO social logins, add email & change pw form here</p>
</div>
</div>
@endsection