commit 2fee1bb50e1f8c13c2823c14bd748eddc6fb5cec
Author: Marek Lovčí <mareklovci@gmail.com>
Date:   Sun May 10 09:59:45 2020 +0200

    Language mutations and code clean

diff --git a/README.md b/README.md
index 41e4b2e..d517cca 100644
--- a/README.md
+++ b/README.md
@@ -38,6 +38,12 @@ Případně `php artisan migrate:refresh --seed`.
 
 Migrace dat z Mockaroo je tímto okamžikem obsolete.
 
+### Výchozí uživatel
+
+Je nadefinován výchozí (testovací) uživatel.
+
+**Login** admin@kaplicky.com **heslo** admin
+
 ## Jak zprovoznit bootstrap a kompilaci SASS souborů
 
 1. Ujistěte se, že v sekci **Run/Edit Configurations** máte nastavený **Document root** na složku `public` v kořenovém adresáři (jinak aplikace **nenajde** vygenerované css soubory).
diff --git a/app/Http/Controllers/ArtefactController.php b/app/Http/Controllers/ArtefactController.php
index 9133d7d..3ce984a 100644
--- a/app/Http/Controllers/ArtefactController.php
+++ b/app/Http/Controllers/ArtefactController.php
@@ -4,12 +4,11 @@ namespace App\Http\Controllers;
 
 use App\Artefact;
 use App\ArtefactCategory;
-use App\Category;
-use App\Metadata;
 use App\User;
-use Illuminate\Http\Request;
+use Illuminate\Contracts\View\Factory;
+use Illuminate\Http\RedirectResponse;
 use Illuminate\Support\Facades\Auth;
