Skip to content

Commit

Permalink
Merge pull request #30 from Sanium/L-30
Browse files Browse the repository at this point in the history
L-30 Reorganizacja templatów
  • Loading branch information
baloo1379 authored Mar 26, 2020
2 parents 793a1d3 + e376c7a commit 3e0879b
Show file tree
Hide file tree
Showing 8 changed files with 248 additions and 323 deletions.
72 changes: 72 additions & 0 deletions resources/views/components/navbar.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
@php
$guest_links = [
['route' => route('login'), 'name' => __('Login')],
['route' => route('register'), 'name' => __('Register')],
];
@endphp

<nav class="amber" role="navigation">
<div class="nav-wrapper container">
<a id="logo-container" href="/" class="brand-logo">{{config('app.name')}}</a>
@guest
<ul class="right hide-on-med-and-down">
@foreach( $guest_links as $link )
<li><a href="{{ $link['route'] }}">{{ $link['name'] }}</a></li>
@endforeach
</ul>
<ul id="nav-mobile" class="sidenav">
@foreach( $guest_links as $link )
<li><a href="{{ $link['route'] }}">{{ $link['name'] }}</a></li>
@endforeach
</ul>
<a href="#" data-target="nav-mobile" class="sidenav-trigger"><i class="material-icons">menu</i></a>
@else
<ul class="right hide-on-med-and-down">
<li>

</li>
<li><a class="dropdown-trigger no-autoinit" href="#" data-target='dropdown1' >{{ Auth::user()->name }}</a></li>

<ul id="dropdown1" class='dropdown-content'>
<li>
<a class="black-text" href="{{ route('home') }}"><i class="material-icons">home</i>Dashboard</a>
</li>
<li>
<a class="black-text" href="{{ route('employer.edit', Auth::user()->profile()->first()) }}"><i class="material-icons">settings</i>Update profile</a>
</li>
<li>
<a class="black-text" href="{{ route('logout') }}"
onclick="event.preventDefault();
document.getElementById('logout-form').submit();">
<i class="material-icons">exit_to_app</i>{{ __('Logout') }}
</a>

<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
@csrf
</form>
</li>
</ul>

</ul>
<ul id="nav-mobile" class="sidenav">
<li>
<a class="black-text" href="{{ route('home') }}"><i class="material-icons">home</i>Dashboard</a>
</li>
<li>
<a class="black-text" href="{{ route('employer.edit', Auth::user()->profile()->first()) }}"><i class="material-icons">settings</i>Update profile</a>
</li>
<li>
<a href="{{ route('logout') }}" onclick="event.preventDefault();
document.getElementById('logout-form-mobile').submit();">
<i class="material-icons">exit_to_app</i>{{ __('Logout') }}
</a>

<form id="logout-form-mobile" action="{{ route('logout') }}" method="POST" style="display: none;">
@csrf
</form>
</li>
</ul>
<a href="#" data-target="nav-mobile" class="sidenav-trigger"><i class="material-icons">menu</i></a>
@endguest
</div>
</nav>
144 changes: 69 additions & 75 deletions resources/views/dashboard.blade.php
Original file line number Diff line number Diff line change
@@ -1,92 +1,86 @@
@extends('layouts.app')

@section('title')
Dashboard - @parent
@endsection

