Move list of tags to settings
MODIFY
app/Http/Controllers/SettingsController.php
app/Http/Controllers/SettingsController.php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
-use Illuminate\Support\Facades\Auth;
+
+use Auth;
class SettingsController extends Controller {
public function index() {
+ $user = Auth::user();
+
+ //
$languages = ['en', 'nl'];
- return view('settings', compact('languages'));
+ $tags = $user->tags;
+
+ return view('settings', compact('languages', 'tags'));
}
public function store(Request $request) {

MODIFY
app/Http/Controllers/TagsController.php
app/Http/Controllers/TagsController.php
@@ -8,12 +8,6 @@ use Auth;
use App\Tag;
class TagsController extends Controller {
- public function index() {
- $tags = Auth::user()->tags;
-
- return view('tags.index', compact('tags'));
- }
-
public function create() {
return view('tags.create');
}

MODIFY
resources/assets/sass/components/row.scss
resources/assets/sass/components/row.scss
.row {
display: flex;
+ &.row--gutter {
+ margin-left: -20px;
+ margin-right: -20px;
+
+ > .row__column {
+ padding-left: 20px;
+ padding-right: 20px;
+ }
+ }
+
&.gutter {
margin-left: -24px;
margin-right: -24px;
}
}
+ .row__column {
+ flex: 1;
+
+ &.row__column--compact {
+ flex: none;
+ }
+ }
+
.column {
flex: 1;

MODIFY
resources/views/layout.blade.php
resources/views/layout.blade.php
<li>
<a href="/dashboard"><i class="fa fa-home"></i> @lang('general.dashboard')</a>
</li>
- <li>
- <a href="/tags"><i class="fa fa-tag"></i> @lang('general.tags')</a>
- </li>
<li>
<a href="/reports"><i class="fa fa-pie-chart"></i> Reports</a>
</li>

MODIFY
resources/views/settings.blade.php
resources/views/settings.blade.php
@section('body')
<div class="wrapper spacing-top-large spacing-bottom-large">
+ <div class="row row--gutter">
+ <div class="row__column">
+ <div class="spacing-bottom-large color-dark">Account</div>
<div class="box">
- <div class="section">
- <span class="color-dark">@lang('general.settings')</span>
- </div>
<div class="section">
<form method="POST">
{{ csrf_field() }}
</div>
</div>
</div>
+ <div class="row__column">
+ <div class="spacing-bottom-large color-dark">Tags</div>
+ <div class="box">
+ <ul class="box__section">
+ @foreach ($tags as $tag)
+ <li class="row">
+ <div class="row__column">{{ $tag->name }}</div>
+ <div class="row__column row__column--compact">
+ <a href="/tags/{{ $tag->id }}/edit">
+ <i class="fa fa-pencil"></i>
+ </a>
+ </div>
+ </li>
+ @endforeach
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
@endsection

DELETE
resources/views/tags/index.blade.php
-@extends('layout')
-
-@section('body')
- <div class="wrapper spacing-top-large spacing-bottom-large">
- <div class="box">
- <div class="section">
- <div class="row">
- <div class="column align-middle">
- <span class="color-dark">@lang('general.tags')</span>
- </div>
- <div class="column align-middle text-align-right">
- <a href="/tags/create">@lang('actions.create')</a>
- </div>
- </div>
- </div>
- @if (count($tags) > 0)
- <ul class="section">
- @foreach ($tags as $tag)
- <li class="row">
- <div class="column">{{ $tag->name }}</div>
- <div class="column">
- <a href="/tags/{{ $tag->id }}/edit">Edit</a> &middot;
- <form class="action" method="POST" action="/tags/{{ $tag->id }}">
- {{ method_field('delete') }}
- {{ csrf_field() }}
- <button>@lang('actions.delete')</button>
- </form>
- </div>
- </li>
- @endforeach
- </ul>
- @else
- <div class="section">You don't have any tags</div>
- @endif
- </div>
- </div>
-@endsection

Move list of tags to settings