Add a reference to the skin name in the templates to make it easier to create and modify skins

This commit is contained in:
Nabeel Shahzad
2018-02-03 18:18:09 -06:00
parent 25b86274cf
commit b4908f482e
27 changed files with 117 additions and 105 deletions

View File

@@ -54,11 +54,19 @@ if (!function_exists('skin_view')) {
/** /**
* Render a skin * Render a skin
* @param $template * @param $template
* @param array $vars
* @param array $merge_data
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/ */
function skin_view($template, array $vars = [], $merge_data = []) function skin_view($template, array $vars = [], $merge_data = [])
{ {
# Add the current skin name so we don't need to hardcode it in the templates
# Makes it a bit easier to create a new skin by modifying an existing one
$merge_data['SKIN_NAME'] = config('phpvms.skin');
$tpl = 'layouts/' . config('phpvms.skin') . '/' . $template; $tpl = 'layouts/' . config('phpvms.skin') . '/' . $template;
# TODO: Look for an overridden template in a special folder
return view($tpl, $vars, $merge_data); return view($tpl, $vars, $merge_data);
} }
} }

View File

@@ -1,6 +1,6 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
@section('title', 'live map') @section('title', 'live map')
@section('content') @section('content')
{{ Widget::liveMap() }} {{ Widget::liveMap() }}
@endsection @endsection

View File

@@ -48,7 +48,7 @@
</p> </p>
</div> </div>
<div class="collapse navbar-collapse justify-content-end" id="navigation"> <div class="collapse navbar-collapse justify-content-end" id="navigation">
@include('layouts.default.nav') @include("layouts.${SKIN_NAME}.nav")
</div> </div>
</div> </div>
</nav> </nav>
@@ -57,7 +57,7 @@
<div class="wrapper"> <div class="wrapper">
<div class="clear"></div> <div class="clear"></div>
<div class="container-fluid" style="width: 85%!important;"> <div class="container-fluid" style="width: 85%!important;">
@include('layouts.default.flash.message') @include("layouts.${SKIN_NAME}.flash.message")
@yield('content') @yield('content')
</div> </div>
<div class="clearfix" style="height: 200px;"></div> <div class="clearfix" style="height: 200px;"></div>

View File

@@ -1,5 +1,6 @@
@extends('layouts.default.auth.layout') @extends("layouts.${SKIN_NAME}.auth.layout")
@section('title', 'log in') @section('title', 'log in')
@section('content') @section('content')
<div class="col-md-4 content-center"> <div class="col-md-4 content-center">
<div class="card card-login card-plain"> <div class="card card-login card-plain">

View File

@@ -1,4 +1,4 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
<!-- Main Content --> <!-- Main Content -->
@section('content') @section('content')

View File

@@ -1,4 +1,4 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
@section('content') @section('content')
<div class="container"> <div class="container">

View File

@@ -1,6 +1,6 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
@section('title', 'registration pending') @section('title', 'registration pending')
@section('content') @section('content')
<div class="row"> <div class="row">
<div class="col-md-12 " style="text-align: center;"> <div class="col-md-12 " style="text-align: center;">

View File

@@ -1,5 +1,6 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
@section('title', 'register') @section('title', 'register')
@section('content') @section('content')
<div class="row"> <div class="row">
<div class="col-sm-3"></div> <div class="col-sm-3"></div>
@@ -66,7 +67,7 @@
<p class="text-danger">{{ $errors->first('password_confirmation') }}</p> <p class="text-danger">{{ $errors->first('password_confirmation') }}</p>
@endif @endif
@include('layouts.default.auth.toc') @include("layouts.${SKIN_NAME}.auth.toc")
<div style="width: 100%; text-align: right; padding-top: 20px;"> <div style="width: 100%; text-align: right; padding-top: 20px;">
By registering, you agree to the Term and Conditions<br /><br /> By registering, you agree to the Term and Conditions<br /><br />

View File

@@ -1,11 +1,12 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
@section('title', 'registration submitted') @section('title', 'registration submitted')
@section('content') @section('content')
<div class="container registered-page"> <div class="container registered-page">
<h3>Registration Confirmation</h3> <h3>Registration Confirmation</h3>
<p>Your application has been submitted. It requires staff member approval, once a staff member has reviewed your application, you will receive an email confirmation.</p> <p>
Your application has been submitted. It requires staff member approval, once a
staff member has reviewed your application, you will receive an email confirmation.
</p>
</div> </div>
@endsection @endsection

View File

