Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
178 changes: 88 additions & 90 deletions src/NukaCode/Bootstrap/BootstrapServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,103 +4,101 @@

class BootstrapServiceProvider extends BaseServiceProvider {

/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;

const version = '1.0.0';
const version = '1.0.0';

/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->shareWithApp();
$this->setConfig();
$this->registerViews();
$this->registerAliases();
$this->registerArtisanCommands();
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->shareWithApp();
$this->setPublishGroups();
$this->registerViews();
$this->registerAliases();
$this->registerArtisanCommands();
}

/**
* Share the package with application
*
* @return void
*/
protected function shareWithApp()
{
$this->app['bootstrap'] = $this->app->share(function ($app) {
return true;
});
}
/**
* Share the package with application
*
* @return void
*/
protected function shareWithApp()
{
$this->app['bootstrap'] = $this->app->share(function ($app) {
return true;
});
}

/**
* Load the config for the package
*
* @return void
*/
protected function setConfig()
{
$this->app['config']->set(
[
'nukacode' => [
'bootstrap' => $this->getConfig()
]
]
);
}
/**
* Load the config for the package
*
* @return void
*/
protected function setPublishGroups()
{
$this->publishes(
[
__DIR__ . '/../../config/config.php' => config_path('nukacode-frontend.php')
], 'config'
);
}

/**
* Register views
*
* @return void
*/
protected function registerViews()
{
$this->app['view']->addLocation(__DIR__ . '/../../views');
}
/**
* Register views
*
* @return void
*/
protected function registerViews()
{
$this->app['view']->addLocation(__DIR__ . '/../../views');
}

/**
* Register aliases
*
* @return void
*/
protected function registerAliases()
{
$aliases = [
// Facades
'HTML' => 'NukaCode\Bootstrap\Support\Html\HTML',
'Form' => 'NukaCode\Bootstrap\Support\Html\Form',
'BBCode' => 'NukaCode\Bootstrap\Support\Html\BBCode',
];
/**
* Register aliases
*
* @return void
*/
protected function registerAliases()
{
$aliases = [
// Facades
'HTML' => 'NukaCode\Bootstrap\Support\Html\HTML',
'Form' => 'NukaCode\Bootstrap\Support\Html\Form',
'BBCode' => 'NukaCode\Bootstrap\Support\Html\BBCode',
];

$exclude = $this->app['config']->get('nukacode.bootstrap.excludeAliases');
$exclude = $this->app['config']->get('nukacode-frontend.excludeAliases');

$this->loadAliases($aliases, $exclude);
}

$this->loadAliases($aliases, $exclude);
}
public function registerArtisanCommands()
{
$this->commands(
[
'NukaCode\Bootstrap\Console\ThemeCommand',
]
);
}

public function registerArtisanCommands()
{
$this->commands(
[
'NukaCode\Bootstrap\Console\ThemeCommand',
]
);
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return ['bootstrap'];
}

/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return ['bootstrap'];
}

}
}
4 changes: 2 additions & 2 deletions src/NukaCode/Bootstrap/Html/FormBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function offsetGroupOpen($labelSize = null, $inputSize = null, $iconSize

}

public function smallGroupClose()
public function offsetGroupClose()
{
if ($this->previousSizes != null) {
call_user_func_array([$this, 'setSizes'], $this->previousSizes);
Expand All @@ -138,7 +138,6 @@ public function smallGroupClose()
return <<<HTML
$inputClose
</div>
</div>
HTML;
}

Expand Down Expand Up @@ -494,6 +493,7 @@ private function checkForOptionals($name, $arguments)
private function strpos_array($haystack, $needles, $offset = 0)
{
if (is_array($needles)) {
pp($needles);
foreach ($needles as $needle) {
$pos = $this->strpos_array($haystack, $needle);
if ($pos !== false) {
Expand Down
1 change: 1 addition & 0 deletions src/views/errors/400.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@include('errors.layout', ['error' => 400, 'subTitle' => 'We cannot process your request currently.'])
14 changes: 1 addition & 13 deletions src/views/errors/401.blade.php
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
<div class="row">
<div class="col-md-offset-4 col-md-4">
<div class="well text-center">
<div class="well-title">
401 Unauthorized Error
</div>
You are not authorized to view this page. <br />
@if (Session::has('errorMessage'))
Error Message: {{ Session::get('errorMessage') }}
@endif
</div>
</div>
</div>
@include('errors.layout', ['error' => 401, 'subTitle' => 'You are not authorized to view this page.'])
14 changes: 1 addition & 13 deletions src/views/errors/404.blade.php
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
<div class="row">
<div class="col-md-offset-4 col-md-4">
<div class="well text-center">
<div class="well-title">
404 File Not Found Error
</div>
Sorry, the page you are looking for could not be found. <br />
@if (Session::has('errorMessage'))
Error Message: {{ Session::get('errorMessage') }}
@endif
</div>
</div>
</div>
@include('errors.layout', ['error' => 404, 'subTitle' => 'The page you requested could not be found.'])
1 change: 1 addition & 0 deletions src/views/errors/500.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@include('errors.layout', ['error' => 500, 'subTitle' => 'We cannot process your request currently.'])
60 changes: 60 additions & 0 deletions src/views/errors/layout.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php $pageTitle = 'Error'; ?>
@extends('layouts.default')

@section('css')
@parent
<link href='//fonts.googleapis.com/css?family=Lato:100' rel='stylesheet' type='text/css'>

<style>
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
color: #B0BEC5;
display: table;
font-weight: 100;
font-family: 'Lato';
}

.container {
vertical-align: middle;
padding-top: 50px;
text-align: center;
}

.content {
text-align: center;
display: inline-block;
}

.title {
font-size: 96px;
}

.sub-title {
font-size: 35px;
margin-bottom: 40px;
}

.quote {
font-size: 24px;
}
</style>
@stop

<div class="container">
<div class="content">
<div class="title">Error {{ $error }}</div>
<div class="sub-title">{{ $subTitle }}</div>
<div class="quote">
@if (Session::has('errorMessage'))
Error Message: {{ Session::get('errorMessage') }}
<br />
@endif
</div>
<div class="quote">
{!! HTML::linkRoute('home', 'Go Back to the Home Page', [], ['class' => 'btn btn-primary']) !!}
</div>
</div>
</div>
31 changes: 17 additions & 14 deletions src/views/layouts/default.blade.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<!doctype html>
<html>
<head>
@include('layouts.partials.header')
</head>
<body>
@include('layouts.partials.menu')
@if (isset($content))
{{ $content }}
@else
@yield('content')
@endif
<head>
@include('layouts.partials.header')
</head>
<body>
@include('layouts.partials.menu')

@include('layouts.partials.modals')
<div id="content">
@if (isset($content))
{{ $content }}
@else
@yield('content')
@endif
</div>

@include('layouts.partials.javascript')
@include('layouts.partials.modals')

</body>
</html>
@include('layouts.partials.javascript')

</body>
</html>
4 changes: 2 additions & 2 deletions src/views/layouts/partials/menu.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@if (Menu::count() > 0)
<div id="header">
@include('layouts.menus.twitter')
@include('layouts.menus.'. Config::get('nukacode-frontend.menu'))
</div>
<hr />
@endif
@endif