プロフィール設定ページを作ろう

This commit is contained in:
shibafu 2018-10-19 00:56:29 +09:00
parent ef563f8641
commit 4654962aac
5 changed files with 84 additions and 1 deletions

View File

@ -0,0 +1,18 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class SettingController extends Controller
{
public function profile()
{
return view('setting.profile');
}
public function password()
{
abort(501);
}
}

View File

@ -72,7 +72,7 @@
</p> </p>
</a> </a>
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
{{--<a href="#" class="dropdown-item">設定</a>--}} <a href="{{ route('setting') }}" class="dropdown-item">設定</a>
<a href="{{ route('logout') }}" class="dropdown-item" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">ログアウト</a> <a href="{{ route('logout') }}" class="dropdown-item" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">ログアウト</a>
</div> </div>
</li> </li>

View File

@ -0,0 +1,18 @@
@extends('layouts.base')
@section('content')
<div class="container">
<div class="row">
<div class="col-lg-4">
<div class="list-group">
<div class="list-group-item disabled font-weight-bold">設定</div>
<a class="list-group-item list-group-item-action {{ Route::currentRouteName() === 'setting' ? 'active' : '' }}" href="{{ route('setting') }}"><span class="oi oi-person mr-1"></span> プロフィール</a>
<a class="list-group-item list-group-item-action {{ Route::currentRouteName() === 'setting.password' ? 'active' : '' }}" href="{{ route('setting.password') }}"><span class="oi oi-key mr-1"></span> パスワード</a>
</div>
</div>
<div class="tab-content col-lg-8">
@yield('tab-content')
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,43 @@
@extends('setting.base')
@section('tab-content')
<h3>プロフィール</h3>
<hr>
<form action="" method="post">
{{ csrf_field() }}
<div class="from-group">
<label for="display_name">名前</label>
<input id="display_name" name="display_name" type="text" class="form-control">
</div>
<div class="from-group mt-2">
<label for="name">ユーザー名</label>
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text">@</div>
</div>
<input id="name" name="name" type="text" class="form-control" disabled>
</div>
<small class="form-text text-muted">現在は変更できません。</small>
</div>
<button type="submit" class="btn btn-primary mt-4">更新</button>
</form>
<h3 class="mt-5">プライバシー</h3>
<hr>
<form action="" method="post">
{{ csrf_field() }}
<div class="form-group">
<div class="custom-control custom-checkbox mb-2">
<input id="protected" name="is_protected" class="custom-control-input" type="checkbox" {{ old('is_protected') ? 'checked' : '' }}>
<label class="custom-control-label" for="protected">全てのチェックイン履歴を非公開にする</label>
</div>
<div class="custom-control custom-checkbox">
<input id="accept-analytics" name="accept_analytics" class="custom-control-input" type="checkbox" {{ old('accept_analytics') ? 'checked' : '' }}>
<label class="custom-control-label" for="accept-analytics">匿名での統計にチェックインデータを利用することに同意します</label>
</div>
</div>
<button type="submit" class="btn btn-primary mt-2">更新</button>
</form>
@endsection

View File

@ -37,3 +37,7 @@ Route::get('/info/{id}', 'InfoController@show')->where('id', '[0-9]+')->name('in
Route::redirect('/search', '/search/checkin', 301); Route::redirect('/search', '/search/checkin', 301);
Route::get('/search/checkin', 'SearchController@index')->name('search'); Route::get('/search/checkin', 'SearchController@index')->name('search');
Route::get('/search/related-tag', 'SearchController@relatedTag')->name('search.related-tag'); Route::get('/search/related-tag', 'SearchController@relatedTag')->name('search.related-tag');
Route::redirect('/setting', '/setting/profile', 301);
Route::get('/setting/profile', 'SettingController@profile')->name('setting');
Route::get('/setting/password', 'SettingController@password')->name('setting.password');