@section('content')
<div class="container">
<div class="row">
<div class="col s12">
<div class="card">
<div class="row card-content">
<div class="valign-wrapper">
<div class="col">
<img name="company-logo" class="responsive-img circle" width="60"
src="{{ $employer->getLogo() }}">
</div>
<div class="col">
<p class="small">Hello</p>
<span class="card-title"><b>{{ $employer->name }}</b></span>
</div>
<div class="col"></div>
<div class="col"></div>
<div class="col">
@isset($employer->size)
<p class="small">Company size</p>
<span class="card-title"><b>{{ $employer->size }}</b></span>
@endisset
</div>
<div class="col"></div>
<div class="col"></div>
<div class="col">
@isset($employer->website)
<p class="small">Website</p>
<span
class="card-title ">
<div class="card" style="margin-bottom: 2rem">
<div class="row card-content valign-wrapper">
<div class="col">
<img name="company-logo" class="responsive-img circle" width="60"
src="{{ $employer->getLogo() }}">
</div>
<div class="col">
<p class="small">Hello</p>
<span class="card-title"><b>{{ $employer->name }}</b></span>
</div>
<div class="col">
@isset($employer->size)
<p class="small">Company size</p>
<span class="card-title"><b>{{ $employer->size }}</b></span>
@endisset
</div>
<div class="col">
@isset($employer->website)
<p class="small">Website</p>
<span
class="card-title ">
<a
target="_blank" href="{{ $employer->website }}">{{ $employer->website }}
</a>
</span>
@endisset
</div>
</div>
</div>
@endisset
</div>
</div>
</div>
<div class="row">
<div class="col s12">
<div class="card">
<div class="card-content">
<div class="row">
<div class="col s6">
<span class="card-title left-align">Your offers</span>
</div>
<div class="col s6 right-align">
<a class="waves-effect waves-light btn"
href="{{route('offers.create')}}">{{'Add New Offer'}}</a>
</div>
<div class="card">
<div class="row card-content">
<div class="col s12">
<div class="row">
<div class="col s6">
<span class="card-title left-align">Your offers</span>
</div>
<div class="col s6 right-align">
<a class="waves-effect waves-light btn"
href="{{route('offers.create')}}">{{'Add New Offer'}}</a>
</div>
<table class="highlight">
<thead>
</div>
<table class="highlight">
<thead>
<tr>
<th>No.</th>
<th>Title</th>
<th class="right-align">&nbsp;</th>
</tr>
</thead>
<tbody>
@foreach( $offers as $offer )
<tr>
<th>No.</th>
<th>Title</th>
<th class="right-align">&nbsp;</th>
<td>{{ $offer->id }}</td>
<td><a href="/#/details/{{$offer->id}}">{{ $offer->name }}</a></td>
<td class="right-align">
<a class="waves-effect waves-light btn btn-small" title="Edit this offer"
href="{{ route('offers.edit', $offer) }}">
<i class="material-icons">edit</i>
</a>
<a class="waves-effect waves-light btn btn-small red" title="Remove this offer"
href="#!"
onclick="event.preventDefault();document.getElementById('delete-offer-{{$offer->id}}').submit();">
<i class="material-icons">delete</i>
<form id="delete-offer-{{$offer->id}}"
action="{{ route('offers.destroy', $offer) }}" method="POST">
@csrf
@method('DELETE')
</form>
</a>
</td>
</tr>
</thead>
<tbody>
@foreach( $offers as $offer )
<tr>
<td>{{ $offer->id }}</td>
<td><a href="/#/details/{{$offer->id}}">{{ $offer->name }}</a></td>
<td class="right-align">
<a class="waves-effect waves-light btn btn-small" title="Edit this offer"
href="{{ route('offers.edit', $offer) }}">
<i class="material-icons">edit</i>
</a>
<a class="waves-effect waves-light btn btn-small red" title="Remove this offer" href="#!"
onclick="event.preventDefault();document.getElementById('delete-offer-{{$offer->id}}').submit();">
<i class="material-icons">delete</i>
<form id="delete-offer-{{$offer->id}}" action="{{ route('offers.destroy', $offer) }}" method="POST">
@csrf
@method('DELETE')
</form>
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
{{ $offers->links('components.pagination') }}
</div>
@endforeach
</tbody>
</table>
{{ $offers->links('components.pagination') }}
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions resources/views/imports/css.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link href="{{ asset('storage/web/styles.css') }}" rel="stylesheet">
6 changes: 6 additions & 0 deletions resources/views/imports/js.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script src="{{ asset('storage/web/runtime-es2015.js') }}" defer></script>
<script src="{{ asset('storage/web/runtime-es5.js') }}" defer></script>
<script src="{{ asset('storage/web/polyfills-es2015.js') }}" defer></script>
<script src="{{ asset('storage/web/polyfills-es5.js') }}" defer></script>
<script src="{{ asset('storage/web/main-es2015.js') }}" defer></script>
<script src="{{ asset('storage/web/main-es5.js') }}" defer></script>
93 changes: 19 additions & 74 deletions resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,94 +7,39 @@
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">