-use Illuminate\Support\Facades\DB;
+use Illuminate\View\View;
 
 class ArtefactController extends Controller
 {
@@ -21,7 +20,7 @@ class ArtefactController extends Controller
     /**
      * Returns view of all artefacts.
      *
-     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
+     * @return Factory|View
      */
     public function default()
     {
@@ -33,16 +32,16 @@ class ArtefactController extends Controller
     /**
      * Returns view of artefacts related to the chosen category
      *
-     * @param $id       id of the category
-     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
+     * @param $id id of the category
+     * @return Factory|View
      */
     public function showCategory($id)
     {
-        $cateogryArtefacts = ArtefactCategory::where('category_id', $id)->get();
-        if(count($cateogryArtefacts) > 0)
+        $categoryArtefacts = ArtefactCategory::where('category_id', $id)->get();
+        if(count($categoryArtefacts) > 0)
         {
             $artefacts = array();
-            foreach($cateogryArtefacts as $ar)
+            foreach($categoryArtefacts as $ar)
             {
                 array_push($artefacts, Artefact::where('id', $ar->artefact_id)->get());
             }
@@ -58,7 +57,7 @@ class ArtefactController extends Controller
      * Returns view of single artefact given by its id.
      *
      * @param $id int id of the artefact
-     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
+     * @return Factory|View
      */
     public function view($id)
     {
@@ -73,7 +72,7 @@ class ArtefactController extends Controller
      * Likes artefact given by its id.
      *
      * @param $id int id of metadata
-     * @return \Illuminate\Http\RedirectResponse
+     * @return RedirectResponse
      */
     public function like($id)
     {
@@ -89,7 +88,7 @@ class ArtefactController extends Controller
      * Unlikes artefact given by its id.
      *
      * @param $id int id of metadata
-     * @return \Illuminate\Http\RedirectResponse
+     * @return RedirectResponse
      */
     public function unlike($id)
     {
diff --git a/app/Http/Controllers/FavoriteArtefactsController.php b/app/Http/Controllers/FavoriteArtefactsController.php
index c9b62ac..383ca9d 100644
--- a/app/Http/Controllers/FavoriteArtefactsController.php
+++ b/app/Http/Controllers/FavoriteArtefactsController.php
@@ -2,11 +2,13 @@
 
 namespace App\Http\Controllers;
 
-use App\ArtefactUser;
+use Illuminate\Contracts\Foundation\Application;
+use Illuminate\Contracts\View\Factory;
 use Illuminate\Support\Facades\Auth;
 use App\User;
 use App\Artefact;
 use App\Http\Controllers\Image;
+use Illuminate\View\View;
 
 class FavoriteArtefactsController extends Controller
 {
@@ -18,7 +20,7 @@ class FavoriteArtefactsController extends Controller
     /**
      * Display a listing of the resource.
      *
-     * @return \Illuminate\Http\Response
+     * @return Application|Factory|View
      */
     public function index()
     {
@@ -52,7 +54,7 @@ class FavoriteArtefactsController extends Controller
      * Display the specified resource.
      *
      * @param  int  $id
-     * @return \Illuminate\Http\Response
+     * @return Application|Factory|View
      */
     public function show($id)
     {
@@ -62,7 +64,6 @@ class FavoriteArtefactsController extends Controller
             $item['likes'] = Artefact::find($item->id)->users()->count();
         }
 
-
         $data = array(
             'title' => 'Favorite artefacts',
             'id' => $id,
diff --git a/resources/lang/cs/general.php b/resources/lang/cs/general.php
new file mode 100644
index 0000000..c5f72ef
--- /dev/null
+++ b/resources/lang/cs/general.php
@@ -0,0 +1,24 @@
+<?php
+
+return [
+
+    /*
+    |--------------------------------------------------------------------------
+    | Login Page Language Lines
+    |--------------------------------------------------------------------------
+    */
+
+    'email' => 'e-mail',
+    'password' => 'heslo',
+    'join' => 'vstoupit',
+
+    /*
+    |--------------------------------------------------------------------------
+    | Error Page Language Lines
+    |--------------------------------------------------------------------------
+    */
+
+    'not_found' => 'Stránka nenalezena',
+    'server_error' => 'Něco se pokazilo',
+
+];
diff --git a/resources/lang/en/general.php b/resources/lang/en/general.php
new file mode 100644
index 0000000..45a1aa1
--- /dev/null
+++ b/resources/lang/en/general.php
@@ -0,0 +1,56 @@
+<?php
+
+return [
+
+    /*
+    |--------------------------------------------------------------------------
+    | General Language Lines
+    |--------------------------------------------------------------------------
+    */
+
+    'kaplicky' => 'kaplicky',
+
+    /*
+    |--------------------------------------------------------------------------
+    | Sidebar Language Lines
+    |--------------------------------------------------------------------------
+    */
+
+    'cs' => 'česky',
+    'en' => 'english',
+
+    /*
+    |--------------------------------------------------------------------------
+    | Sidebar Language Lines
+    |--------------------------------------------------------------------------
+    */
+
+    'home' => 'home',
+    'login' => 'login',
+    'register' => 'register',
+    'topics' => 'topics',
+    'artefacts' => 'books',
+    'favourite_artefacts' => 'my books',
+    'favourite_metadata' => 'my notes',
+    'charts' => 'charts',
+
+    /*
+    |--------------------------------------------------------------------------
+    | Login Page Language Lines
+    |--------------------------------------------------------------------------
+    */
+
+    'email' => 'e-mail',
+    'password' => 'password',
+    'join' => 'join',
+
+    /*
+    |--------------------------------------------------------------------------
+    | Error Page Language Lines
+    |--------------------------------------------------------------------------
+    */
+
+    'not_found' => 'Not Found',
+    'server_error' => 'Internal Server Error',
+
+];
diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php
index f21e5d7..e98cef7 100644
--- a/resources/views/auth/login.blade.php
+++ b/resources/views/auth/login.blade.php
@@ -22,8 +22,9 @@
                                     <label for="logo" class="col-md-4 kaplicky">{{ __('kaplicky') }}</label>
 
                                     <div class="form-group row">
-                                        <label for="email"
-                                               class="col-md-4 col-form-label text-md-right">{{ __('e-mail') }}</label>
+                                        <label for="email" class="col-md-4 col-form-label text-md-right">
+                                            {{ __('general.email') }}
+                                        </label>
 
                                         <div class="col-md-6">
                                             <input id="email" type="email"
@@ -34,8 +35,9 @@
                                     </div>
 
                                     <div class="form-group row">
-                                        <label for="password"
-                                               class="col-md-4 col-form-label text-md-right">{{ __('password') }}</label>
+                                        <label for="password" class="col-md-4 col-form-label text-md-right">
+                                            {{ __('general.password') }}
+                                        </label>
 
                                         <div class="col-md-6">
                                             <input id="password" type="password"
@@ -45,8 +47,8 @@
                                     </div>
                                     <div class="row">
                                         <div class="col-md-12">
-                                            <button type="submit" class="btn button-square ">
-                                                {{ __('join') }}
+                                            <button type="submit" class="btn button-square">
+                                                {{ __('general.join') }}
                                             </button>
                                             {{-- @if (Route::has('password.request'))
                                                 <a class="btn btn-link" href="{{ route('password.request') }}">
@@ -70,6 +72,7 @@
                                                     </div>
                                                 </div>
                                             </div>
+                                        </div>
                                     @endif
 
                                 </form>
diff --git a/resources/views/errors/404.blade.php b/resources/views/errors/404.blade.php
index d1e9889..55160e6 100644
--- a/resources/views/errors/404.blade.php
+++ b/resources/views/errors/404.blade.php
@@ -6,7 +6,7 @@
         <div class="container">
             <div class="row">
                 <div class="col-sm-12">
-                    <span class="error">404 | Not Found</span>
+                    <span class="error">404 | {{ __('general.not_found') }}</span>
                 </div>
             </div>
         </div>
diff --git a/resources/views/errors/500.blade.php b/resources/views/errors/500.blade.php
index b70df6b..af149be 100644
--- a/resources/views/errors/500.blade.php
+++ b/resources/views/errors/500.blade.php
@@ -6,7 +6,7 @@
         <div class="container">
             <div class="row">
                 <div class="col-sm-12">
-                    <span class="error">500 | Internal Server Error</span>
+                    <span class="error">500 | {{ __('general.server_error') }}</span>
                 </div>
             </div>
         </div>
diff --git a/resources/views/inc/sidebar.blade.php b/resources/views/inc/sidebar.blade.php
index 493d306..f4a7646 100644
--- a/resources/views/inc/sidebar.blade.php
+++ b/resources/views/inc/sidebar.blade.php
@@ -6,36 +6,56 @@
     <li class="nav-item"> &#160;</li>
     @guest
         <li class="nav-item">
-            <a class="dropdown-item text-headline" href="{{ url('/') }}">{{ __('Home') }}</a>
-            <a class="dropdown-item text-headline" href="{{ route('login') }}">{{ __('Login') }}</a>
+            <a class="dropdown-item text-headline" href="{{ url('/') }}">
+                {{ __('general.home') }}
+            </a>
+            <a class="dropdown-item text-headline" href="{{ route('login') }}">
+                {{ __('general.login') }}
+            </a>
         </li>
         @if (Route::has('register'))
             <li class="nav-item">
-                <a class="dropdown-item text-headline" href="{{ route('register') }}">{{ __('Register') }}</a>
+                <a class="dropdown-item text-headline" href="{{ route('register') }}">
+                    {{ __('general.register') }}
+                </a>
             </li>
         @endif
     @else
         <li class="nav-item dropdown">
-            <a class="dropdown-item text-headline" href="{{ url('/') }}">home</a>
+            <a class="dropdown-item text-headline" href="{{ url('/') }}">
+                {{ __('general.home') }}
+            </a>
 
-            <a class="dropdown-item text-headline" href="{{ url('/categories') }}">topics</a>
+            <a class="dropdown-item text-headline" href="{{ url('/categories') }}">
+                {{ __('general.topics') }}
+            </a>
 
-            <a class="dropdown-item text-headline" href="{{ url('/artefact') }}">books</a>
+            <a class="dropdown-item text-headline" href="{{ url('/artefact') }}">
+                {{ __('general.artefacts') }}
+            </a>
 
-            <a class="dropdown-item text-headline" href="{{ url('/favartefacts') }}">my books</a>
+            <a class="dropdown-item text-headline" href="{{ url('/favartefacts') }}">
+                {{ __('general.favourite_artefacts') }}
+            </a>
 
-            <a class="dropdown-item text-headline" href="{{ url('/favmetadata') }}">my notes</a>
+            <a class="dropdown-item text-headline" href="{{ url('/favmetadata') }}">
+                {{ __('general.favourite_metadata') }}
+            </a>
 
-            <a class="dropdown-item text-headline" href="{{ url('/charts') }}">charts</a>
+            <a class="dropdown-item text-headline" href="{{ url('/charts') }}">
+                {{ __('general.charts') }}
+            </a>
 
         </li>
         <li class="nav-item dropdown separator">
-            <a class="dropdown-item text-headline" href="{{ url('/czech') }}">česky</a>
+            <a class="dropdown-item text-headline" href="{{ url('/czech') }}">
+                {{ __('general.cs') }}
+            </a>
         </li>
         <li class="nav-item dropdown">
-            <a class="dropdown-item text-headline" href="{{ route('logout') }}"
-               onclick="event.preventDefault();
-                                                     document.getElementById('logout-form').submit();">
+            <a class="dropdown-item text-headline" href="{{ route('logout') }}" onclick="
+            event.preventDefault();
+            document.getElementById('logout-form').submit();">
                 {{ __('logout') }}
             </a>
 
@@ -50,7 +70,9 @@
 <nav class="navbar navbar-expand-md navbar-light black shadow-sm top-bar">
     <span class="arrow arrow-right" onclick="openNav()"></span>
     @if(!Request::is('login')&&!Request::is('register'))
-        <a for="logo" class="logo-kaplicky kaplicky" href="{{ url('/') }}">{{ __('kaplicky') }}</a>
+        <a for="logo" class="logo-kaplicky kaplicky" href="{{ url('/') }}">
+            {{ __('general.kaplicky') }}
+        </a>
     @endif
 </nav>
 {{--<label for="logo" class="col-md-12 kaplicky" style="display: inline-block; text-align: center; padding: 1.25rem; padding-bottom: 0">{{ __('kaplicky') }}</label>
@@ -67,13 +89,13 @@
         } else {
             document.getElementById("sidebar").style.width = "250px";
         }
-
     }
 
     function closeNav() {
         document.getElementById("sidebar").style.width = "0";
     }
 </script>
+
 <script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
 <script>
     $(function () {
