Projekt

Obecné

Profil

Stáhnout (3.55 KB) Statistiky
| Větev: | Tag: | Revize:
1
@extends('layouts.art')
2

    
3
@section('title', 'Favorite artefacts')
4

    
5
@section('content')
6
    <div class="container">
7
        {{--<p>The id of the user is {{$user->id}}</p>--}}
8
        @if(isset($artefacts))
9
            @if(count($artefacts) >= 1)
10
                @foreach($artefacts as $artefact)
11
                    <div class="artefacts-area mb-5">
12
                        <div class="card">
13
                        {{--<svg class="bd-placeholder-img card-img-top" width="100%" height="180" src="{{asset('images/artefacts/book_cover_01.jpg')}}" preserveAspectRatio="xMidYMid slice" focusable="false" role="img" aria-label="Placeholder: Image cap"><title>{{$artefact[0]->name}}</title><rect width="100%" height="100%" fill="#868e96"></rect><text x="45%" y="50%" fill="#dee2e6" dy=".3em"></text></svg>--}}
14
                        <a href="{{ url('/artefact/' . $artefact->id) }}">
15
                            <img class="card-img-top" src="{{asset('images/artefacts/book_cover_01.jpg')}}" width="100%" height=auto>
16
                        </a>
17
                        <div class="container card-cus-bottom">
18
                            <div class="flex-row row-list">
19
                                <div class="col-xs-2 float-left left_panel_info">
20
                                    <h5 class="card-title ">{{$artefact->name}}</h5>
21
                                    <h6 class="card-title">{{$artefact->author}}</h6>
22
                                </div>
23
                                <div class="col-xs-2 float-right right_panel_info">
24
                                    <div class="float-left">
25
                                        <button id="info_butt_{{$artefact->id}}" type="button" class="btn btn-primary button-image inter_info"></button>
26
                                    </div>
27
                                    <div class="float-right text-center">
28
                                        <button id="like_butt_{{$artefact->id}}" onclick="myFunction({{$artefact->id}}, 1)" type="button" class="btn btn-primary button-image inter_like"></button>
29
                                        <button id="like_butt2_{{$artefact->id}}" onclick="myFunction({{$artefact->id}}, 0)" type="button" class="btn btn-primary button-image inter_like_filled"></button>
30
                                        <span class="likes_text">
31
                                          <h6>{{$artefact->likes}}</h6>
32
                                        </span>
33
                                    </div>
34
                                </div>
35
                            </div>
36
                            </div>
37
                        </div>
38
                    </div>
39
                @endforeach
40
            @else
41
                <ul class="list-group">
42
                    <li class="list-group-item">
43
                        <h3>No favorites were added!</h3>
44
                    </li>
45
                </ul>
46
            @endif
47
        @else
48
            <ul class="list-group">
49
                <li class="list-group-item">
50
                    <h3>Not found the USER in the database with number id {{$user->id}}!</h3>
51
                </li>
52
            </ul>
53
        @endif
54
	</div>
55
    <script>
56
        function myFunction(id, type)
57
        {
58
            if(type === 1)
59
            {
60
                $('#like_butt_' + id).css('display', "none");
61
                $('#like_butt2_' + id).css('display', "inline");
62
            }
63
            else
64
            {
65
                $('#like_butt_' + id).css('display', "inline");
66
                $('#like_butt2_' + id).css('display', "none");
67
            }
68
        }
69
    </script>
70
@endsection
    (1-1/1)