Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 2fee1bb5

Přidáno uživatelem Marek Lovčí před asi 4 roky(ů)

Language mutations and code clean

Zobrazit rozdíly:

README.md
38 38

  
39 39
Migrace dat z Mockaroo je tímto okamžikem obsolete.
40 40

  
41
### Výchozí uživatel
42

  
43
Je nadefinován výchozí (testovací) uživatel.
44

  
45
**Login** admin@kaplicky.com **heslo** admin
46

  
41 47
## Jak zprovoznit bootstrap a kompilaci SASS souborů
42 48

  
43 49
1. Ujistěte se, že v sekci **Run/Edit Configurations** máte nastavený **Document root** na složku `public` v kořenovém adresáři (jinak aplikace **nenajde** vygenerované css soubory).
app/Http/Controllers/ArtefactController.php
4 4

  
5 5
use App\Artefact;
6 6
use App\ArtefactCategory;
7
use App\Category;
8
use App\Metadata;
9 7
use App\User;
10
use Illuminate\Http\Request;
8
use Illuminate\Contracts\View\Factory;
9
use Illuminate\Http\RedirectResponse;
11 10
use Illuminate\Support\Facades\Auth;
12
use Illuminate\Support\Facades\DB;
11
use Illuminate\View\View;
13 12

  
14 13
class ArtefactController extends Controller
15 14
{
......
21 20
    /**
22 21
     * Returns view of all artefacts.
23 22
     *
24
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
23
     * @return Factory|View
25 24
     */
26 25
    public function default()
27 26
    {
......
33 32
    /**
34 33
     * Returns view of artefacts related to the chosen category
35 34
     *
36
     * @param $id       id of the category
37
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
35
     * @param $id id of the category
36
     * @return Factory|View
38 37
     */
39 38
    public function showCategory($id)
40 39
    {
41
        $cateogryArtefacts = ArtefactCategory::where('category_id', $id)->get();
42
        if(count($cateogryArtefacts) > 0)
40
        $categoryArtefacts = ArtefactCategory::where('category_id', $id)->get();
41
        if(count($categoryArtefacts) > 0)
43 42
        {
44 43
            $artefacts = array();
45
            foreach($cateogryArtefacts as $ar)
44
            foreach($categoryArtefacts as $ar)
46 45
            {
47 46
                array_push($artefacts, Artefact::where('id', $ar->artefact_id)->get());
48 47
            }
......
58 57
     * Returns view of single artefact given by its id.
59 58
     *
60 59
     * @param $id int id of the artefact
61
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
60
     * @return Factory|View
62 61
     */
63 62
    public function view($id)
64 63
    {
......
73 72
     * Likes artefact given by its id.
74 73
     *
75 74
     * @param $id int id of metadata
76
     * @return \Illuminate\Http\RedirectResponse
75
     * @return RedirectResponse
77 76
     */
78 77
    public function like($id)
79 78
    {
......
89 88
     * Unlikes artefact given by its id.
90 89
     *
91 90
     * @param $id int id of metadata
92
     * @return \Illuminate\Http\RedirectResponse
91
     * @return RedirectResponse
93 92
     */
94 93
    public function unlike($id)
95 94
    {
app/Http/Controllers/FavoriteArtefactsController.php
2 2

  
3 3
namespace App\Http\Controllers;
4 4

  
5
use App\ArtefactUser;
5
use Illuminate\Contracts\Foundation\Application;
6
use Illuminate\Contracts\View\Factory;
6 7
use Illuminate\Support\Facades\Auth;
7 8
use App\User;
8 9
use App\Artefact;
9 10
use App\Http\Controllers\Image;
11
use Illuminate\View\View;
10 12

  
11 13
class FavoriteArtefactsController extends Controller
12 14
{
......
18 20
    /**
19 21
     * Display a listing of the resource.
20 22
     *
21
     * @return \Illuminate\Http\Response
23
     * @return Application|Factory|View
22 24
     */
23 25
    public function index()
24 26
    {
......
52 54
     * Display the specified resource.
53 55
     *
54 56
     * @param  int  $id
55
     * @return \Illuminate\Http\Response
57
     * @return Application|Factory|View
56 58
     */
57 59
    public function show($id)
58 60
    {
......
62 64
            $item['likes'] = Artefact::find($item->id)->users()->count();
63 65
        }
64 66

  
65

  
66 67
        $data = array(
67 68
            'title' => 'Favorite artefacts',
68 69
            'id' => $id,
resources/lang/cs/general.php
1
<?php
2

  
3
return [
4

  
5
    /*
6
    |--------------------------------------------------------------------------
7
    | Login Page Language Lines
8
    |--------------------------------------------------------------------------
9
    */
10

  
11
    'email' => 'e-mail',
12
    'password' => 'heslo',
13
    'join' => 'vstoupit',
14

  
15
    /*
16
    |--------------------------------------------------------------------------
17
    | Error Page Language Lines
18
    |--------------------------------------------------------------------------
19
    */
20

  
21
    'not_found' => 'Stránka nenalezena',
22
    'server_error' => 'Něco se pokazilo',
23

  
24
];
resources/lang/en/general.php
1
<?php
2

  
3
return [
4

  
5
    /*
6
    |--------------------------------------------------------------------------
7
    | General Language Lines
8
    |--------------------------------------------------------------------------
9
    */
10

  
11
    'kaplicky' => 'kaplicky',
12

  
13
    /*
14
    |--------------------------------------------------------------------------
15
    | Sidebar Language Lines
16
    |--------------------------------------------------------------------------
17
    */
18

  
19
    'cs' => 'česky',
20
    'en' => 'english',
21

  
22
    /*
23
    |--------------------------------------------------------------------------
24
    | Sidebar Language Lines
25
    |--------------------------------------------------------------------------
26
    */
27

  
28
    'home' => 'home',
29
    'login' => 'login',
30
    'register' => 'register',
31
    'topics' => 'topics',
32
    'artefacts' => 'books',
33
    'favourite_artefacts' => 'my books',
34
    'favourite_metadata' => 'my notes',
35
    'charts' => 'charts',
36

  
37
    /*
38
    |--------------------------------------------------------------------------
39
    | Login Page Language Lines
40
    |--------------------------------------------------------------------------
41
    */
42

  
43
    'email' => 'e-mail',
44
    'password' => 'password',
45
    'join' => 'join',
46

  
47
    /*
48
    |--------------------------------------------------------------------------
49
    | Error Page Language Lines
50
    |--------------------------------------------------------------------------
51
    */
52

  
53
    'not_found' => 'Not Found',
54
    'server_error' => 'Internal Server Error',
55

  
56
];
resources/views/auth/login.blade.php
22 22
                                    <label for="logo" class="col-md-4 kaplicky">{{ __('kaplicky') }}</label>
23 23

  
24 24
                                    <div class="form-group row">
25
                                        <label for="email"
26
                                               class="col-md-4 col-form-label text-md-right">{{ __('e-mail') }}</label>
25
                                        <label for="email" class="col-md-4 col-form-label text-md-right">
26
                                            {{ __('general.email') }}
27
                                        </label>
27 28

  
28 29
                                        <div class="col-md-6">
29 30
                                            <input id="email" type="email"
......
34 35
                                    </div>
35 36

  
36 37
                                    <div class="form-group row">
37
                                        <label for="password"
38
                                               class="col-md-4 col-form-label text-md-right">{{ __('password') }}</label>
38
                                        <label for="password" class="col-md-4 col-form-label text-md-right">
39
                                            {{ __('general.password') }}
40
                                        </label>
39 41

  
40 42
                                        <div class="col-md-6">
41 43
                                            <input id="password" type="password"
......
45 47
                                    </div>
46 48
                                    <div class="row">
47 49
                                        <div class="col-md-12">
48
                                            <button type="submit" class="btn button-square ">
49
                                                {{ __('join') }}
50
                                            <button type="submit" class="btn button-square">
51
                                                {{ __('general.join') }}
50 52
                                            </button>
51 53
                                            {{-- @if (Route::has('password.request'))
52 54
                                                <a class="btn btn-link" href="{{ route('password.request') }}">
......
70 72
                                                    </div>
71 73
                                                </div>
72 74
                                            </div>
75
                                        </div>
73 76
                                    @endif
74 77

  
75 78
                                </form>
resources/views/errors/404.blade.php
6 6
        <div class="container">
7 7
            <div class="row">
8 8
                <div class="col-sm-12">
9
                    <span class="error">404 | Not Found</span>
9
                    <span class="error">404 | {{ __('general.not_found') }}</span>
10 10
                </div>
11 11
            </div>
12 12
        </div>
resources/views/errors/500.blade.php
6 6
        <div class="container">
7 7
            <div class="row">
8 8
                <div class="col-sm-12">
9
                    <span class="error">500 | Internal Server Error</span>
9
                    <span class="error">500 | {{ __('general.server_error') }}</span>
10 10
                </div>
11 11
            </div>
12 12
        </div>
resources/views/inc/sidebar.blade.php
6 6
    <li class="nav-item"> &#160;</li>
7 7
    @guest
8 8
        <li class="nav-item">
9
            <a class="dropdown-item text-headline" href="{{ url('/') }}">{{ __('Home') }}</a>
10
            <a class="dropdown-item text-headline" href="{{ route('login') }}">{{ __('Login') }}</a>
9
            <a class="dropdown-item text-headline" href="{{ url('/') }}">
10
                {{ __('general.home') }}
11
            </a>
12
            <a class="dropdown-item text-headline" href="{{ route('login') }}">
13
                {{ __('general.login') }}
14
            </a>
11 15
        </li>
12 16
        @if (Route::has('register'))
13 17
            <li class="nav-item">
14
                <a class="dropdown-item text-headline" href="{{ route('register') }}">{{ __('Register') }}</a>
18
                <a class="dropdown-item text-headline" href="{{ route('register') }}">
19
                    {{ __('general.register') }}
20
                </a>
15 21
            </li>
16 22
        @endif
17 23
    @else
18 24
        <li class="nav-item dropdown">
19
            <a class="dropdown-item text-headline" href="{{ url('/') }}">home</a>
25
            <a class="dropdown-item text-headline" href="{{ url('/') }}">
26
                {{ __('general.home') }}
27
            </a>
20 28

  
21
            <a class="dropdown-item text-headline" href="{{ url('/categories') }}">topics</a>
29
            <a class="dropdown-item text-headline" href="{{ url('/categories') }}">
30
                {{ __('general.topics') }}
31
            </a>
22 32

  
23
            <a class="dropdown-item text-headline" href="{{ url('/artefact') }}">books</a>
33
            <a class="dropdown-item text-headline" href="{{ url('/artefact') }}">
34
                {{ __('general.artefacts') }}
35
            </a>
24 36

  
25
            <a class="dropdown-item text-headline" href="{{ url('/favartefacts') }}">my books</a>
37
            <a class="dropdown-item text-headline" href="{{ url('/favartefacts') }}">
38
                {{ __('general.favourite_artefacts') }}
39
            </a>
26 40

  
27
            <a class="dropdown-item text-headline" href="{{ url('/favmetadata') }}">my notes</a>
41
            <a class="dropdown-item text-headline" href="{{ url('/favmetadata') }}">
42
                {{ __('general.favourite_metadata') }}
43
            </a>
28 44

  
29
            <a class="dropdown-item text-headline" href="{{ url('/charts') }}">charts</a>
45
            <a class="dropdown-item text-headline" href="{{ url('/charts') }}">
46
                {{ __('general.charts') }}
47
            </a>
30 48

  
31 49
        </li>
32 50
        <li class="nav-item dropdown separator">
33
            <a class="dropdown-item text-headline" href="{{ url('/czech') }}">česky</a>
51
            <a class="dropdown-item text-headline" href="{{ url('/czech') }}">
52
                {{ __('general.cs') }}
53
            </a>
34 54
        </li>
35 55
        <li class="nav-item dropdown">
36
            <a class="dropdown-item text-headline" href="{{ route('logout') }}"
37
               onclick="event.preventDefault();
38
                                                     document.getElementById('logout-form').submit();">
56
            <a class="dropdown-item text-headline" href="{{ route('logout') }}" onclick="
57
            event.preventDefault();
58
            document.getElementById('logout-form').submit();">
39 59
                {{ __('logout') }}
40 60
            </a>
41 61

  
......
50 70
<nav class="navbar navbar-expand-md navbar-light black shadow-sm top-bar">
51 71
    <span class="arrow arrow-right" onclick="openNav()"></span>
52 72
    @if(!Request::is('login')&&!Request::is('register'))
53
        <a for="logo" class="logo-kaplicky kaplicky" href="{{ url('/') }}">{{ __('kaplicky') }}</a>
73
        <a for="logo" class="logo-kaplicky kaplicky" href="{{ url('/') }}">
74
            {{ __('general.kaplicky') }}
75
        </a>
54 76
    @endif
55 77
</nav>
56 78
{{--<label for="logo" class="col-md-12 kaplicky" style="display: inline-block; text-align: center; padding: 1.25rem; padding-bottom: 0">{{ __('kaplicky') }}</label>
......
67 89
        } else {
68 90
            document.getElementById("sidebar").style.width = "250px";
69 91
        }
70

  
71 92
    }
72 93

  
73 94
    function closeNav() {
74 95
        document.getElementById("sidebar").style.width = "0";
75 96
    }
76 97
</script>
98

  
77 99
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
78 100
<script>
79 101
    $(function () {

Také k dispozici: Unified diff