@@ -1,16 +1,16 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
@section('title', 'registration denied') @section('title', 'registration denied')
@section('content') @section('content')
<div class="row"> <div class="row">
<div class="col-md-12 " style="text-align: center;"> <div class="col-md-12 " style="text-align: center;">
<div class="flex-center position-ref full-height"> <div class="flex-center position-ref full-height">
<div class="title m-b-md"> <div class="title m-b-md">
<h2 class="description"> <h2 class="description">
your registration was denied. please contact an administrator your registration was denied. please contact an administrator
</h2> </h2>
</div>
</div> </div>
</div> </div>
</div> </div>
@endsection() </div>
@endsection

View File

@@ -1,16 +1,16 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
@section('title', 'account suspended') @section('title', 'account suspended')
@section('content') @section('content')
<div class="row"> <div class="row">
<div class="col-md-12 " style="text-align: center;"> <div class="col-md-12 " style="text-align: center;">
<div class="flex-center position-ref full-height"> <div class="flex-center position-ref full-height">
<div class="title m-b-md"> <div class="title m-b-md">
<h2 class="description"> <h2 class="description">
your has been suspended. please contact an administrator your has been suspended. please contact an administrator
</h2> </h2>
</div>
</div> </div>
</div> </div>
</div> </div>
@endsection() </div>
@endsection

View File

@@ -1,6 +1,6 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
@section('title', 'dashboard') @section('title', 'dashboard')
@section('content') @section('content')
<div class="row"> <div class="row">
<div class="col-sm-8"> <div class="col-sm-8">
@@ -54,7 +54,7 @@
<div class="nav nav-tabs" role="tablist" style="background: #067ec1; color: #FFF;"> <div class="nav nav-tabs" role="tablist" style="background: #067ec1; color: #FFF;">
Your Last Report Your Last Report
</div> </div>
@include('layouts.default.pireps.pirep_card', ['pirep' => $last_pirep]) @include("layouts.${SKIN_NAME}.pireps.pirep_card", ['pirep' => $last_pirep])
@endif @endif
{{ Widget::latestNews(['count' => 1]) }} {{ Widget::latestNews(['count' => 1]) }}

View File

@@ -1,4 +0,0 @@
<!-- DataTable Bootstrap -->
<link href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="//cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.2.2/css/buttons.bootstrap.min.css">

View File

@@ -1,7 +0,0 @@
<!-- Datatables -->
<script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.2.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.2.2/js/buttons.bootstrap.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.2.2/js/buttons.colVis.min.js"></script>
<script src="{{ asset('vendor/datatables/buttons.server-side.js') }}"></script>

View File

@@ -1,8 +1,12 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
@section('title', 'not authorized') @section('title', 'not authorized')
@section('content') @section('content')
<div class="container registered-page"> <div class="container registered-page">
<h3>Unauthorized</h3> <h3>Unauthorized</h3>
<p>Well, this is embarrassing, you are not authorized to access or perform this function. Click <a href="{{ url()->previous() }}">here</a> to go back to the home page.</p> <p>
Well, this is embarrassing, you are not authorized to access or perform this function.
Click <a href="{{ url()->previous() }}">here</a> to go back to the home page.
</p>
</div> </div>
@endsection @endsection

View File

@@ -1,11 +1,13 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
@section('title', 'not found') @section('title', 'not found')
@section('content') @section('content')
<div class="container registered-page"> <div class="container registered-page">
<h3>Page Not Found</h3> <h3>Page Not Found</h3>
<p>Well, this is embarrassing, the page you requested does not exist. Click <a href="{{ url()->previous() }}">here</a> to go back to the home page. <p>
Well, this is embarrassing, the page you requested does not exist.
{{ $exception->getMessage() }} Click <a href="{{ url()->previous() }}">here</a> to go back to the home page.
</p> {{ $exception->getMessage() }}
</p>
</div> </div>
@endsection @endsection

View File