<title>{{ config('app.name', 'Laravel') }}</title>
<title>
@section('title')
{{ config('app.name', 'Sanium') }}
@show
</title>

<!-- Scripts -->
<script src="{{ asset('js/app.js') }}" defer></script>

<!-- Fonts -->
<link rel="dns-prefetch" href="//fonts.gstatic.com">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

<!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<script defer>
(function(window, document){
(function (window, document) {
document.addEventListener('DOMContentLoaded', function () {
@if ( session('status') )
M.toast({html: "{{ session('status') }}"});
M.toast({html: "{{ session('status') }}"});
@endif
});
})(window, document);
</script>
</head>
<body class="grey lighten-4">
<nav class="amber" role="navigation">
<div class="nav-wrapper container">
<a id="logo-container" href="/" class="brand-logo">{{config('app.name')}}</a>
@guest
<ul class="right hide-on-med-and-down">
<li><a href="{{ route('login') }}">{{ __('Login') }}</a></li>
<li><a href="{{ route('register') }}">{{ __('Register') }}</a></li>
</ul>
<ul id="nav-mobile" class="sidenav">
<li><a href="{{ route('login') }}">{{ __('Login') }}</a></li>
<li><a href="{{ route('register') }}">{{ __('Register') }}</a></li>
</ul>
<a href="#" data-target="nav-mobile" class="sidenav-trigger"><i class="material-icons">menu</i></a>
@else
<ul class="right hide-on-med-and-down">
<li>

</li>
<li><a class="dropdown-trigger no-autoinit" href="#" data-target='dropdown1' >{{ Auth::user()->name }}</a></li>

<ul id="dropdown1" class='dropdown-content'>
<li>
<a class="black-text" href="{{ route('home') }}"><i class="material-icons">home</i>Dashboard</a>
</li>
<li>
<a class="black-text" href="{{ route('employer.edit', Auth::user()->profile()->first()) }}"><i class="material-icons">settings</i>Edit profile</a>
</li>
<li>
<a class="black-text" href="{{ route('logout') }}"
onclick="event.preventDefault();
document.getElementById('logout-form').submit();">
<i class="material-icons">exit_to_app</i>{{ __('Logout') }}
</a>
@yield('javascript')

<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
@csrf
</form>
</li>
</ul>

</ul>
<ul id="nav-mobile" class="sidenav">
<li>
<a class="black-text" href="{{ route('home') }}"><i class="material-icons">home</i>Dashboard</a>
</li>
<li>
<a class="black-text" href="{{ route('employer.edit', Auth::user()->profile()->first()) }}"><i class="material-icons">settings</i>Edit profile</a>
</li>
<li>
<a href="{{ route('logout') }}" onclick="event.preventDefault();
document.getElementById('logout-form').submit();">
<i class="material-icons">exit_to_app</i>{{ __('Logout') }}
</a>
<!-- Fonts -->
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
@csrf
</form>
</li>
</ul>
<a href="#" data-target="nav-mobile" class="sidenav-trigger"><i class="material-icons">menu</i></a>
@endguest
</div>
</nav>
<!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
@yield('styles')
</head>
<body class="grey lighten-4">
@include('components.navbar')
<main style="margin: 2rem 0;">
@yield('content')
</main>

</body>
</html>


6 changes: 5 additions & 1 deletion resources/views/offer/edit.blade.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
@extends('layouts.app')

@section('title')
{{ $edit ? 'Update offer' : 'Create offer' }} - @parent
@endsection

@section('content')
<div class="container">
<form action="{{ $edit ? route('offers.update', $offer) : route('offers.store') }}"
method="POST" enctype="multipart/form-data" class="card z-depth-4">
method="POST" enctype="multipart/form-data" class="card">
<div class="card-content">
<header class="card-title row">
<div class="col s12">
Expand Down
Loading

0 comments on commit 3e0879b

Please sign in to comment.