Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
1b7738fd09
skolehjem
app
Http/Controllers
ContactController.phpGuideController.phpLocationController.phpNewsController.phpUserController.phpWashingMachineController.phpWashingReservationController.php
Location.phpNews.phpWashingMachine.phpdatabase
migrations
2020_06_07_121607_create_locations_table.php2020_06_08_073954_create_washing_machines.php2020_08_06_092000_create_news_table.php
seeds
resources/views
admin
contacts
events
layout
locations
create.blade.phpdelete.blade.phpedit.blade.phpindex.blade.phpshow.blade.phpstore.blade.phpupdate.blade.php
news
users
washing-machines
app
contacts
feedbacks
news
root
users
washing-reservations
routes
|
@ -57,7 +57,7 @@ class ContactController extends Controller
|
|||
"contactname" => "required|max:255",
|
||||
"title" => "required|max:255",
|
||||
"email" => "required|max:255",
|
||||
"phone" => "required|max:255",
|
||||
"phone" => "max:255",
|
||||
]);
|
||||
|
||||
$contact = new Contact($requestContact);
|
||||
|
|
|
@ -9,18 +9,18 @@ use Illuminate\Http\Request;
|
|||
class GuideController extends Controller
|
||||
{
|
||||
|
||||
/*
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware([ "auth" ]);
|
||||
|
||||
$this->middleware([ "check.auth:contact.list" ])->only("index");
|
||||
$this->middleware([ "check.auth:contact.show" ])->only("show");
|
||||
$this->middleware([ "check.auth:contact.create" ])->only("create", "store");
|
||||
$this->middleware([ "check.auth:contact.edit" ])->only("edit", "update");
|
||||
$this->middleware([ "check.auth:contact.delete" ])->only("delete");
|
||||
$this->middleware([ "check.auth:guides.list" ])->only("index");
|
||||
$this->middleware([ "check.auth:guides.show" ])->only("show");
|
||||
$this->middleware([ "check.auth:guides.create" ])->only("create", "store");
|
||||
$this->middleware([ "check.auth:guides.edit" ])->only("edit", "update");
|
||||
$this->middleware([ "check.auth:guides.delete" ])->only("delete");
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,133 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Location;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class LocationController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware([ "auth" ]);
|
||||
|
||||
$this->middleware([ "check.auth:locations.list" ])->only("index");
|
||||
$this->middleware([ "check.auth:locations.show" ])->only("show");
|
||||
$this->middleware([ "check.auth:locations.create" ])->only("create", "store");
|
||||
$this->middleware([ "check.auth:locations.edit" ])->only("edit", "update");
|
||||
$this->middleware([ "check.auth:locations.delete" ])->only("delete");
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @param Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$locations = Location::query()->paginate($request->input("limit", 20));
|
||||
|
||||
return Response::detect("locations.index", [ "locations" => $locations ]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return Response::detect("locations.create");
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$data = $request->validate([
|
||||
"name" => "required",
|
||||
]);
|
||||
|
||||
$location = new Location($data);
|
||||
|
||||
$locations = Location::query()->where('name', '=', $request->name)->get();
|
||||
|
||||
// If there already is a washing machine with that name, then don't add it
|
||||
if (count($locations) > 0)
|
||||
return redirect()->route("locations.store")->with('NameExists', '<p><b>Der findes allerede en lokation med det navn!</b></p>');
|
||||
else { // Else - Add it
|
||||
$location->save();
|
||||
$locations = Location::query()->paginate($request->input("limit", 20));
|
||||
return redirect()->route("locations.index", ['locations' => $locations]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Location $location
|
||||
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function show(Location $location)
|
||||
{
|
||||
return view("admin.locations.show", [ "location" => $location]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Location $location
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(Location $location)
|
||||
{
|
||||
return Response::detect("locations.edit", [ "location" => $location] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Location $location
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$data = $request->validate([
|
||||
"name" => "required",
|
||||
]);
|
||||
|
||||
$location = Location::find($id);
|
||||
|
||||
|
||||
$allMachines = Location::query()->where('name', '=', $request->name)->where('id', '!=', $id)->get();
|
||||
|
||||
// If there already is a washing machine with that name, then don't change it
|
||||
if (count($allMachines) > 0)
|
||||
return redirect()->route("locations.store")->with('NameExists', '<p><b>Der findes allerede en lokation med det navn!</b></p>');
|
||||
else { // Else - Change the name
|
||||
$location->update($data);
|
||||
$location->save();
|
||||
|
||||
$locations = Location::query()->paginate($request->input("limit", 20));
|
||||
return redirect()->route("locations.index", ["locations" => $locations]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Location $location
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Location $location)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,116 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\News;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class NewsController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware([ "auth" ]);
|
||||
|
||||
$this->middleware([ "check.auth:news.list" ])->only("index");
|
||||
$this->middleware([ "check.auth:news.show" ])->only("show");
|
||||
$this->middleware([ "check.auth:news.create" ])->only("create", "store");
|
||||
$this->middleware([ "check.auth:news.edit" ])->only("edit", "update");
|
||||
$this->middleware([ "check.auth:news.delete" ])->only("delete");
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$news = News::query()->paginate($request->input("limit", 20));
|
||||
|
||||
return Response::detect("news.index", [ "news" => $news ]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return Response::detect("news.create");
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$data = $request->validate([
|
||||
"name" => "required",
|
||||
"content" => "required"
|
||||
]);
|
||||
|
||||
$news = new News($data);
|
||||
$news->save();
|
||||
|
||||
return redirect()->route("news.index");
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\News $news
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(News $news)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\News $news
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(News $news)
|
||||
{
|
||||
return Response::detect("news.edit", [ "news" => $news ]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\News $news
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function update(Request $request, News $news)
|
||||
{
|
||||
$data = $request->validate([
|
||||
"name" => "required",
|
||||
"content" => "required"
|
||||
]);
|
||||
|
||||
$news->update($data);
|
||||
|
||||
return redirect()->route("news.index");
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\News $news
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function destroy(News $news)
|
||||
{
|
||||
$news->delete();
|
||||
return redirect()->route("news.index");
|
||||
}
|
||||
}
|
|
@ -53,7 +53,6 @@ class UserController extends Controller
|
|||
{
|
||||
$roles = Role::all();
|
||||
return Response::detect("users.create", ['roles' => $roles]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -169,9 +168,7 @@ class UserController extends Controller
|
|||
}
|
||||
$users = User::query()->paginate(20);
|
||||
|
||||
return Response::detect("users.index", [
|
||||
"users" => $users
|
||||
]);
|
||||
return redirect()->route("users.index");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -309,9 +306,7 @@ class UserController extends Controller
|
|||
}
|
||||
$users = User::query()->paginate(20);
|
||||
|
||||
return Response::detect("users.index", [
|
||||
"users" => $users
|
||||
]);
|
||||
return redirect()->route("users.index");
|
||||
}
|
||||
|
||||
public function search(Request $request){
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Location;
|
||||
use App\WashingReservation;
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
|
@ -44,7 +45,9 @@ class WashingMachineController extends Controller
|
|||
*/
|
||||
public function create()
|
||||
{
|
||||
return Response::detect("washing-machines.create");
|
||||
$locations = Location::all();
|
||||
|
||||
return Response::detect("washing-machines.create", ["locations" => $locations] );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -56,12 +59,13 @@ class WashingMachineController extends Controller
|
|||
public function store(Request $request)
|
||||
{
|
||||
$data = $request->validate([
|
||||
"name" => "required"
|
||||
"name" => "required",
|
||||
"location_id" => "required"
|
||||
]);
|
||||
|
||||
$machine = new WashingMachine($data);
|
||||
|
||||
$allMachines = WashingMachine::query()->where('name', '=', $request->name)->get();
|
||||
$allMachines = WashingMachine::query()->where('name', '=', $request->name)->where('location_id', "=", $request->location_id)->get();
|
||||
|
||||
// If there already is a washing machine with that name, then don't add it
|
||||
if (count($allMachines) > 0)
|
||||
|
@ -81,11 +85,7 @@ class WashingMachineController extends Controller
|
|||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$machine = WashingMachine::find($id);
|
||||
|
||||
return Response::detect("washing-machines.show", [
|
||||
"machine" => $machine
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -97,9 +97,11 @@ class WashingMachineController extends Controller
|
|||
public function edit($id)
|
||||
{
|
||||
$machine = WashingMachine::find($id);
|
||||
$locations = Location::all();
|
||||
|
||||
return Response::detect("washing-machines.edit", [
|
||||
"machine" => $machine
|
||||
"machine" => $machine,
|
||||
"locations" => $locations
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -113,13 +115,14 @@ class WashingMachineController extends Controller
|
|||
public function update(Request $request, $id)
|
||||
{
|
||||
$data = $request->validate([
|
||||
"name" => "required"
|
||||
"name" => "required",
|
||||
"location_id" => "required",
|
||||
]);
|
||||
|
||||
$machine = WashingMachine::find($id);
|
||||
|
||||
|
||||
$allMachines = WashingMachine::query()->where('name', '=', $request->name)->where('id', '!=', $id)->get();
|
||||
$allMachines = WashingMachine::query()->where('name', '=', $request->name)->where('location_id', "=", $request->location_id)->where('id', '!=', $id)->get();
|
||||
|
||||
// If there already is a washing machine with that name, then don't change it
|
||||
if (count($allMachines) > 0)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Location;
|
||||
use App\WashingMachine;
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
|
@ -103,10 +104,7 @@ class WashingReservationController extends Controller
|
|||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$reservation = WashingReservation::query()->find($id);
|
||||
$machines = WashingMachine::all();
|
||||
|
||||
return Response::detect("washing-reservations.edit", ['washing_reservation' => $reservation, 'machines' => $machines ]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -118,26 +116,7 @@ class WashingReservationController extends Controller
|
|||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$data = $request->validate([
|
||||
"time" => "required",
|
||||
"machine" => "required"
|
||||
]);
|
||||
|
||||
$machineReservation = WashingReservation::find($id);
|
||||
|
||||
$machineReservation->update($data);
|
||||
|
||||
$saved = $machineReservation->save();
|
||||
|
||||
if(!$saved){
|
||||
return Response::detect("washing-reservations.update", [
|
||||
"washing_reservation" => $machineReservation
|
||||
]);
|
||||
}else{
|
||||
$reservations = WashingReservation::query()->paginate($request->query("limit", 20));
|
||||
|
||||
return Response::detect("washing-reservations.index", [ "reservations" => $reservations]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -164,10 +143,13 @@ class WashingReservationController extends Controller
|
|||
$date = $request->date;
|
||||
$datetext = $request->datetext;
|
||||
|
||||
$machines = WashingMachine::all();
|
||||
if($request->location_id == 0)
|
||||
$request->location_id = Location::all()->first()->id;
|
||||
|
||||
$machines = WashingMachine::query()->where("location_id", "=", $request->location_id)->orderBy("name", "asc")->get();
|
||||
|
||||
if($request->machine_id == 0)
|
||||
$request->machine_id = WashingMachine::all()->first()->id;
|
||||
$request->machine_id = WashingMachine::query()->orderBy("name", "asc")->first()->id;
|
||||
|
||||
$reservations = WashingReservation::query()->where("machine_id", "=", $request->machine_id)->where("time", "LIKE", $datetext."%")->get();
|
||||
|
||||
|
@ -177,7 +159,9 @@ class WashingReservationController extends Controller
|
|||
array_push($times, $reservation->time);
|
||||
}
|
||||
|
||||
$output = json_encode(['date' => $date, 'washingmachines' => $machines, 'unavailable_times' => $times ]);
|
||||
$locations = Location::query()->orderBy("name", "asc")->get();
|
||||
|
||||
$output = json_encode(['date' => $date, 'washingmachines' => $machines, 'unavailable_times' => $times, "locations" => $locations ]);
|
||||
return Response($output);
|
||||
}
|
||||
}
|
||||
|
@ -246,4 +230,3 @@ class WashingReservationController extends Controller
|
|||
return Response::detect("washing-reservations.index", [ "reservations" => $reservations]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Location extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'name'
|
||||
];
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class News extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'name', 'content'
|
||||
];
|
||||
}
|
|
@ -14,6 +14,6 @@ class WashingMachine extends Model
|
|||
{
|
||||
//protected variable which contains name of database field(s) to be filled.
|
||||
protected $fillable = [
|
||||
'name'
|
||||
'name', 'location_id'
|
||||
];
|
||||
}
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateLocationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('locations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string("name")->unique();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('locations');
|
||||
}
|
||||
}
|
|
@ -17,8 +17,11 @@ class CreateWashingMachines extends Migration
|
|||
{
|
||||
Schema::create('washing_machines', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string("name")->unique();
|
||||
$table->string("name");
|
||||
|
||||
$table->foreignId("location_id")->constrained("locations", "id");
|
||||
$table->timestamps();
|
||||
$table->unique(['name', 'location_id']);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateNewsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('news', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string("name");
|
||||
$table->text("content");
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('news');
|
||||
}
|
||||
}
|
|
@ -30,28 +30,28 @@ class ContactSeeder extends Seeder
|
|||
'contactname' => "Thomas Thomsen",
|
||||
'email' => "thth@sde.dk",
|
||||
'title' => "Kollegieassistent",
|
||||
'phone' => "24629450",
|
||||
'phone' => "",
|
||||
'phonetimes' => "",
|
||||
],
|
||||
[
|
||||
'contactname' => "Anja Holm Brix",
|
||||
'email' => "ahb@sde.dk",
|
||||
'title' => "Kollegieassistent",
|
||||
'phone' => "24629450",
|
||||
'phone' => "",
|
||||
'phonetimes' => "",
|
||||
],
|
||||
[
|
||||
'contactname' => "Britta Overgaard Brink Olsen",
|
||||
'email' => "brio@sde.dk",
|
||||
'title' => "Kollegieassistent",
|
||||
'phone' => "24629450",
|
||||
'phone' => "",
|
||||
'phonetimes' => "",
|
||||
],
|
||||
[
|
||||
'contactname' => "Jesper Sandberg",
|
||||
'email' => "jesa@sde.dk",
|
||||
'title' => "Kollegieassistent",
|
||||
'phone' => "24629450",
|
||||
'phone' => "",
|
||||
'phonetimes' => "",
|
||||
],
|
||||
];
|
||||
|
|
|
@ -15,5 +15,6 @@ class DatabaseSeeder extends Seeder
|
|||
$this->call(RoleSeeder::class);
|
||||
$this->call(UserSeeder::class);
|
||||
$this->call(ContactSeeder::class);
|
||||
$this->call(LocationSeeder::class);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class LocationSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$locationdata = [
|
||||
[
|
||||
"name" => "Bygning B"
|
||||
],
|
||||
[
|
||||
"name" => "Bygning E"
|
||||
]
|
||||
];
|
||||
|
||||
foreach ($locationdata as $data) {
|
||||
$location = new \App\Location();
|
||||
|
||||
$location->name = $data["name"];
|
||||
|
||||
$location->save();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -25,7 +25,7 @@ class PermissionSeeder extends Seeder
|
|||
"ownuser.edit" => "Allows editing of your own user",
|
||||
|
||||
/**
|
||||
* The CALENDAR specific permissions
|
||||
* The CALENDAR specific permissions //TODO: Do we use them?
|
||||
*/
|
||||
"calendar.create" => "Create a new event.",
|
||||
"calendar.list" => "Shows all events.",
|
||||
|
@ -51,63 +51,118 @@ class PermissionSeeder extends Seeder
|
|||
"event.edit" => "Allows editing of events",
|
||||
"event.delete" => "Allows deletion of events",
|
||||
|
||||
/**
|
||||
* The CONTACT specific permissions
|
||||
*/
|
||||
"contact.create" => "Creates a new contact",
|
||||
"contact.list" => "Shows all contacts",
|
||||
"contact.show" => "Shows a specific contact",
|
||||
"contact.edit" => "allows editing of contacts",
|
||||
"contact.delete" => "Allows deletion of contacts",
|
||||
|
||||
/**
|
||||
* The FEEDBACK specific permissions
|
||||
*/
|
||||
"feedback.create" => "Creates a new feedback message",
|
||||
"feedback.list" => "Shows all feedback messages",
|
||||
"feedback.show" => "Shows a specific feedback message",
|
||||
"feedback.edit" => "allows editing of feedback messages",
|
||||
"feedback.delete" => "allows deletion of feedback messages",
|
||||
|
||||
/**
|
||||
* The MENUPLAN specific permissions
|
||||
*/
|
||||
"menuplan.create" => "Create a new menuplan",
|
||||
"menuplan.list" => "Shows all menuplans",
|
||||
"menuplan.show" => "Shows a specific menuplan",
|
||||
"menuplan.edit" => "Allows editing of menuplans",
|
||||
"menuplan.delete" => "Allows deletion of menuplans",
|
||||
|
||||
/**
|
||||
* The RESOURCE CATEGORY specific permissions
|
||||
*/
|
||||
"resource.category.create" => "Create a new resource category",
|
||||
"resource.category.list" => "Shows all resource categories",
|
||||
"resource.category.show" => "Shows a specific resource category",
|
||||
"resource.category.edit" => "Allows editing of resource categories",
|
||||
"resource.category.delete" => "Allows deletion of resource categories",
|
||||
|
||||
/**
|
||||
* The RESOURCE EXTENSION specific permissions
|
||||
*/
|
||||
"resource.extension.create" => "Create a new resource extension",
|
||||
"resource.extension.list" => "Shows all resource extensions",
|
||||
"resource.extension.show" => "Shows a specific resource extension",
|
||||
"resource.extension.edit" => "Allows editing of resource extensions",
|
||||
"resource.extension.delete" => "Allows deletion of resource extensions",
|
||||
|
||||
/**
|
||||
* The RESOURCE specific permissions
|
||||
*/
|
||||
"resource.create" => "Create a new resource",
|
||||
"resource.list" => "Shows all resources",
|
||||
"resource.show" => "Shows a specific resource",
|
||||
"resource.edit" => "Allows editing of resources",
|
||||
"resource.delete" => "Allows deletion of resources",
|
||||
|
||||
/**
|
||||
* The WASHING MACHINE specific permissions
|
||||
*/
|
||||
"washing.machine.create" => "Create a new washing machine",
|
||||
"washing.machine.list" => "Shows all washing machines",
|
||||
"washing.machine.show" => "Shows a specific washing machine",
|
||||
"washing.machine.edit" => "Allows editing of washing machines",
|
||||
"washing.machine.delete" => "Allows deletion of washing machines",
|
||||
|
||||
/**
|
||||
* The WASHING MACHINE RESERVATION specific permissions
|
||||
*/
|
||||
"washing.machine.reservation.create" => "Create a new washing machine reservation",
|
||||
"washing.machine.reservation.list" => "Shows all washing machine reservations",
|
||||
"washing.machine.reservation.show" => "Shows a specific washing machine reservation",
|
||||
"washing.machine.reservation.edit" => "Allows editing of washing machine reservations",
|
||||
"washing.machine.reservation.delete" => "Allows deletion of washing machine reservations",
|
||||
|
||||
/**
|
||||
* The ROLES specific permissions
|
||||
*/
|
||||
"roles.create" => "Create a new role",
|
||||
"roles.list" => "Shows all roles",
|
||||
"roles.show" => "Shows a specific role",
|
||||
"roles.edit" => "Allows editing of roles",
|
||||
"roles.delete" => "Allows deletion of roles",
|
||||
|
||||
//Allows access to the admin panel
|
||||
"admin.panel.show" => "Allows access to administration panel",
|
||||
/**
|
||||
* The GUIDE specific permissions
|
||||
*/
|
||||
"guides.create" => "Create a new guide",
|
||||
"guides.list" => "Shows all guides",
|
||||
"guides.show" => "Shows a specific guide",
|
||||
"guides.edit" => "Allows editing of guides",
|
||||
"guides.delete" => "Allows deletion of guides",
|
||||
|
||||
/**
|
||||
* The LOCATION specific permissions
|
||||
*/
|
||||
"locations.create" => "Create a new location",
|
||||
"locations.list" => "Shows all locations",
|
||||
"locations.show" => "Shows a specific location",
|
||||
"locations.edit" => "Allows editing of locations",
|
||||
"locations.delete" => "Allows deletion of locations",
|
||||
|
||||
/**
|
||||
* The NEWS specific permissions
|
||||
*/
|
||||
"news.create" => "Create a new location",
|
||||
"news.list" => "Shows all locations",
|
||||
"news.show" => "Shows a specific location",
|
||||
"news.edit" => "Allows editing of locations",
|
||||
"news.delete" => "Allows deletion of locations",
|
||||
|
||||
/**
|
||||
* The ADMIN PANEL specific permissions
|
||||
*/
|
||||
"admin.panel.show" => "Allows access to administration panel",
|
||||
];
|
||||
|
||||
foreach ($permissions as $key => $value) {
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<label for="email">Email:</label>
|
||||
<input type="email" name="email" id="email" placeholder="x@y.z" required>
|
||||
<label for="tel">Telefon nr:</label>
|
||||
<input type="tel" name="phone" id="tel" placeholder="12345678" pattern="[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}" required>
|
||||
<input type="tel" name="phone" id="tel" placeholder="12345678" pattern="[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}">
|
||||
<label for="teltimes">Telefon tider: (Forblives blank, hvis der ikke er nogen bestemte tider) - Brug Shift+Enter for at teksten vises lige neden under hinanden på hjemmesiden</label>
|
||||
<textarea name="phonetimes" id="editor"></textarea>
|
||||
<input type="submit" class="btn btn-dark text-white" value="Opret">
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<label for="email">Email:</label>
|
||||
<input type="email" name="email" id="email" placeholder="x@y.z" value="{{ $contact->email }}" required>
|
||||
<label for="tel">Telefon nr:</label>
|
||||
<input type="tel" name="phone" id="tel" placeholder="12345678" value="{{ $contact->phone }}" pattern="[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}" required>
|
||||
<input type="tel" name="phone" id="tel" placeholder="12345678" value="{{ $contact->phone }}" pattern="[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{2}">
|
||||
<label for="teltimes">Telefon tider: (Forblives blank, hvis der ikke er nogen bestemte tider) - Brug Shift+Enter for at teksten vises lige neden under hinanden på hjemmesiden</label>
|
||||
<textarea name="phonetimes" id="editor">{{ $contact->phonetimes }}</textarea>
|
||||
<input type="submit" class="btn btn-dark text-white" value="Rediger">
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<th>Event Navn</th>
|
||||
<th>Event Ansvarlig</th>
|
||||
<th>Event Dato</th>
|
||||
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/eye.svg') }}" alt="Update"></th>
|
||||
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/eye.svg') }}" alt="Show"></th>
|
||||
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
|
||||
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
|
||||
</tr>
|
||||
|
@ -34,7 +34,7 @@
|
|||
<td>{{ $event->name }}</td>
|
||||
<td>{{ $event->accountable }}</td>
|
||||
<td>{{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($event->date))->format('d/m/Y \k\l\. H:i') }}</td>
|
||||
<td><a href="{{ route("events.signups", [ "event" => $event ]) }}"><img class="w-100" src="{{ asset('/images/icons/eye-dark.svg') }}" alt="Update"></a></td>
|
||||
<td><a href="{{ route("events.signups", [ "event" => $event ]) }}"><img class="w-100" src="{{ asset('/images/icons/eye-dark.svg') }}" alt="Show"></a></td>
|
||||
<td><a href="{{ route("events.edit", [ "event" => $event ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
||||
<td><form method="post" action="{{ route("events.destroy", [ "event" => $event ]) }}" class="w-100 nostyle">
|
||||
@csrf
|
||||
|
|
|
@ -17,12 +17,18 @@
|
|||
<div class="segment">
|
||||
<h3 class="text-white"><a href="{{ route("roles.index") }}" class="text-white"><i class="fa fa-link"></i><span style="margin-left: 4px;">Roller</span></a></h3>
|
||||
</div>
|
||||
<div class="segment">
|
||||
<h3 class="text-white"><a href="{{ route("news.index")}}" class="text-white"><i class="fa fa-link"></i><span style="margin-left: 4px;">Nyheder</span></a></h3>
|
||||
</div>
|
||||
<div class="segment">
|
||||
<h3 class="text-white"><a href="{{ route("menu-plans.index")}}" class="text-white"><i class="fa fa-link"></i><span style="margin-left: 4px;">Menuplan</span></a></h3>
|
||||
</div>
|
||||
<div class="segment">
|
||||
<h3 class="text-white"><a href="{{ route("events.index") }}" class="text-white"><i class="fa fa-link"></i><span style="margin-left: 4px;">Aktiviteter</span></a></h3>
|
||||
</div>
|
||||
<div class="segment">
|
||||
<h3 class="text-white"><a href="{{ route("locations.index") }}" class="text-white"><i class="fa fa-link"></i><span style="margin-left: 4px;">Lokationer</span></a></h3>
|
||||
</div>
|
||||
<div class="segment">
|
||||
<h3 class="text-white"><a href="{{ route("washing-machines.index") }}" class="text-white"><i class="fa fa-link"></i><span style="margin-left: 4px;">Vaskemaskiner</span></a></h3>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
@extends("admin.layout.base")
|
||||
@extends("admin.layout.header")
|
||||
|
||||
@section("title")
|
||||
Opret Lokation
|
||||
@endsection
|
||||
|
||||
@section("path")
|
||||
<a href="{{ route('locations.create') }}" class="text-white">Opret Lokation</a> /
|
||||
@endsection
|
||||
|
||||
@section("content")
|
||||
<h1>Opret Lokation</h1>
|
||||
<form method="post" action="{{ route("locations.store") }}">
|
||||
@csrf
|
||||
<label for="name">Lokationsnavn:</label>
|
||||
<input type="text" name="name" id="name" placeholder="Bygning A" required>
|
||||
<input type="submit" class="btn btn-dark text-white" value="Opret">
|
||||
</form>
|
||||
@endsection
|
|
@ -0,0 +1,13 @@
|
|||
@extends("admin.layout.base")
|
||||
@extends("admin.layout.header")
|
||||
|
||||
@section("title")
|
||||
Vejledning - Fjern
|
||||
@endsection
|
||||
|
||||
@section("path")
|
||||
<a href="{{ route('guides.delete') }}" class="text-white">Fjern Guide</a> /
|
||||
@endsection
|
||||
|
||||
@section("content")
|
||||
@endsection
|
|
@ -0,0 +1,21 @@
|
|||
@extends("admin.layout.base")
|
||||
@extends("admin.layout.header")
|
||||
|
||||
@section("title")
|
||||
Lokation - Rediger
|
||||
@endsection
|
||||
|
||||
@section("path")
|
||||
<a href="{{route('locations.edit', ['location' => $location ])}}" class="text-white">Rediger lokation</a> /
|
||||
@endsection
|
||||
|
||||
@section("content")
|
||||
<h1>Rediger Lokation</h1>
|
||||
<form method="post" action="{{ route("locations.update", ['location' => $location ]) }}">
|
||||
@csrf
|
||||
@method("put")
|
||||
<label for="name">Lokationsnavn:</label>
|
||||
<input type="text" name="name" id="name" value="{{ $location->name }}" required>
|
||||
<input type="submit" class="btn btn-dark text-white" value="Rediger">
|
||||
</form>
|
||||
@endsection
|
|
@ -0,0 +1,40 @@
|
|||
@extends("admin.layout.base")
|
||||
@extends("admin.layout.header")
|
||||
|
||||
@section("title")
|
||||
Vis Lokationer
|
||||
@endsection
|
||||
|
||||
@section("path")
|
||||
<a href="{{ route('locations.index') }}" class="text-white">Vis lokationer</a> /
|
||||
@endsection
|
||||
|
||||
@section("content")
|
||||
<div class="row align-items-center">
|
||||
<a class="btn btn-inline btn-sde-blue mb-0" href="{{ route('locations.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Lokation</a>
|
||||
</div>
|
||||
<table class="tbl mt-2">
|
||||
<tr>
|
||||
<th>Navn</th>
|
||||
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/eye.svg') }}" alt="Show"></th>
|
||||
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
|
||||
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
|
||||
</tr>
|
||||
@foreach($locations as $location)
|
||||
<tr>
|
||||
<td>{{$location->name}}</td>
|
||||
<td><a href="{{ route("locations.show", [ "location" => $location ]) }}"><img class="w-100" src="{{ asset('/images/icons/eye-dark.svg') }}" alt="Show"></a></td>
|
||||
<td><a href="{{ route("locations.edit", [ "location" => $location ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
||||
<td><form method="post" action="{{ route("locations.destroy", [ "location" => $location ]) }}" class="w-100 nostyle">
|
||||
@csrf
|
||||
@method("delete")
|
||||
|
||||
<button onclick="return confirm('Are you sure you want to delete?');" class="w-100 nostyle" type="submit"><img class="w-100 cursor-pointer" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
|
||||
{{ $locations->links() }}
|
||||
@endsection
|
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>@yield("title")</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link type="text/css" rel="stylesheet" href="{{ mix("/css/admin.css") }}">
|
||||
<script src="http://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header class="row align-items-center" style="background-color: #00788a;">
|
||||
<img src="{{ URL::asset('/images/logos/Logo-hvid.svg') }}" class="brand" alt="Syddansk Erhvervsskole">
|
||||
<p class="text-white" style="margin-left: auto; padding-right: 24px; font-size: 1vw;">Lokation: {{ $location->name }}</p>
|
||||
</header>
|
||||
<main style="min-height: calc(100% - 72px); background-color: #ffffff;">
|
||||
<?php $i = 1; ?>
|
||||
<div class="row">
|
||||
@foreach(\App\WashingMachine::query()->where("location_id", "=", $location->id)->get() as $machine)
|
||||
@foreach(\App\WashingReservation::query()->where("machine_id", "=", $machine->id)->where("time", "LIKE", date("Y-m-d"). "%")->orderBy("time", "asc")->get() as $reservation)
|
||||
@if($i % 3 == 1)
|
||||
</div>
|
||||
<div class="row w-100">
|
||||
@endif
|
||||
<div class="reservation col align-items-center" style="margin: 0 32px 1.75rem 32px; width: calc(33% - 64px);">
|
||||
<h2 style="font-size: 2vw">{{ \App\WashingMachine::query()->find($reservation->machine_id)->name }}</h2>
|
||||
<div class="col align-items-center">
|
||||
<span style="font-size: 1vw"><b>Dato:</b> {{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($reservation->time))->format('d/m/Y') }}</span>
|
||||
<span style="font-size: 2vw"><b>Tid:</b> {{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($reservation->time))->format('\k\l\. H:i') }} - {{ \App\User::query()->where("id", "=", $reservation->user_id)->first()->name_first }} {{ \App\User::query()->where("id", "=", $reservation->user_id)->first()->name_last }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<?php $i++; ?>
|
||||
@endforeach
|
||||
@endforeach
|
||||
@if($i == 1)
|
||||
<b class="w-100 text-center" style="font-size: 2vw; padding-top: 16px;">Der er ingen vaskemaskine reservationer for i dag.</b>
|
||||
@endif
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<script src="{{ mix("/js/app.js") }}"></script>
|
||||
@yield("scripts")
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,14 @@
|
|||
@extends("admin.layout.base")
|
||||
@extends("admin.layout.header")
|
||||
|
||||
@section("title")
|
||||
Vejledning - Opret
|
||||
@endsection
|
||||
|
||||
@section("path")
|
||||
<a href="{{ route('guides.create') }}" class="text-white">Opret vejledning</a> /
|
||||
@endsection
|
||||
|
||||
@section("content")
|
||||
vejledning blev (ikke) oprettet.
|
||||
@endsection
|
|
@ -0,0 +1,14 @@
|
|||
@extends("admin.layout.base")
|
||||
@extends("admin.layout.header")
|
||||
|
||||
@section("title")
|
||||
Vejledning - Rediger
|
||||
@endsection
|
||||
|
||||
@section("path")
|
||||
<a href="{{ route('guides.edit', ["guide" => $link]) }}" class="text-white">Vejledning</a> /
|
||||
@endsection
|
||||
|
||||
@section("content")
|
||||
Din vejledning blev (ikke) redigeret.
|
||||
@endsection
|
|
@ -0,0 +1,41 @@
|
|||
@extends("admin.layout.base")
|
||||
@extends("admin.layout.header")
|
||||
|
||||
@section("title")
|
||||
Opret Nyheder
|
||||
@endsection
|
||||
|
||||
@section("path")
|
||||
<a href="{{ route('news.create') }}" class="text-white">Opret Nyheder</a> /
|
||||
@endsection
|
||||
|
||||
@section("content")
|
||||
<style>
|
||||
.ck-editor__main {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
</style>
|
||||
<script src="https://cdn.ckeditor.com/ckeditor5/21.0.0/classic/ckeditor.js"></script>
|
||||
<h1>Opret Nyhed</h1>
|
||||
<form method="post" action="{{ route("news.store") }}">
|
||||
@csrf
|
||||
<label for="title">Titel på nyheden:</label>
|
||||
<input type="text" name="name" id="title" placeholder="OBS: Menuplanen er ændret" required>
|
||||
<textarea name="content" id="editor"></textarea>
|
||||
<input type="submit" class="btn btn-dark text-white" value="Opret">
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#editor' ) )
|
||||
.then( editor => {
|
||||
console.log( editor );
|
||||
} )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
} );
|
||||
</script>
|
||||
|
||||
@endsection
|
|
@ -0,0 +1,13 @@
|
|||
@extends("admin.layout.base")
|
||||
@extends("admin.layout.header")
|
||||
|
||||
@section("title")
|
||||
Vejledning - Fjern
|
||||
@endsection
|
||||
|
||||
@section("path")
|
||||
<a href="{{ route('guides.delete') }}" class="text-white">Fjern Guide</a> /
|
||||
@endsection
|
||||
|
||||
@section("content")
|
||||
@endsection
|
|
@ -0,0 +1,46 @@
|
|||
@extends("admin.layout.base")
|
||||
@extends("admin.layout.header")
|
||||
|
||||
@section("title")
|
||||
Nyhed - Rediger
|
||||
@endsection
|
||||
|
||||
@section("path")
|
||||
<a href="{{route('news.edit', ['news' => $news])}}" class="text-white">Rediger nyhed</a> /
|
||||
@endsection
|
||||
|
||||
@section("content")
|
||||
<style>
|
||||
.ck-editor__main {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
</style>
|
||||
<script src="https://cdn.ckeditor.com/ckeditor5/21.0.0/classic/ckeditor.js"></script>
|
||||
<h1>Rediger nyhed:</h1>
|
||||
<form method="post" action="{{route("news.update", ["news" => $news])}}">
|
||||
@csrf
|
||||
@method("PUT")
|
||||
<label for="title">Navn</label>
|
||||
<input value="{{$news->name}}" type="text" name="name" id="title" required>
|
||||
<textarea name="content" id="editor">{{$news->content}}</textarea>
|
||||
<input type="submit" class="btn btn-dark text-white" value="Rediger">
|
||||
</form>
|
||||
|
||||
<script>
|
||||
ClassicEditor
|
||||
.create( document.querySelector( '#editor' ), {
|
||||
toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote' ],
|
||||
heading: {
|
||||
options: [
|
||||
{ model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },
|
||||
{ model: 'heading1', view: 'h3', title: 'Heading 1', class: 'sde-blue' },
|
||||
{ model: 'heading2', view: 'h4', title: 'Heading 2', class: 'sde-blue' }
|
||||
]
|
||||
}
|
||||
} )
|
||||
.catch( error => {
|
||||
console.log( error );
|
||||
} );
|
||||
|
||||
</script>
|
||||
@endsection
|
|
@ -0,0 +1,38 @@
|
|||
@extends("admin.layout.base")
|
||||
@extends("admin.layout.header")
|
||||
|
||||
@section("title")
|
||||
Opret Nyhed
|
||||
@endsection
|
||||
|
||||
@section("path")
|
||||
<a href="{{ route('news.index') }}" class="text-white">Opret Nyheder</a> /
|
||||
@endsection
|
||||
|
||||
@section("content")
|
||||
<div class="row align-items-center">
|
||||
<a class="btn btn-inline btn-sde-blue mb-0" href="{{ route('news.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Nyheder</a>
|
||||
</div>
|
||||
<table class="tbl mt-2">
|
||||
<tr>
|
||||
<th>Navn</th>
|
||||
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
|
||||
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
|
||||
</tr>
|
||||
@foreach($news as $new)
|
||||
<tr>
|
||||
<td>{{$new->name}}</td>
|
||||
<td><a href="{{ route("news.edit", [ "news" => $new ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
||||
<td><form method="post" action="{{ route("news.destroy", [ "news" => $new ]) }}" class="w-100 nostyle">
|
||||
@csrf
|
||||
@method("delete")
|
||||
|
||||
<button onclick="return confirm('Are you sure you want to delete?');" class="w-100 nostyle" type="submit"><img class="w-100 cursor-pointer" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
|
||||
{{ $news->links() }}
|
||||
@endsection
|
|
@ -0,0 +1,14 @@
|
|||
@extends("admin.layout.base")
|
||||
@extends("admin.layout.header")
|
||||
|
||||
@section("title")
|
||||
Vejledning - Opret
|
||||
@endsection
|
||||
|
||||
@section("path")
|
||||
<a href="{{ route('guides.create') }}" class="text-white">Opret vejledning</a> /
|
||||
@endsection
|
||||
|
||||
@section("content")
|
||||
vejledning blev (ikke) oprettet.
|
||||
@endsection
|
|
@ -0,0 +1,14 @@
|
|||
@extends("admin.layout.base")
|
||||
@extends("admin.layout.header")
|
||||
|
||||
@section("title")
|
||||
Vejledning - Rediger
|
||||
@endsection
|
||||
|
||||
@section("path")
|
||||
<a href="{{ route('guides.edit', ["guide" => $link]) }}" class="text-white">Vejledning</a> /
|
||||
@endsection
|
||||
|
||||
@section("content")
|
||||
Din vejledning blev (ikke) redigeret.
|
||||
@endsection
|
|
@ -56,8 +56,7 @@
|
|||
<option {{ $selected }} value="{{ $role->name }}">{{ $role->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</select>
|
||||
</select>
|
||||
<input type="submit" class="btn btn-dark text-white" value="Rediger">
|
||||
</form>
|
||||
@endsection
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
@csrf
|
||||
<input class="appinput" type="email" name="email" placeholder="Email" required>
|
||||
<input class="btn btn-dark" type="submit" value="Send reset mail">
|
||||
<button class="btn btn-dark" onclick="window.location.href = '{{ route("users.login") }}';">Tilbage</button>
|
||||
</form>
|
||||
{!! session()->get("errornosuchuser") !!}
|
||||
</main>
|
||||
@endsection
|
||||
|
|
|
@ -15,6 +15,17 @@
|
|||
@csrf
|
||||
<label for="name_first">Vaskemaskine Navn:</label>
|
||||
<input type="text" name="name" id="name" max="60" placeholder="Vaskemaskine nr. 1" required>
|
||||
<label for="location_id">Lokation:</label>
|
||||
<select name="location_id" id="location_id" class="mb-2" required>
|
||||
<option disabled selected value> -- Vælg Lokation -- </option>
|
||||
@if(count($locations) > 0)
|
||||
@foreach($locations as $location)
|
||||
<option value="{{ $location->id }}">{{ $location->name }}</option>
|
||||
@endforeach
|
||||
@else
|
||||
<option disabled> Der er ingen lokationer oprettet!</option>
|
||||
@endif
|
||||
</select>
|
||||
<input type="submit" class="btn btn-dark text-white" value="Opret">
|
||||
</form>
|
||||
@endsection
|
||||
|
|
|
@ -15,6 +15,16 @@
|
|||
@method("put")
|
||||
<label for="name_first">Vaskemaskine Navn:</label>
|
||||
<input type="text" name="name" id="name" max="60" value="{{$machine->name}}" required>
|
||||
<select class="w-100" name="location_id" id="location_id" class="mb-2" required>
|
||||
<option disabled> -- Vælg Lokation -- </option>
|
||||
@foreach($locations as $location)
|
||||
{{ $selected = "" }}
|
||||
@if($machine->location_id == $location->id)
|
||||
{{ $selected = "selected" }}
|
||||
@endif
|
||||
<option {{ $selected }} value="{{ $location->id }}">{{ $location->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<input type="submit" class="btn btn-dark text-white" value="Rediger">
|
||||
</form>
|
||||
@endsection
|
||||
|
|
|
@ -17,12 +17,14 @@
|
|||
<table class="tbl mt-2">
|
||||
<tr>
|
||||
<th>Navn</th>
|
||||
<th>Lokation</th>
|
||||
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
|
||||
<th style="width: 1em;"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
|
||||
</tr>
|
||||
@foreach($machines as $machine)
|
||||
<tr>
|
||||
<td>{{$machine->name}}</td>
|
||||
<td>{{\App\Location::query()->where("id", "=", $machine->location_id)->first()->name}}</td>
|
||||
<td><a href="{{ route('washing-machines.edit', [ 'washing_machine' => $machine ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
||||
<td><form method="post" action="{{ route('washing-machines.destroy', [ 'washing_machine' => $machine ]) }}" class="w-100 nostyle">
|
||||
@csrf
|
||||
|
|
|
@ -15,8 +15,10 @@
|
|||
<h4 class="mt-0 mb-0">Telefontid:</h4>
|
||||
{!! $contact->phonetimes !!}
|
||||
@endif
|
||||
<span class="text-center sde-black-20 mt-1">+45 {{ chunk_split($contact->phone, 2, ' ') }}</span>
|
||||
<a class="btn text-center btn-sde-blue mt-1" href="tel:+45{{ $contact->phone }}">Ring</a>
|
||||
@if($contact->phone)
|
||||
<span class="text-center sde-black-20 mt-1">+45 {{ chunk_split($contact->phone, 2, ' ') }}</span>
|
||||
<a class="btn text-center btn-sde-blue mt-1" href="tel:+45{{ $contact->phone }}">Ring</a>
|
||||
@endif
|
||||
@endforeach
|
||||
@else
|
||||
<p class="text-center">Der er ingen kontakter!</p>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<option>Ros</option>
|
||||
<option>Ris</option>
|
||||
</select>
|
||||
<textarea name="message" placeholder="Skriv Ris/Ros besked her" required></textarea>
|
||||
<textarea name="message" placeholder="Skriv Ris/Ros besked her" style="resize: vertical;" required></textarea>
|
||||
<button type="submit" class="btn btn-sde-blue mt-2">Send Ris/Ros</button>
|
||||
</form>
|
||||
</main>
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>@yield("title")</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link type="text/css" rel="stylesheet" href="{{ mix("/css/webapp.css") }}">
|
||||
</head>
|
||||
<body>
|
||||
<header class="row align-items-center" id="header">
|
||||
<img class="w-50" id="sdeLogo" src="{{URL::asset('/images/logos/Logo-normal.svg')}}" onclick="location.href = '{{ route("root.index") }}';" alt="Syddansk Erhvervsskole">
|
||||
<button class="ml-auto" id="toggle">
|
||||
<i id="icon" class="fas fa-bars"></i>
|
||||
</button>
|
||||
</header>
|
||||
<div class="d-none bg-sde-blue col" id="menu">
|
||||
<a href="{{ route("root.index") }}">
|
||||
<img src="{{URL::asset('/images/icons/Home.svg')}}" alt="Home">
|
||||
Home
|
||||
</a>
|
||||
|
||||
<a href="{{ route("menu-plans.index") }}">
|
||||
<img src="{{URL::asset('/images/icons/Menuplan.svg')}}" alt="Menuplan">
|
||||
Menuplan
|
||||
</a>
|
||||
<a href="{{ route("events.index") }}">
|
||||
<img src="{{URL::asset('/images/icons/Aktiviteter.svg')}}" alt="Aktiviteter">
|
||||
Aktiviteter
|
||||
</a>
|
||||
<a href="{{ route("washing-reservations.appindex") }}">
|
||||
<img src="{{URL::asset('/images/icons/Vaske booking liste.svg')}}" alt="Reservationer">
|
||||
Reservationer
|
||||
</a>
|
||||
{{-- MÅ IKKE SLETTES!!!! --}}
|
||||
{{-- <a href="# ">--}}
|
||||
{{-- <img src="{{URL::asset('/images/icons/Galleri.svg')}}" alt="Galleri">--}}
|
||||
{{-- Galleri--}}
|
||||
{{-- </a>--}}
|
||||
<a href="{{ route("contacts.index") }}">
|
||||
<img src="{{URL::asset('/images/icons/Kontoret.svg')}}" alt="Kontoret">
|
||||
Kontoret
|
||||
</a>
|
||||
<a href="{{ route("phones.index") }}">
|
||||
<img src="{{URL::asset('/images/icons/Vagttelefon-hvid.svg')}}" alt="Vagttelefon">
|
||||
Vagttelefon
|
||||
</a>
|
||||
<a href="{{ route("guides.index") }}">
|
||||
<img src="{{URL::asset('/images/icons/Vejledninger.svg')}}" alt="Guide">
|
||||
Vejledninger
|
||||
</a>
|
||||
<a href="{{ route("users.account") }}">
|
||||
<img src="{{URL::asset('/images/icons/user-hvid.svg')}}" alt="Konto">
|
||||
Konto
|
||||
</a>
|
||||
<a href="{{ route('users.logout') }}">
|
||||
<img src="{{URL::asset('/images/icons/Logout.svg')}}" alt="Logud">
|
||||
Log Ud
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<main>
|
||||
@foreach(\App\News::query()->orderBy("created_at", "desc")->get() as $new)
|
||||
<h2 class="sde-blue">{{ $new->name }}</h2>
|
||||
{!! $new->content !!}
|
||||
@endforeach
|
||||
</main>
|
||||
<script src="{{ mix("/js/app.js") }}"></script>
|
||||
@yield("scripts")
|
||||
</body>
|
||||
</html>
|
|
@ -1,70 +1 @@
|
|||
{{----}}
|
||||
{{------app
|
||||
{{----}}
|
||||
|
||||
{{--Index--}}
|
||||
{{----}}@extends("app.users.index")
|
||||
|
||||
{{--Login--}}
|
||||
{{--@extends("app.users.login")--}}
|
||||
|
||||
{{--Register--}}
|
||||
{{--@extends("app.users.register")--}}
|
||||
|
||||
{{--Events--}}
|
||||
{{--@extends("app.events.index")--}}
|
||||
|
||||
{{--Vagttelefon--}}
|
||||
{{--@extends("app.vagttelefons.index")--}}
|
||||
|
||||
{{--Booking Liste--}}
|
||||
{{--@extends("app.washing-reservations.index")--}}
|
||||
|
||||
{{--Menuplan--}}
|
||||
{{--@extends("app.menuplans.index")--}}
|
||||
|
||||
{{--Contact--}}
|
||||
{{--@extends("app.contact.index")--}}
|
||||
|
||||
{{--Account--}}
|
||||
{{--@extends("app.users.index")--}}
|
||||
|
||||
{{--Feedback--}}
|
||||
{{--@extends("app.feedbacks.index")--}}
|
||||
|
||||
{{----}}
|
||||
{{------Admin Panel
|
||||
{{----}}
|
||||
|
||||
{{--Index--}}
|
||||
{{--@extends("admin.index")--}}
|
||||
|
||||
{{--Create User--}}
|
||||
{{--@extends("admin.users.create")--}}
|
||||
|
||||
{{--Read User--}}
|
||||
{{--@extends("admin.users.show")--}}
|
||||
|
||||
{{--Update User--}}
|
||||
{{--@extends("admin.users.update")--}}
|
||||
|
||||
{{--Create Menuplan--}}
|
||||
{{--@extends("admin.menuplans.create")--}}
|
||||
|
||||
{{--Read Menuplan--}}
|
||||
{{--@extends("admin.menuplans.show")--}}
|
||||
|
||||
{{--Update Menuplan--}}
|
||||
{{--@extends("admin.menuplans.update")--}}
|
||||
|
||||
{{--Create booking--}}
|
||||
{{--@extends("admin.washing-reservations.create")--}}
|
||||
|
||||
{{--Read booking--}}
|
||||
{{--@extends("admin.washing-reservations.show")--}}
|
||||
|
||||
{{--Create washing-machine--}}
|
||||
{{--@extends("admin.washing-machines.create")--}}
|
||||
|
||||
{{--Read washing-machine--}}
|
||||
{{--@extends("admin.washing-machines.show")--}}
|
||||
@extends("app.news.index")
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
@csrf
|
||||
<input class="appinput" type="email" name="email" placeholder="Email" required>
|
||||
<input class="btn btn-dark" type="submit" value="Send reset mail">
|
||||
<button class="btn btn-dark" onclick="window.location.href = '{{ route("users.login") }}';">Tilbage</button>
|
||||
</form>
|
||||
</main>
|
||||
@endsection
|
||||
|
|
|
@ -97,8 +97,8 @@
|
|||
}
|
||||
|
||||
function onDateSelect(date, dayHolder, datetext) {
|
||||
console.log("Opdaterer selects");
|
||||
let events;
|
||||
let locationz;
|
||||
let machinez;
|
||||
let buttonz;
|
||||
|
||||
|
@ -114,20 +114,47 @@
|
|||
dayHolder.classList.add("selected");
|
||||
|
||||
let machine_id;
|
||||
let location_id;
|
||||
|
||||
if(document.getElementById('washing-machines'))
|
||||
machine_id = document.getElementById('washing-machines').value;
|
||||
else
|
||||
machine_id = 0;
|
||||
|
||||
if(document.getElementById('locations'))
|
||||
location_id = document.getElementById('locations').value;
|
||||
else
|
||||
location_id = 0;
|
||||
|
||||
axios({
|
||||
method: 'get',
|
||||
url: '{{ route("washing-reservations.api") }}',
|
||||
params: { 'date': date, 'machine_id': machine_id, 'datetext': datetext }
|
||||
params: { 'date': date, 'machine_id': machine_id, 'datetext': datetext, 'location_id': location_id }
|
||||
}).then(function (response) {
|
||||
console.log(response.data["unavailable_times"]);
|
||||
var data = response.data;
|
||||
|
||||
|
||||
if(document.getElementById("locations") != undefined)
|
||||
locationz = document.getElementById("locations");
|
||||
else {
|
||||
let span = document.createElement("span");
|
||||
span.classList.add("events__title");
|
||||
span.innerText = "Lokation";
|
||||
|
||||
let select = document.createElement("select");
|
||||
select.classList.add("events__title");
|
||||
select.id = "locations";
|
||||
select.name = "location_id";
|
||||
|
||||
select.onchange = function() {
|
||||
onDateSelect(date, dayHolder, datetext);
|
||||
}
|
||||
|
||||
container.appendChild(span);
|
||||
container.appendChild(select);
|
||||
|
||||
locationz = document.getElementById("locations");
|
||||
}
|
||||
if(document.getElementById("washing-machines") != undefined)
|
||||
machinez = document.getElementById("washing-machines");
|
||||
else {
|
||||
|
@ -180,6 +207,24 @@
|
|||
buttonz = document.getElementById("events");
|
||||
}
|
||||
|
||||
let locations = data["locations"];
|
||||
|
||||
locationz.innerHTML = "";
|
||||
locationz.onchange = function () {
|
||||
onDateSelect(date, dayHolder, datetext);
|
||||
}
|
||||
|
||||
for (let i = 0; i < locations.length; i++) {
|
||||
let option = document.createElement("option");
|
||||
option.text = locations[i]["name"];
|
||||
option.value = locations[i]["id"];
|
||||
|
||||
if(location_id == locations[i]["id"])
|
||||
option.selected = "selected";
|
||||
|
||||
locationz.appendChild(option);
|
||||
}
|
||||
|
||||
let machines = data["washingmachines"];
|
||||
|
||||
machinez.innerHTML = "";
|
||||
|
@ -213,7 +258,6 @@
|
|||
let unavailable_times = data["unavailable_times"];
|
||||
|
||||
unavailable_times.forEach(function (item, index) {
|
||||
console.log(item);
|
||||
document.getElementById(item).remove();
|
||||
});
|
||||
|
||||
|
|
|
@ -54,3 +54,5 @@ Route::resource("resource-extensions", "ResourceExtensionController");
|
|||
Route::resource("resource-categories", "ResourceCategoryController");
|
||||
Route::resource("roles", "RolesController");
|
||||
Route::resource("guides", "GuideController");
|
||||
Route::resource("locations", "LocationController");
|
||||
Route::resource("news", "NewsController");
|
||||
|
|
Loading…
Reference in New Issue