commit eadc983d6eb4a3e10797fe2227c0968853aebd16
Author: rizir01 <themurrayms@seznam.cz>
Date:   Sun May 17 16:51:27 2020 +0200

    Issue #8010 @3h
    
    Uprava "Categories" podle specifikovaneho navrhu. Predelany ssytem vyberu categories, kde lze vybrat vice kategorii najednou a po stisknuti tlacitka ENTER se uzivatel prenese do seznamu vsech vybranych artefaktu.

diff --git a/app/Http/Controllers/ArtefactController.php b/app/Http/Controllers/ArtefactController.php
index 3ce984a..198e92b 100644
--- a/app/Http/Controllers/ArtefactController.php
+++ b/app/Http/Controllers/ArtefactController.php
@@ -53,6 +53,44 @@ class ArtefactController extends Controller
         }
     }
 
+    /**
+     * Returns view of artefacts related to the chosen category
+     *
+     * @param $id string with categories ids
+     * @return Factory|View
+     */
+    public function showCategories($id)
+    {
+        $textWithIds  = $id;
+        $pieces = explode(",", $textWithIds);
+        $artefacts = array();
+        for($i = 0;$i < count($pieces); $i++)
+        {
+            if($pieces[$i] == null || !strcmp($pieces[$i], ""))
+            {
+                continue;
+            }
+
+            $categoryArtefacts = ArtefactCategory::where('category_id', $pieces[$i])->get();
+            if(count($categoryArtefacts) > 0)
+            {
+                foreach($categoryArtefacts as $ar)
+                {
+                    array_push($artefacts, Artefact::where('id', $ar->artefact_id)->get());
+                }
+            }
+        }
+
+        if(count($artefacts) > 0)
+        {
+            return view('artefact.category', ['artefacts' => $artefacts]);
+        }
+        else
+        {
+            return view('artefact.category', ['artefacts' => array()]);
+        }
+    }
+
     /**
      * Returns view of single artefact given by its id.
      *
diff --git a/resources/lang/en/general.php b/resources/lang/en/general.php
index 45a1aa1..4cbc184 100644
--- a/resources/lang/en/general.php
+++ b/resources/lang/en/general.php
@@ -30,8 +30,8 @@ return [
     'register' => 'register',
     'topics' => 'topics',
     'artefacts' => 'books',
-    'favourite_artefacts' => 'my books',
-    'favourite_metadata' => 'my notes',
+    'favourite_artefacts' => 'likes',
+    'favourite_metadata' => 'notes',
     'charts' => 'charts',
 
     /*
diff --git a/resources/sass/_custom.scss b/resources/sass/_custom.scss
index 91ed734..c55b591 100644
--- a/resources/sass/_custom.scss
+++ b/resources/sass/_custom.scss
@@ -713,6 +713,12 @@ body {
         }
     }
 
+    .btn-dark:not(:disabled):not(.disabled).active{
+        background-color: $theme-color-four;
+        color:white;
+        border-color: $theme-color-five;
+    }
+
     //CATEGORY/{id} -h2 title NO ARTEFACTS
     .category-h2 {
         color: $theme-color-four;
@@ -726,6 +732,58 @@ body {
         }
     }
 
+    //CATEGORIES - Main menu
+    .cat-main-menu{
+        font-size: 1.75rem;
+        text-align: center;
+        margin-bottom: 30pt;
+
+        a,a:visited{
+            color: $theme-color-two;
+            text-decoration: none;
+        }
+
+        a:hover{
+            color: $theme-color-four;
+        }
+
+    }
+
+    //CATEGORIES - Wrapper around Enter button
+    .cat-wrapper{
+        margin:auto;
+        display:block;
+        //align-content: center;
+        //margin:auto;
+        //display:block;
+    }
+
+    //CATEGORIES - Enter button
+    .btn.button-square.cat-enter-butt {
+        font-size: 8pt;
+        background-color: grey;
+        color: $theme-color-one;
+        border: 0.5pt solid $theme-color-one;
+        border-radius: 0;
+        bottom: 5%;
+        position: fixed;
+        left: 50%;
+        transform: translateX(-50%);
+        width: 6.5rem;
+        height: 2rem;
+        font-weight: $font-weight-one;
+
+        &:active, &:focus, &:visited, &:hover {
+            outline: none;
+            box-shadow: none;
+            color: $theme-color-one;
+        }
+
+        &:hover {
+            color: $theme-color-four;
+        }
+    }
+
     //VERIFY - main text
     .ver-text{
 
diff --git a/resources/views/categories/index.blade.php b/resources/views/categories/index.blade.php
index 9330e5f..ff07ca0 100644
--- a/resources/views/categories/index.blade.php
+++ b/resources/views/categories/index.blade.php
@@ -5,17 +5,52 @@
 @section('content')
     <div class="container">
         @if(isset($user))
-            {{--<p><?php dd($categories); ?></p>--}}
-            <div class="cat-main-div" onclick="resetEnter()">
+            <div class="row">
+                <div class="col cat-main-menu">
+                    <a  href="{{ url('/') }}">
+                        {{ __('general.home') }}
+                    </a>
+                </div>
+                <div class="col cat-main-menu">
+                    <a href="{{ url('/categories') }}">
+                        {{ __('general.topics') }}
+                    </a>
+                </div>
+                <div class="col cat-main-menu">
+                    <a href="{{ url('/artefact') }}">
+                        {{ __('general.artefacts') }}
+                    </a>
+                </div>
+                <div class="col cat-main-menu">
+                    <a href="{{ url('/favartefacts') }}">
+                        {{ __('general.favourite_artefacts') }}
+                    </a>
+                </div>
+                <div class="col cat-main-menu">
+                    <a href="{{ url('/favmetadata') }}">
+                        {{ __('general.favourite_metadata') }}
+                    </a>
+                </div>
+                <div class="col cat-main-menu">
+                    <a href="{{ url('/charts') }}">
+                        {{ __('general.charts') }}
+                    </a>
+                </div>
+                <div class="col cat-main-menu">
+                    <a href="{{ url('/czech') }}">
+                        {{ __('general.cs') }}
+                    </a>
+                </div>
+            </div>
+            <div class="cat-main-div" {{--onclick="resetEnter()"--}}>
                 <div class="head-title text-center cat-main-topic">
                     <h1>choose a topic</h1>
                 </div>
-                <div class="d-flex flex-wrap justify-content-around">
+                <div class="d-flex flex-wrap justify-content-around btn-group" data-toggle="buttons">
                     @for($k = 0; $k < $count;$k++)
-                        {{--                        <div class="d-flex cat-col-md-2">--}}
                         <div class="d-flex col-sm-12 col-md-6 col-lg-4 col-xl-3">
-                            <a href="{{ url('/category/' . $categoryNames[$k]->id) }}"
-                               class="btn btn-dark cat-tile w-100 mt-4">
+                            <a id="cat-but-id{{$categoryNames[$k]->id}}"{{--href="{{ url('/category/' . $categoryNames[$k]->id) }}"--}}
+                                class="btn btn-dark cat-tile w-100 mt-4">
                                 {{$categoryNames[$k]->nameCZ}}
                             </a>
                         </div>
@@ -30,4 +65,31 @@
             </ul>
         @endif
     </div>
+    <div class="cat-wrapper">
+        <a class="btn button-square cat-enter-butt" onclick="test()" role="button">enter</a>
+    </div>
+    <div class="row justify-content-md-center">
+        <div class="col-md-auto">
+{{--
+            <a class="btn button-square cat-enter-butt" onclick="test()" role="button">enter</a>
+--}}
+        </div>
+    </div>
+    <script>
+        function test()
+        {
+            var btns = $(".btn-dark:not(:disabled):not(.disabled).active");
+            if(btns.length > 0)
+            {
+                var text = "";
+                for(var i = 0; i < btns.length;i++)
+                {
+                    var idE =  btns[i].id;
+                    var num = idE.substring(10, idE.length);
+                    text += num + ",";
+                }
+                window.location.href = "{{url('/category/multi/')}}/" + text;
+            }
+        }
+    </script>
 @endsection
diff --git a/routes/web.php b/routes/web.php
index f3b1e0b..321427a 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -21,6 +21,7 @@ Route::get('/artefact/{id}', 'ArtefactController@view');
 Route::post('/artefact/like/{id}', 'ArtefactController@like');
 Route::post('/artefact/unlike/{id}', 'ArtefactController@unlike');
 Route::get('/category/{id}', 'ArtefactController@showCategory');
+Route::get('/category/multi/{id}', 'ArtefactController@showCategories');
 Route::get('/detail/like/{id}', 'DetailsController@like');
 Route::get('/detail/unlike/{id}', 'DetailsController@unlike');
 Route::resource('/detail', 'DetailsController', array('only' => array('index', 'show')));
