commit c66c723759d9c8e78cc30be719307076634ffbc9
Author: rizir01 <themurrayms@seznam.cz>
Date:   Tue Apr 7 17:45:17 2020 +0200

    Issue #7697 @5h
    
    Prvotni vytvoreni detailu konkretnich metada k artefaktu plus navazani na bootstrap 4.0. Web jiz obsahuje "velmi zakladni" homepage, nasledne dve genericke stranky a pak hlavni stranku 'detail', ktera po predani id artefaktu nasledne zobrazi metadata. Viz. example 'localhost/detail/id'

diff --git a/app/Artefact.php b/app/Artefact.php
index 9396cc6..8adfa76 100644
--- a/app/Artefact.php
+++ b/app/Artefact.php
@@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model;
 class Artefact extends Model
 {
     // Table Name
-    protected $table = 'artafacts';//unnecessery?
+    protected $table = 'artefacts';//unnecessery?
     // Primary Key
     public $primaryKey = 'id';//unnecessery?
 
diff --git a/app/ArtefactUser.php b/app/ArtefactUser.php
new file mode 100644
index 0000000..ca0a18c
--- /dev/null
+++ b/app/ArtefactUser.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+class ArtefactUser extends Model
+{
+    // Table Name
+    protected $table = 'artefact_user';//unnecessery?
+    // Primary Key
+    public $primaryKey = 'artefact_id';//unnecessery?
+
+    /**
+     * Indicates if the model should be timestamped.
+     *
+     * @var bool
+     */
+    public $timestamps = false;
+
+
+
+
+}
diff --git a/app/Http/Controllers/DetailsController.php b/app/Http/Controllers/DetailsController.php
new file mode 100644
index 0000000..229cdcb
--- /dev/null
+++ b/app/Http/Controllers/DetailsController.php
@@ -0,0 +1,44 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\ArtefactUser;
+use Illuminate\Http\Request;
+use App\Metadata;
+use App\Artefact;
+
+class DetailsController extends Controller
+{
+    /**
+     * Display a listing of the resource.
+     *
+     * @return \Illuminate\Http\Response
+     */
+    public function index()
+    {
+        $data = array(
+            'title' => 'Welcome to the MERLOT page',
+        );
+        //return view('index', compact('title'));
+        return view('index') -> with($data);
+    }
+
+    /**
+     * Display the specified resource.
+     *
+     * @param  int  $id
+     * @return \Illuminate\Http\Response
+     */
+    public function show($id)
+    {
+        $data = array(
+            'title' => 'Title of the BOOK',
+            'id' => $id,
+            'arrArtefact' => Artefact::find($id),
+            'likes' => ArtefactUser::where('artefact_id', $id)->get(),
+            'metadata' => Metadata::where('artefact_id', $id)->get()
+        );
+        return view('detail.index') -> with($data);
+    }
+
+}
diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php
new file mode 100644
index 0000000..7c906ed
--- /dev/null
+++ b/app/Http/Controllers/PagesController.php
@@ -0,0 +1,30 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use Illuminate\Http\Request;
+
+class PagesController extends Controller
+{
+    public function  index()
+    {
+        $title = 'Welcome to the MERLOT page';
+        //return view('index', compact('title'));
+        return view('index') -> with('title', $title);
+    }
+
+    public function info()
+    {
+        $title = 'Info about MERLOT';
+        return view('pages.info') -> with('title', $title);
+    }
+
+    public function services()
+    {
+        $data = array(
+            'title' => 'Services',
+            'services' => ['Web design', 'Programming', 'SEO']
+        );
+        return view('pages.services') -> with($data);
+    }
+}
diff --git a/app/Metadata.php b/app/Metadata.php
index 529804e..8e82d99 100644
--- a/app/Metadata.php
+++ b/app/Metadata.php
@@ -28,7 +28,7 @@ class Metadata extends Model
     public $timestamps = false;
 
     /**
-     * Get the artafact for this single metadata.
+     * Get the artefact for this single metadata.
      */
     public function artefact(){
         return $this->belongsTo('App\Artefact');
diff --git a/composer.json b/composer.json
index 4e81d21..381c5ba 100644
--- a/composer.json
+++ b/composer.json
@@ -13,7 +13,8 @@
         "fruitcake/laravel-cors": "^1.0",
         "guzzlehttp/guzzle": "^6.3",
         "laravel/framework": "^7.0",
-        "laravel/tinker": "^2.0"
+        "laravel/tinker": "^2.0",
+        "laravel/ui": "^2.0"
     },
     "require-dev": {
         "facade/ignition": "^2.0",
diff --git a/composer.lock b/composer.lock
index 530f480..e293684 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "6558f74828bca9ebecac73d90cea4b1a",
+    "content-hash": "f0dcbdc80776ca79d6311b8f92c5a4b5",
     "packages": [
         {
             "name": "asm89/stack-cors",
@@ -683,6 +683,7 @@
                     "email": "jakub.onderka@gmail.com"
                 }
             ],
+            "abandoned": "php-parallel-lint/php-console-color",
             "time": "2018-09-29T17:23:10+00:00"
         },
         {
@@ -729,6 +730,7 @@
                 }
             ],
             "description": "Highlight PHP code in terminal",
