Tidy up admin cp place related views

This commit is contained in:
Jonny Barnes 2017-03-02 18:38:15 +00:00
commit f9751fe765
6 changed files with 5 additions and 5 deletions

View file

@ -26,7 +26,7 @@ class PlacesController extends Controller
{
$places = Place::all();
return view('admin.listplaces', ['places' => $places]);
return view('admin.places.list', ['places' => $places]);
}
/**
@ -36,7 +36,7 @@ class PlacesController extends Controller
*/
public function create()
{
return view('admin.newplace');
return view('admin.places.new');
}
/**
@ -52,7 +52,7 @@ class PlacesController extends Controller
$latitude = $place->getLatitude();
$longitude = $place->getLongitude();
return view('admin.editplace', [
return view('admin.places.edit', [
'id' => $placeId,
'name' => $place->name,
'description' => $place->description,
@ -76,7 +76,7 @@ class PlacesController extends Controller
$data['longitude'] = $request->longitude;
$place = $this->placeService->createPlace($data);
return view('admin.newplacesuccess');
return view('admin.places.newsuccess');
}
/**
@ -94,6 +94,6 @@ class PlacesController extends Controller
$place->location = new Point((float) $request->latitude, (float) $request->longitude);
$place->save();
return view('admin.editplacesuccess');
return view('admin.places.editsuccess');
}
}

View file

@ -0,0 +1,18 @@
@extends('master')
@section('title')
Edit Place « Admin CP
@stop
@section('content')
<h1>Edit Place</h1>
<form action="/admin/places/edit/{{ $id }}" method="post" accept-charset="utf-8">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<input type="text" name="name" id="name" value="{{ $name }}"><br>
<input type="text" name="description" id="description" value="{{ $description }}"><br>
<input type="text" name="latitude" id="latitude" value="{{ $latitude }}"><br>
<input type="text" name="longitude" id="longitude" value="{{ $longitude }}"><br>
<input type="submit" name="edit" value="Edit"><br><br>
<input type="submit" name="delete" value="Delete">
</form>
@stop

View file

@ -0,0 +1,9 @@
@extends('master')
@section('title')
Edit Place « Admin CP
@stop
@section('content')
<p>Successfully edited the place information.</p>
@stop

View file

@ -0,0 +1,15 @@
@extends('master')
@section('title')
List Places « Admin CP
@stop
@section('content')
<h1>Places</h1>
<ul>
@foreach($places as $place)
<li>{{ $place['name'] }} <a href="/admin/places/edit/{{ $place['id'] }}">edit?</a></li>
@endforeach
</ul>
<p>Createn a <a href="/admin/places/new">new entry</a>?</p>
@stop

View file

@ -0,0 +1,25 @@
@extends('master')
@section('title')
New Place « Admin CP
@stop
@section('content')
<h1>New Place</h1>
<form action="/admin/places/new" method="post" accept-charset="utf-8">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<label for="name">Name:</label> <input type="text" name="name" id="name" placeholder="Place Name"><br>
<label for="description">Description:</label> <input type="text" name="description" id="description" placeholder="Description"><br>
<label for="latitude">Latitude:</label> <input type="text" name="latitude" id="latitude" placeholder="Latitude"><br>
<label for="longitude">Longitude:</label> <input type="text" name="longitude" id="longitude" placeholder="Longitude"><br>
<input type="submit" name="submit" value="Submit">
<h2>Location</h2>
<button type="button" name="locate" id="locate">Locate</button>
</form>
@stop
@section('scripts')
@include('templates.mapbox-links')
<script src="/assets/js/newplace.js"></script>
@stop

View file

@ -0,0 +1,9 @@
@extends('master')
@section('title')
New Place « Admin CP
@stop
@section('content')
<p>Succesfully created new place info.</p>
@stop