Projekt

Obecné

Profil

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

    
3
@section('title', 'Detail')
4

    
5
@section('content')
6
    <div class="container">
7
        <div class="metadata-area">
8
            <div class="text-center mt-5">
9
                <h2>notes</h2>
10
            </div>
11
            <span class="arrow-down"></span>
12

    
13
            @if(!empty($metadata) || count($metadata) > 0)
14
                @foreach($metadata as $meta)
15
                    <div  id="row_{{$meta->id}}" class="row text-page">
16
                        <div class="pin-horizontal">
17
                            <div class="metadata">
18
                                <span>page {{$meta->page}}</span>
19
                                <a href="#meta_{{$meta->id}}" class="arrow-down" data-toggle="collapse" data-target="#meta_{{$meta->id}}" onclick="openNote('#row_{{$meta->id}}')"></a>
20
                            </div>
21
                        </div>
22
                        <div id="meta_{{$meta->id}}" class="metadata-text collapse">
23
                            <p>
24
                                {{$meta->noteEN}}
25
                            </p>
26
                            <div class="artefact-info">
27
                                <div class="artefact-name">
28
                                    {{$meta->artefact->name}}
29
                                </div>
30
                                <div class="artefact-author">
31
                                    {{$meta->artefact->author}}
32
                                </div>
33
                                <div class="text-center">
34
                                    @if ($meta->favourite)
35
                                        <a href="{{  action('DetailsController@unlike', ['id' => $meta->id]) }}">
36
                                            <button id="like_butt_{{$meta->id}}" type="button" class="btn btn-primary button-image inter_like_filled"></button>
37
                                        </a>
38
                                    @else
39
                                        <a href="{{  action('DetailsController@like', ['id' => $meta->id]) }}">
40
                                            <button id="like_butt_{{$meta->id}}" type="button" class="btn btn-primary button-image inter_like"></button>
41
                                        </a>
42
                                    @endif
43
                                </div>
44
                            </div>
45
                        </div>
46
                    </div>
47
                @endforeach
48
            @else
49
                <div class="text-center mt-5">
50
                    <h2>No metadata!</h2>
51
                </div>
52
            @endif
53
        </div>
54
    </div>
55

    
56
    <script>
57
        function openNote(element) {
58
            let metadata = $(element);
59
            let showed = metadata.find(".metadata-text").hasClass('show');
60

    
61
            if (showed === false)
62
            {
63
                metadata.find('.pin-horizontal').addClass("white-pin");
64
            }
65
            else
66
            {
67
                metadata.find('.pin-horizontal').removeClass("white-pin");
68
            }
69

    
70
        }
71
    </script>
72
@endsection
    (1-1/1)