+            "abandoned": "php-parallel-lint/php-console-highlighter",
             "time": "2018-09-29T18:48:56+00:00"
         },
         {
@@ -946,6 +948,61 @@
             ],
             "time": "2020-02-05T15:00:44+00:00"
         },
+        {
+            "name": "laravel/ui",
+            "version": "v2.0.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/laravel/ui.git",
+                "reference": "47a0a1dac76f5e73803c86e1f38b2c7e0ae7fa83"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/laravel/ui/zipball/47a0a1dac76f5e73803c86e1f38b2c7e0ae7fa83",
+                "reference": "47a0a1dac76f5e73803c86e1f38b2c7e0ae7fa83",
+                "shasum": ""
+            },
+            "require": {
+                "illuminate/console": "^7.0",
+                "illuminate/filesystem": "^7.0",
+                "illuminate/support": "^7.0",
+                "php": "^7.2.5"
+            },
+            "require-dev": {
+                "mockery/mockery": "^1.0",
+                "phpunit/phpunit": "^8.0"
+            },
+            "type": "library",
+            "extra": {
+                "laravel": {
+                    "providers": [
+                        "Laravel\\Ui\\UiServiceProvider"
+                    ]
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Laravel\\Ui\\": "src/",
+                    "Illuminate\\Foundation\\Auth\\": "auth-backend/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Taylor Otwell",
+                    "email": "taylor@laravel.com"
+                }
+            ],
+            "description": "Laravel UI utilities and presets.",
+            "keywords": [
+                "laravel",
+                "ui"
+            ],
+            "time": "2020-03-03T20:16:46+00:00"
+        },
         {
             "name": "league/commonmark",
             "version": "1.3.1",
@@ -5449,5 +5506,6 @@
     "platform": {
         "php": "^7.2.5"
     },
-    "platform-dev": []
+    "platform-dev": [],
+    "plugin-api-version": "1.1.0"
 }
