v0.10.14 - Fixed localstorage saving for the admin menu and added ResourceCategorySeeder.php
This commit is contained in:
parent
d280f6c7bc
commit
7a02f4a48f
|
@ -18,5 +18,6 @@ class DatabaseSeeder extends Seeder
|
||||||
$this->call(LocationSeeder::class);
|
$this->call(LocationSeeder::class);
|
||||||
$this->call(WashingMachineSeeder::class);
|
$this->call(WashingMachineSeeder::class);
|
||||||
$this->call(NewsTypeSeeder::class);
|
$this->call(NewsTypeSeeder::class);
|
||||||
|
$this->call(ResourceCategorySeeder::class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
|
class ResourceCategorySeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function run()
|
||||||
|
{
|
||||||
|
$categoryData = [
|
||||||
|
[
|
||||||
|
'name' => 'image',
|
||||||
|
'description' => '',
|
||||||
|
'slug' => '',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($categoryData as $data) {
|
||||||
|
$category = new \App\ResourceCategory();
|
||||||
|
|
||||||
|
$category->name = $data["name"];
|
||||||
|
$category->description = $data["description"];
|
||||||
|
$category->slug = $data["slug"];
|
||||||
|
|
||||||
|
$category->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,9 +6,8 @@
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||||
<script src="{{ asset("/js/jquery-3.2.1.min.js") }}"></script>
|
<script src="{{ asset("/js/jquery-3.2.1.min.js") }}"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
document.onreadystatechange = checkIfIShouldCollapse();
|
|
||||||
|
|
||||||
function openNav() {
|
function openNav() {
|
||||||
|
fixpls();
|
||||||
var open = document.getElementById("open");
|
var open = document.getElementById("open");
|
||||||
var close = document.getElementById("close");
|
var close = document.getElementById("close");
|
||||||
|
|
||||||
|
@ -32,6 +31,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeNav() {
|
function closeNav() {
|
||||||
|
if (localStorage.getItem("collapsed") !== "true")
|
||||||
|
fixpls();
|
||||||
|
|
||||||
var open = document.getElementById("open");
|
var open = document.getElementById("open");
|
||||||
var close = document.getElementById("close");
|
var close = document.getElementById("close");
|
||||||
|
|
||||||
|
@ -55,13 +57,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkIfIShouldCollapse() {
|
function checkIfIShouldCollapse() {
|
||||||
if (localStorage.getItem("collapsed") == "true" && document.readyState === "complete")
|
if (localStorage.getItem("collapsed") == "true" && document.readyState === "complete") {
|
||||||
closeNav();
|
closeNav();
|
||||||
|
fixpls();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<link type="text/css" rel="stylesheet" href="{{ mix("/css/admin.css") }}">
|
<link type="text/css" rel="stylesheet" href="{{ mix("/css/admin.css") }}">
|
||||||
</head>
|
</head>
|
||||||
<body onload="document.body.style.display='block';" style="display: none;">
|
<body>
|
||||||
@yield("header")
|
@yield("header")
|
||||||
<main class="row">
|
<main class="row">
|
||||||
<div class="col nav" style="background-color: #333333;">
|
<div class="col nav" style="background-color: #333333;">
|
||||||
|
@ -167,8 +171,10 @@
|
||||||
<script src="{{ mix("/js/app.js") }}"></script>
|
<script src="{{ mix("/js/app.js") }}"></script>
|
||||||
<script src="{{ asset("/js/jquery.are-you-sure.js") }}"></script>
|
<script src="{{ asset("/js/jquery.are-you-sure.js") }}"></script>
|
||||||
<script>
|
<script>
|
||||||
|
function fixpls() {
|
||||||
document.getElementsByClassName("nav")[0].style.transition = "width .5s";
|
document.getElementsByClassName("nav")[0].style.transition = "width .5s";
|
||||||
document.getElementsByClassName("w-85")[0].style.transition = "width .5s";
|
document.getElementsByClassName("w-85")[0].style.transition = "width .5s";
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
@yield("scripts")
|
@yield("scripts")
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Reference in New Issue