Projekt

Obecné

Profil

« Předchozí | Další » 

Revize f49916cc

Přidáno uživatelem Marek Zábran před asi 4 roky(ů)

Opravené charts. Rychlé a s highlightem na active u textu.

Zobrazit rozdíly:

app/Http/Controllers/ChartsController.php
26 26
    {
27 27
        if(Auth::check())
28 28
        {
29
            $artefacts = Artefact::all();
30
            //$user_likes = User::find(Auth::id())->likesArtefacts();
29
            $artefacts = Artefact::withCount('users')->orderByDesc('users_count')->get()->take(10);
31 30
            foreach($artefacts as $item)
32 31
            {
33 32
                $id = $item->id;
34 33
                $item['likes'] = Artefact::find($id)->users()->count();
35 34
                $item['favourite'] = is_null(User::find(Auth::id())->likesArtefacts()->find($id)) ? false : true;
36 35
            }
37
            //$artefacts->keyBy('id');
38
            /*$selected = [];
39
            for($i=0;$i<10;$i++){
40
                $max = $artefacts->where('likes', $artefacts->max('likes'));
41
                $selected[$i] = $max->first();
42
                $artefacts->forget($max->keys()->first());
43
            }
44
            $artefacts=$selected;*/
45
            $artefacts=$artefacts->sortByDesc('likes')->take(10);
46 36

  
47 37
            $data = array(
48 38
                'title' => 'Charts',
resources/sass/_custom.scss
144 144
        color: $theme-color-four;
145 145
    }
146 146

  
147
    .highlight-white, .highlight-white{
148
        &:hover, &:focus, &:active{
149
            color: $theme-color-one;
150
        }
151
    }
152

  
147 153

  
148 154
    ////login
149 155
    .auth {
resources/views/charts/index.blade.php
12 12
                @foreach($artefacts as $artefact)
13 13
                    <div class="artefacts-area mb-5">
14 14
                        <div class="card">
15
                            <a href="{{ url('/artefact/' . $artefact->id) }}">
16

  
17
                            </a>
18 15
                            <div class="container card-cus-bottom">
19 16
                                <div class="d-flex flex-row row-list">
20 17
                                    <div class="p-1 flex-fill bd-highlight left_panel_info">
21 18
                                        <a href="{{ url('/artefact/' . $artefact->id) }}">
22
                                            <h5 class="card-title ">{{$artefact->name}}</h5>
23
                                            <h6 class="card-title">{{$artefact->author}}</h6>
19
                                            <h5 class="card-title highlight-white">{{$artefact->name}}</h5>
24 20
                                        </a>
21
                                        <h6 class="card-title ">{{$artefact->author}}</h6>
22

  
25 23
                                    </div>
26 24
                                    <div class="p-1 flex-fill bd-highlight float-center">
27 25
                                        <div class="text-center right_panel_info">

Také k dispozici: Unified diff