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