@@ -1,23 +1,24 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
@section('title', 'flights') @section('title', 'flights')
@section('content') @section('content')
<div class="row"> <div class="row">
@include('flash::message') @include('flash::message')
<div class="col-md-9"> <div class="col-md-9">
<h2 class="description">flights</h2> <h2 class="description">flights</h2>
@include('layouts.default.flights.table') @include("layouts.${SKIN_NAME}.flights.table")
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
@include('layouts.default.flights.search') @include("layouts.${SKIN_NAME}.flights.search")
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-12 text-center"> <div class="col-12 text-center">
{{ $flights->links('layouts.default.pagination.default') }} {{ $flights->links("layouts.${SKIN_NAME}.pagination.default") }}
</div> </div>
</div> </div>
@endsection @endsection
@section('scripts') @section('scripts')
<script> <script>
$(document).ready(function() { $(document).ready(function() {

View File

@@ -1,4 +1,4 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
@section('title', 'Flight '.$flight->ident) @section('title', 'Flight '.$flight->ident)
@section('content') @section('content')
@@ -49,5 +49,5 @@
</table> </table>
</div> </div>
</div> </div>
@include('layouts.default.flights.map') @include("layouts.${SKIN_NAME}.flights.map")
@endsection @endsection

View File

@@ -1,5 +1,6 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
@section('title', 'welcome!') @section('title', 'welcome!')
@section('content') @section('content')
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">

View File

@@ -1,5 +1,6 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
@section('title', 'file pirep') @section('title', 'file pirep')
@section('content') @section('content')
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
@@ -7,12 +8,13 @@
@include('flash::message') @include('flash::message')
{!! Form::open(['route' => 'frontend.pireps.store']) !!} {!! Form::open(['route' => 'frontend.pireps.store']) !!}
@include('layouts.default.pireps.fields') @include("layouts.${SKIN_NAME}.pireps.fields")
{!! Form::close() !!} {!! Form::close() !!}
</div> </div>
</div> </div>
@endsection @endsection
@section('scripts') @section('scripts')
<script> <script>
$(document).ready(function() { $(document).ready(function() {

View File

@@ -1,4 +1,3 @@
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<table class="table table-full-width"> <table class="table table-full-width">

View File

@@ -1,5 +1,6 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
@section('title', 'pireps') @section('title', 'pireps')
@section('content') @section('content')
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
@@ -10,12 +11,12 @@
</div> </div>
<h2 class="description">pilot reports</h2> <h2 class="description">pilot reports</h2>
@include('flash::message') @include('flash::message')
@include('layouts.default.pireps.table') @include("layouts.${SKIN_NAME}.pireps.table")
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-12 text-center"> <div class="col-12 text-center">
{{ $pireps->links('layouts.default.pagination.default') }} {{ $pireps->links("layouts.${SKIN_NAME}.pagination.default") }}
</div> </div>
</div> </div>
@endsection @endsection

View File

@@ -1,6 +1,6 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
@section('title', 'PIREP '.$pirep->ident) @section('title', 'PIREP '.$pirep->ident)
@section('content') @section('content')
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
@@ -72,27 +72,27 @@
</div> </div>
@if(count($pirep->fields) > 0) @if(count($pirep->fields) > 0)
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<h3 class="description">fields</h3> <h3 class="description">fields</h3>
<table class="table"> <table class="table">
<thead> <thead>
<th>Name</th> <th>Name</th>
<th>Value</th> <th>Value</th>
</thead> </thead>
<tbody> <tbody>
@foreach($pirep->fields as $field) @foreach($pirep->fields as $field)
<tr> <tr>
<td>{!! $field->name !!}</td> <td>{!! $field->name !!}</td>
<td>{!! $field->value !!}</td> <td>{!! $field->value !!}</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
</div>
</div> </div>
</div>
@endif @endif
@include('layouts.default.pireps.map') @include("layouts.${SKIN_NAME}.pireps.map")
@endsection @endsection

View File

@@ -1 +1,2 @@
@each('layouts.default.pireps.pirep_card', $pireps, 'pirep') @each("layouts.${SKIN_NAME}.pireps.pirep_card", $pireps, 'pirep')

View File

@@ -1,12 +1,13 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
@section('title', 'edit profile') @section('title', 'edit profile')
@section('content') @section('content')
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<h2 class="description">edit your profile</h2> <h2 class="description">edit your profile</h2>
@include('flash::message') @include('flash::message')
{!! Form::model($user, ['route' => ['frontend.profile.update', $user->id], 'method' => 'patch']) !!} {!! Form::model($user, ['route' => ['frontend.profile.update', $user->id], 'method' => 'patch']) !!}
@include('layouts.default.profile.fields') @include("layouts.${SKIN_NAME}.profile.fields")
{!! Form::close() !!} {!! Form::close() !!}
</div> </div>
</div> </div>

View File

@@ -1,5 +1,6 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
@section('title', 'profile') @section('title', 'profile')
@section('content') @section('content')
<div class="row profile-page content-center text-color-dark-beige"> <div class="row profile-page content-center text-color-dark-beige">
<div class="col-md-4" style="text-align:center;"> <div class="col-md-4" style="text-align:center;">

View File

@@ -1,17 +1,16 @@
@extends('layouts.default.app') @extends("layouts.${SKIN_NAME}.app")
@section('title', 'Pilots') @section('title', 'Pilots')
@section('content') @section('content')
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<h2 class="description">pilots</h2> <h2 class="description">pilots</h2>
@include('layouts.default.users.table') @include("layouts.${SKIN_NAME}.users.table")
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-12 text-center"> <div class="col-12 text-center">
{{ $users->links('layouts.default.pagination.default') }} {{ $users->links("layouts.${SKIN_NAME}.pagination.default") }}
</div> </div>
</div> </div>
@endsection @endsection