commit deebc8b6153b9dc02ceb3376e8d2154dd8283cff
Author: zabran <zabran@students.zcu.cz>
Date:   Wed May 27 13:20:34 2020 +0200

    Oprava like/unlike u charts.

diff --git a/resources/sass/_custom.scss b/resources/sass/_custom.scss
index 57fafa2..8127fa1 100644
--- a/resources/sass/_custom.scss
+++ b/resources/sass/_custom.scss
@@ -405,8 +405,10 @@ body {
             }
         }
 
-        .charts{
-            .inter_info, .inter_like, .inter_like_filled{
+        .charts {
+            .inter_info, .inter_like, .inter_like_filled {
+                display: inline;
+
                 &:before {
                     width: 3rem;
                     height: 3rem;
@@ -744,9 +746,9 @@ body {
         }
     }
 
-    .btn-dark:not(:disabled):not(.disabled).active{
+    .btn-dark:not(:disabled):not(.disabled).active {
         background-color: $theme-color-four;
-        color:white;
+        color: white;
         border-color: $theme-color-five;
     }
 
@@ -764,26 +766,26 @@ body {
     }
 
     //CATEGORIES - Main menu
-    .cat-main-menu{
+    .cat-main-menu {
         font-size: 1.75rem;
         text-align: center;
         margin-bottom: 30pt;
 
-        a,a:visited{
+        a, a:visited {
             color: $theme-color-two;
             text-decoration: none;
         }
 
-        a:hover{
+        a:hover {
             color: $theme-color-four;
         }
 
     }
 
     //CATEGORIES - Wrapper around Enter button
-    .cat-wrapper{
-        margin:auto;
-        display:block;
+    .cat-wrapper {
+        margin: auto;
+        display: block;
         //align-content: center;
         //margin:auto;
         //display:block;
@@ -794,7 +796,7 @@ body {
         //font-size: 8pt;
         //background-color: grey;
         //color: $theme-color-one;
-       // border: 0.5pt solid $theme-color-one;
+        // border: 0.5pt solid $theme-color-one;
         border-radius: 0;
         bottom: 5%;
         position: fixed;
@@ -816,13 +818,13 @@ body {
     }
 
     //VERIFY - main text
-    .ver-text{
+    .ver-text {
 
-        margin-top: 20pt    ;
+        margin-top: 20pt;
 
-        h2{
+        h2 {
             text-align: center;
-            color:$theme-color-two;
+            color: $theme-color-two;
         }
     }
 }
@@ -1320,7 +1322,8 @@ body {
             top: -1.125rem;
             left: -0.56rem;
         }
-        .pin-left{
+
+        .pin-left {
             // center fixed div
             left: 75%;
             transform: translateX(-50%);
@@ -1332,6 +1335,7 @@ body {
             font-size: 18pt;
             line-height: 26pt;
         }
+
         .text2 {
             text-align: left;
             font-size: 18pt;
diff --git a/resources/views/charts/index.blade.php b/resources/views/charts/index.blade.php
index a8b24fe..d4d2f06 100644
--- a/resources/views/charts/index.blade.php
+++ b/resources/views/charts/index.blade.php
@@ -28,25 +28,17 @@
 
                                             <div class="charts float-center">
                                                 @if (!$artefact->favourite)
-                                                    <form method="POST"
-                                                          action="{{ url('/artefact/like/' . $artefact->id) }}">
-                                                        @csrf
-                                                        <button id="like_butt_{{$artefact->id}}" style="display: inline"
-                                                                type="submit"
-                                                                class="btn btn-primary button-image inter_like" ></button>
-                                                    </form>
+                                                    <a href="{{  action('ArtefactController@like', ['id' => $artefact->id]) }}">
+                                                        <button id="like_butt_{{$artefact->id}}" type="button"
+                                                                class="btn btn-primary button-image inter_like"></button>
+                                                    </a>
                                                 @else
-                                                    <form method="POST"
-                                                          action="{{ url('/artefact/unlike/' . $artefact->id) }}">
-                                                        @csrf
-                                                        <button id="like_butt_{{$artefact->id}}" style="display: inline"
-                                                                type="submit"
+                                                    <a href="{{  action('ArtefactController@unlike', ['id' => $artefact->id]) }}">
+                                                        <button id="like_butt_{{$artefact->id}}" type="button"
                                                                 class="btn btn-primary button-image inter_like_filled"></button>
-                                                    </form>
+                                                    </a>
                                                 @endif
-                                                <span class="likes_text">
-                                                <h6>{{$artefact->likes}}</h6>
-                                            </span>
+                                                <h6 class="artefact-likes">{{$artefact->likes}}</h6>
                                             </div>
                                         </div>
                                     </div>
diff --git a/resources/views/inc/sidebar.blade.php b/resources/views/inc/sidebar.blade.php
index 2e897f2..096525d 100644
--- a/resources/views/inc/sidebar.blade.php
+++ b/resources/views/inc/sidebar.blade.php
@@ -2,66 +2,66 @@
     <a href="javascript:void(0)" class="arrow arrow-left" onclick="closeNav()"></a>
     <ul style="padding-left: 0; margin-top: 5rem;">
         @if(Request::is('login')||Request::is('register'))
-        <li class="nav-item">
-            <a class="menu-item text-headline" href="{{ url('/') }}">
-                {{ __('general.home') }}
-            </a>
-            <a class="menu-item text-headline" href="{{ route('login') }}">
-                {{ __('general.login') }}
-            </a>
-        </li>
-        @if (Route::has('register'))
             <li class="nav-item">
-                <a class="menu-item text-headline" href="{{ route('register') }}">
-                    {{ __('general.register') }}
+                <a class="menu-item text-headline" href="{{ url('/') }}">
+                    {{ __('general.home') }}
+                </a>
+                <a class="menu-item text-headline" href="{{ route('login') }}">
+                    {{ __('general.login') }}
                 </a>
             </li>
-        @endif
-    @else
-        <li class="nav-item">
-            <a class="menu-item text-headline" href="{{ url('/') }}">
-                {{ __('general.home') }}
-            </a>
+            @if (Route::has('register'))
+                <li class="nav-item">
+                    <a class="menu-item text-headline" href="{{ route('register') }}">
+                        {{ __('general.register') }}
+                    </a>
+                </li>
+            @endif
+        @else
+            <li class="nav-item">
+                <a class="menu-item text-headline" href="{{ url('/') }}">
+                    {{ __('general.home') }}
+                </a>
 
-            <a class="menu-item text-headline" href="{{ url('/categories') }}">
-                {{ __('general.topics') }}
-            </a>
+                <a class="menu-item text-headline" href="{{ url('/categories') }}">
+                    {{ __('general.topics') }}
+                </a>
 
-            <a class="menu-item text-headline" href="{{ url('/artefact') }}">
-                {{ __('general.artefacts') }}
-            </a>
+                <a class="menu-item text-headline" href="{{ url('/artefact') }}">
+                    {{ __('general.artefacts') }}
+                </a>
 
-            <a class="menu-item text-headline" href="{{ url('/favartefacts') }}">
-                {{ __('general.favourite_artefacts') }}
-            </a>
+                <a class="menu-item text-headline" href="{{ url('/favartefacts') }}">
+                    {{ __('general.favourite_artefacts') }}
+                </a>
 
-            <a class="menu-item text-headline" href="{{ url('/favmetadata') }}">
-                {{ __('general.favourite_metadata') }}
-            </a>
+                <a class="menu-item text-headline" href="{{ url('/favmetadata') }}">
+                    {{ __('general.favourite_metadata') }}
+                </a>
 
-            <a class="menu-item text-headline" href="{{ url('/charts') }}">
-                {{ __('general.charts') }}
-            </a>
+                <a class="menu-item text-headline" href="{{ url('/charts') }}">
+                    {{ __('general.charts') }}
+                </a>
 
-        </li>
-        <li class="nav-item down">
-            <a class="menu-item text-headline" href="{{ url('/czech') }}">
-                {{ __('general.cs') }}
-            </a>
-            @guest
+            </li>
+            <li class="nav-item down">
+                <a class="menu-item text-headline" href="{{ url('/czech') }}">
+                    {{ __('general.cs') }}
+                </a>
+                @guest
                 @else
-            <a class="menu-item text-headline" href="{{ route('logout') }}" onclick="
+                    <a class="menu-item text-headline" href="{{ route('logout') }}" onclick="
             event.preventDefault();
             document.getElementById('logout-form').submit();">
-                {{ __('general.logout') }}
-            </a>
+                        {{ __('general.logout') }}
+                    </a>
 
-            <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
-                @csrf
-            </form>
+                    <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
+                        @csrf
+                    </form>
                 @endguest
-        </li>
-    @endif
+            </li>
+        @endif
     </ul>
 </div>
 
@@ -74,56 +74,56 @@
     @endif
     <div class="bar-desktop">
         @if(Request::is('login')||Request::is('register'))
-                <a class="menu-item text-headline-desktop" href="{{ url('/') }}">
-                    {{ __('general.home') }}
-                </a>
-                <a class="menu-item text-headline-desktop" href="{{ route('login') }}">
-                    {{ __('general.login') }}
-                </a>
+            <a class="menu-item text-headline-desktop" href="{{ url('/') }}">
+                {{ __('general.home') }}
+            </a>
+            <a class="menu-item text-headline-desktop" href="{{ route('login') }}">
+                {{ __('general.login') }}
+            </a>
             @if (Route::has('register'))
-                    <a class="menu-item text-headline-desktop" href="{{ route('register') }}">
-                        {{ __('general.register') }}
-                    </a>
+                <a class="menu-item text-headline-desktop" href="{{ route('register') }}">
+                    {{ __('general.register') }}
+                </a>
             @endif
         @else
-        <a class="menu-item text-headline-desktop" href="{{ url('/') }}">
-            {{ __('general.home') }}
-        </a>
+            <a class="menu-item text-headline-desktop" href="{{ url('/') }}">
+                {{ __('general.home') }}
+            </a>
 
-        <a class="menu-item text-headline-desktop" href="{{ url('/categories') }}">
-            {{ __('general.topics') }}
-        </a>
+            <a class="menu-item text-headline-desktop" href="{{ url('/categories') }}">
+                {{ __('general.topics') }}
+            </a>
 
-        <a class="menu-item text-headline-desktop" href="{{ url('/artefact') }}">
-            {{ __('general.artefacts') }}
-        </a>
+            <a class="menu-item text-headline-desktop" href="{{ url('/artefact') }}">
+                {{ __('general.artefacts') }}
+            </a>
 
-        <a class="menu-item text-headline-desktop" href="{{ url('/favartefacts') }}">
-            {{ __('general.favourite_artefacts') }}
-        </a>
+            <a class="menu-item text-headline-desktop" href="{{ url('/favartefacts') }}">
+                {{ __('general.favourite_artefacts') }}
+            </a>
 
-        <a class="menu-item text-headline-desktop" href="{{ url('/favmetadata') }}">
-            {{ __('general.favourite_metadata') }}
-        </a>
+            <a class="menu-item text-headline-desktop" href="{{ url('/favmetadata') }}">
+                {{ __('general.favourite_metadata') }}
+            </a>
 
-        <a class="menu-item text-headline-desktop" href="{{ url('/charts') }}">
-            {{ __('general.charts') }}
-        </a>
+            <a class="menu-item text-headline-desktop" href="{{ url('/charts') }}">
+                {{ __('general.charts') }}
+            </a>
 
-        <a class="menu-item text-headline-desktop" href="{{ url('/czech') }}">
-            {{ __('general.cs') }}
-        </a>
-        @guest
+            <a class="menu-item text-headline-desktop" href="{{ url('/czech') }}">
+                {{ __('general.cs') }}
+            </a>
+            @guest
             @else
-        <a class="menu-item text-headline-desktop" href="{{ route('logout') }}" onclick="
+                <a class="menu-item text-headline-desktop" href="{{ route('logout') }}" onclick="
             event.preventDefault();
             document.getElementById('logout-form').submit();">
-            {{ __('general.logout') }}
-        </a>
+                    {{ __('general.logout') }}
+                </a>
 
-        <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
-            @csrf
-        </form>
+                <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
+                    @csrf
+                </form>
             @endguest
         @endif
     </div>
