diff options
author | Marvin Borner | 2018-07-01 12:13:36 +0200 |
---|---|---|
committer | Marvin Borner | 2018-07-01 12:13:36 +0200 |
commit | e7307d3241fb1f31a10ef92565c17b224d5983f0 (patch) | |
tree | 94f9f60fdd03f214306dcbf81ea57a0bade2df60 /resources/views | |
parent | f5500ae2c3c789a99674cd3e5b62054f1768423d (diff) |
Added user avatars
Diffstat (limited to 'resources/views')
-rw-r--r-- | resources/views/layouts/app.blade.php | 52 | ||||
-rw-r--r-- | resources/views/profile.blade.php | 51 |
2 files changed, 81 insertions, 22 deletions
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index f6e81e3..d64fe27 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -1,5 +1,6 @@ <!DOCTYPE html> <html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> + <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> @@ -20,6 +21,7 @@ <!-- Styles --> <link href="{{ asset('css/app.css') }}" rel="stylesheet"> </head> + <body> <div id="app"> <nav class="navbar navbar-expand-md navbar-light navbar-laravel"> @@ -27,7 +29,8 @@ <a class="navbar-brand" href="{{ url('/') }}"> {{ config('app.name', 'Laravel') }} </a> - <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}"> + <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" + aria-expanded="false" aria-label="{{ __('Toggle navigation') }}"> <span class="navbar-toggler-icon"></span> </button> @@ -41,30 +44,34 @@ <ul class="navbar-nav ml-auto"> <!-- Authentication Links --> @guest - <li class="nav-item"> - <a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a> - </li> - <li class="nav-item"> - <a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a> - </li> + <li class="nav-item"> + <a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a> + </li> @else - <li class="nav-item dropdown"> - <a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre> - {{ Auth::user()->name }} <span class="caret"></span> - </a> + <li class="nav-item dropdown"> + <a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" + aria-expanded="false" v-pre> + {{ Auth::user()->name }} + <span class="caret"></span> + </a> - <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown"> - <a class="dropdown-item" href="{{ route('logout') }}" - onclick="event.preventDefault(); + <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown"> + <a class="dropdown-item" href="/profile"> + User Profile + </a> + <a class="dropdown-item" href="{{ route('logout') }}" onclick="event.preventDefault(); document.getElementById('logout-form').submit();"> - {{ __('Logout') }} - </a> + {{ __('Logout') }} + </a> - <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;"> - @csrf - </form> - </div> - </li> + <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;"> + @csrf + </form> + </div> + </li> @endguest </ul> </div> @@ -76,4 +83,5 @@ </main> </div> </body> -</html> + +</html>
\ No newline at end of file diff --git a/resources/views/profile.blade.php b/resources/views/profile.blade.php new file mode 100644 index 0000000..e986cb7 --- /dev/null +++ b/resources/views/profile.blade.php @@ -0,0 +1,51 @@ +@extends('layouts.app') @section('content') +<div class="container"> + <div class="row"> + @if ($message = Session::get('success')) + + <div class="alert alert-success alert-block"> + + <button type="button" class="close" data-dismiss="alert">×</button> + + <strong>{{ $message }}</strong> + + </div> + + @endif @if (count($errors) > 0) + <div class="alert alert-danger"> + <strong>Whoops!</strong> There were some problems with your input. + <br> + <br> + <ul> + @foreach ($errors->all() as $error) + <li>{{ $error }}</li> + @endforeach + </ul> + </div> + @endif + </div> + <div class="row justify-content-center"> + + <div class="profile-header-container"> + <div class="profile-header-img"> + <img height="100px" width="100px" class="rounded-circle" src="/storage/avatars/{{ $user->avatar }}" /> + <!-- badge --> + <div class="rank-label-container"> + <span class="label label-default rank-label">{{$user->name}}</span> + </div> + </div> + </div> + + </div> + <div class="row justify-content-center"> + <form action="/avatar" method="post" enctype="multipart/form-data"> + @csrf + <div class="form-group"> + <input type="file" class="form-control-file" name="avatar" id="avatarFile" aria-describedby="fileHelp"> + <small id="fileHelp" class="form-text text-muted">Please upload a valid image file. Size of image should not be more than 2MB.</small> + </div> + <button type="submit" class="btn btn-primary">Submit</button> + </form> + </div> +</div> +@endsection
\ No newline at end of file |