Revize fb354d59
Přidáno uživatelem Jiří Noháč před téměř 5 roky(ů)
app/Http/Controllers/ArtefactController.php | ||
---|---|---|
3 | 3 |
namespace App\Http\Controllers; |
4 | 4 |
|
5 | 5 |
use App\Artefact; |
6 |
use App\ArtefactCategory; |
|
7 |
use App\Category; |
|
6 | 8 |
use Illuminate\Http\Request; |
7 | 9 |
use Illuminate\Support\Facades\DB; |
8 | 10 |
|
... | ... | |
25 | 27 |
return view('artefact.default', ['artefacts' => $artefacts]); |
26 | 28 |
} |
27 | 29 |
|
30 |
/** |
|
31 |
* Returns view of artefacts related to the chosen category |
|
32 |
* |
|
33 |
* @param $id id of the category |
|
34 |
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
|
35 |
*/ |
|
36 |
public function showCategory($id) |
|
37 |
{ |
|
38 |
$cateogryArtefacts = ArtefactCategory::where('category_id', $id)->get(); |
|
39 |
if(count($cateogryArtefacts) > 0) |
|
40 |
{ |
|
41 |
$artefacts = array(); |
|
42 |
foreach($cateogryArtefacts as $ar) |
|
43 |
{ |
|
44 |
array_push($artefacts, Artefact::where('id', $ar->artefact_id)->get()); |
|
45 |
} |
|
46 |
return view('artefact.category', ['artefacts' => $artefacts]); |
|
47 |
} |
|
48 |
else |
|
49 |
{ |
|
50 |
return view('artefact.category', ['artefacts' => array()]); |
|
51 |
} |
|
52 |
} |
|
53 |
|
|
28 | 54 |
/** |
29 | 55 |
* Returns view of single artefact given by its id. |
30 | 56 |
* |
Také k dispozici: Unified diff
Issue #7957 @3h
Issue #7957 @3h
Opraveni prekryti tlacitek. Opraveni rozdeleni tlacitek po 6 do novych "rows". Odstraneni tlacitka "Enter" a pridani po stisknuti na konkretni kategorii zobrazeni vsech artefaktu prirazenych do konkretni kategorie.