diff --git a/package.json b/package.json
index 3729fb7..27037c8 100644
--- a/package.json
+++ b/package.json
@@ -11,9 +11,12 @@
     },
     "devDependencies": {
         "axios": "^0.19",
+        "bootstrap": "^4.0.0",
         "cross-env": "^7.0",
+        "jquery": "^3.2",
         "laravel-mix": "^5.0.1",
         "lodash": "^4.17.13",
+        "popper.js": "^1.12",
         "resolve-url-loader": "^3.1.0",
         "sass": "^1.15.2",
         "sass-loader": "^8.0.0"
diff --git a/public/css/global.css b/public/css/global.css
new file mode 100644
index 0000000..665a917
--- /dev/null
+++ b/public/css/global.css
@@ -0,0 +1,3 @@
+body{
+    background-color: #f8fafc;
+}
diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js
index 6922577..8eaba1b 100644
--- a/resources/js/bootstrap.js
+++ b/resources/js/bootstrap.js
@@ -1,5 +1,18 @@
 window._ = require('lodash');
 
+/**
+ * We'll load jQuery and the Bootstrap jQuery plugin which provides support
+ * for JavaScript based Bootstrap features such as modals and tabs. This
+ * code may be modified to fit the specific needs of your application.
+ */
+
+try {
+    window.Popper = require('popper.js').default;
+    window.$ = window.jQuery = require('jquery');
+
+    require('bootstrap');
+} catch (e) {}
+
 /**
  * We'll load the axios HTTP library which allows us to easily issue requests
  * to our Laravel back-end. This library automatically handles sending the
@@ -24,5 +37,5 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
 //     broadcaster: 'pusher',
 //     key: process.env.MIX_PUSHER_APP_KEY,
 //     cluster: process.env.MIX_PUSHER_APP_CLUSTER,
-//     forceTLS: true
+//     encrypted: true
 // });
diff --git a/resources/sass/app.scss b/resources/sass/app.scss
index 8337712..3193ffa 100644
--- a/resources/sass/app.scss
+++ b/resources/sass/app.scss
@@ -1 +1,8 @@
-//
+// Fonts
+@import url('https://fonts.googleapis.com/css?family=Nunito');
+
+// Variables
+@import 'variables';
+
+// Bootstrap
+@import '~bootstrap/scss/bootstrap';
diff --git a/resources/views/detail/index.blade.php b/resources/views/detail/index.blade.php
new file mode 100644
index 0000000..7b565f7
--- /dev/null
+++ b/resources/views/detail/index.blade.php
@@ -0,0 +1,34 @@
+@extends('layouts.app')
+
+@section('content')
+    <h1>{{$arrArtefact->name}}</h1>
+    <p>The id of the book is {{$id}}</p>
+    @if(isset($arrArtefact))
+        <p>{{$arrArtefact->author}}, {{$arrArtefact->year}}, {{$arrArtefact->pages}} pages, {{count($likes)}} likes</p>
+{{--        <p><?php dd($metadata); ?></p>--}}
+        @if(count($metadata) >= 1)
+            <ul class="list-group">
+            @foreach($metadata as $meta)
+                    <li class="list-group-item">
+                    On {{$meta->page}} page:<br>
+                    {{$meta->noteCZ}}<br>
+                    {{$meta->noteEN}}<br>
+                </li>
+                <br>
+            @endforeach
+            </ul>
+        @else
+            <ul class="list-group">
+                <li class="list-group-item">
+                    <h3>No notes for this BOOK were found!</h3>
+                </li>
+            </ul>
+        @endif
+    @else
+        <ul class="list-group">
+            <li class="list-group-item">
+                <h3>Not found the Artefact in the database with number id {{$id}}!</h3>
+            </li>
+        </ul>
+    @endif
+@endsection
diff --git a/resources/views/inc/navbar.blade.php b/resources/views/inc/navbar.blade.php
new file mode 100644
index 0000000..b2fd1b5
--- /dev/null
+++ b/resources/views/inc/navbar.blade.php
@@ -0,0 +1,14 @@
+<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
+    <ul class="navbar-nav">
+        <a class="navbar-brand" >{{config('app.name', 'MERLOT')}}</a>
+        <li class="nav-item active">
+            <a class="nav-link" href="/">Home</a>
+        </li>
+        <li class="nav-item">
+            <a class="nav-link" href="/info">Info</a>
+        </li>
+        <li class="nav-item">
+            <a class="nav-link" href="/services">Services</a>
+        </li>
+    </ul>
+</nav>
diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php
new file mode 100644
index 0000000..d51ccea
--- /dev/null
+++ b/resources/views/index.blade.php
@@ -0,0 +1,8 @@
+@extends('layouts.app')
+
+@section('content')
+    <div class="jumbotron text-center">
+        <h1>{{$title}}</h1>
+        <p>This is the laravel application from the MERLOT Group.</p>
+    </div>
+@endsection
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php
new file mode 100644
index 0000000..e297568
--- /dev/null
+++ b/resources/views/layouts/app.blade.php
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
+    <head>
+        <meta charset="utf-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1">
+        <!--<link rel="stylesheet" href="{{asset('css/app.css')}}">-->
+
+        <meta name="viewport" content="width=device-width, initial-scale=1">
+        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
+        <link rel="stylesheet" href="{{asset('css/global.css')}}">
+        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
+        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
+        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
+
+        <title>{{config('app.name', 'MERLOT')}}</title>
+    </head>
+    <body>
+        @include('inc.navbar')
+        <div class="container">
+            @yield('content')
+        </div>
+    </body>
+</html>
diff --git a/resources/views/pages/info.blade.php b/resources/views/pages/info.blade.php
new file mode 100644
index 0000000..b443702
--- /dev/null
+++ b/resources/views/pages/info.blade.php
@@ -0,0 +1,6 @@
+@extends('layouts.app')
+
+@section('content')
+    <h1>{{$title}}</h1>
+    <p>This is the laravel application from the MERLOT Group.</p>
+@endsection
diff --git a/resources/views/pages/services.blade.php b/resources/views/pages/services.blade.php
new file mode 100644
index 0000000..d9352c0
--- /dev/null
+++ b/resources/views/pages/services.blade.php
@@ -0,0 +1,12 @@
+@extends('layouts.app')
+
+@section('content')
+    <h1>{{$title}}</h1>
+    @if(count($services) > 0)
+        <ul class="list-group">
+            @foreach($services as $service)
+                <li class="list-group-item">{{$service}}</li>
+            @endforeach
+        </ul>
+    @endif
+@endsection
diff --git a/routes/web.php b/routes/web.php
index b130397..80133a5 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -13,6 +13,19 @@ use Illuminate\Support\Facades\Route;
 |
 */
 
-Route::get('/', function () {
-    return view('welcome');
+/*
+Route::get('/users/{id}', function ($id) {
+    return 'Thhis is user ' . $id;
+});
+
+Route::get('/detail', function () {
+    return view('pages.detail');
 });
+ */
+
+Route::get('/', 'PagesController@index');
+Route::get('/info', 'PagesController@info');
+Route::get('/services', 'PagesController@services');
+Route::resource('/detail', 'DetailsController', array('only' => array('index', 'show')));
+
+
