Browse Source

Add controller.

pull/3/head
Ned Zimmerman 7 years ago
parent
commit
8d3ccac372
  1. 0
      app/controllers/About.php
  2. 0
      app/controllers/App.php
  3. 18
      app/controllers/Home.php
  4. 2
      composer.json
  5. 131
      composer.lock
  6. 6
      dist/assets.json
  7. 0
      dist/scripts/customizer_9ceb9969.js
  8. 0
      dist/scripts/main_9ceb9969.js
  9. 2
      dist/styles/main_9ceb9969.css
  10. 10
      resources/assets/styles/layouts/_header.scss
  11. 10
      resources/controllers/Home.php
  12. 12
      resources/views/index.blade.php
  13. 4
      resources/views/partials/header.blade.php

0
resources/controllers/About.php → app/controllers/About.php

0
resources/controllers/App.php → app/controllers/App.php

18
app/controllers/Home.php

@ -0,0 +1,18 @@
<?php
namespace App;
use Sober\Controller\Controller;
class Home extends Controller
{
function sidebar_count() {
$c = 0;
foreach(['home-block-one', 'home-block-two', 'home-block-three', 'home-block-four', 'home-block-five'] as $block) {
if (is_active_sidebar($block)) {
$c++;
}
}
return $c;
}
}

2
composer.json

@ -31,7 +31,7 @@
"composer/installers": "~1.0",
"illuminate/support": "~5.4",
"roots/sage-lib": "~9.0.0-beta.4",
"soberwp/controller": "dev-master"
"soberwp/controller": "~9.0.0-beta.4"
},
"require-dev": {
"squizlabs/php_codesniffer": "^2.8.0",

131
composer.lock generated

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "9a56b0654d7dff65e2aebe6ed81833f3",
"content-hash": "dff0ad9351f0ed99a3ef9264d114d4f5",
"packages": [
{
"name": "brain/hierarchy",
@ -64,16 +64,16 @@
},
{
"name": "composer/installers",
"version": "v1.3.0",
"version": "v1.4.0",
"source": {
"type": "git",
"url": "https://github.com/composer/installers.git",
"reference": "79ad876c7498c0bbfe7eed065b8651c93bfd6045"
"reference": "9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/installers/zipball/79ad876c7498c0bbfe7eed065b8651c93bfd6045",
"reference": "79ad876c7498c0bbfe7eed065b8651c93bfd6045",
"url": "https://api.github.com/repos/composer/installers/zipball/9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b",
"reference": "9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b",
"shasum": ""
},
"require": {
@ -119,6 +119,7 @@
"Hurad",
"ImageCMS",
"Kanboard",
"Lan Management System",
"MODX Evo",
"Mautic",
"Maya",
@ -142,6 +143,7 @@
"croogo",
"dokuwiki",
"drupal",
"eZ Platform",
"elgg",
"expressionengine",
"fuelphp",
@ -158,6 +160,7 @@
"mediawiki",
"modulework",
"moodle",
"osclass",
"phpbb",
"piwik",
"ppi",
@ -174,37 +177,37 @@
"zend",
"zikula"
],
"time": "2017-04-24T06:37:16+00:00"
"time": "2017-08-09T07:53:48+00:00"
},
{
"name": "doctrine/inflector",
"version": "v1.1.0",
"version": "v1.2.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/inflector.git",
"reference": "90b2128806bfde671b6952ab8bea493942c1fdae"
"reference": "e11d84c6e018beedd929cff5220969a3c6d1d462"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae",
"reference": "90b2128806bfde671b6952ab8bea493942c1fdae",
"url": "https://api.github.com/repos/doctrine/inflector/zipball/e11d84c6e018beedd929cff5220969a3c6d1d462",
"reference": "e11d84c6e018beedd929cff5220969a3c6d1d462",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
"php": "^7.0"
},
"require-dev": {
"phpunit/phpunit": "4.*"
"phpunit/phpunit": "^6.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
"dev-master": "1.2.x-dev"
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Inflector\\": "lib/"
"psr-4": {
"Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector"
}
},
"notification-url": "https://packagist.org/downloads/",
@ -241,7 +244,7 @@
"singularize",
"string"
],
"time": "2015-11-06T14:35:42+00:00"
"time": "2017-07-22T12:18:28+00:00"
},
{
"name": "hassankhan/config",
@ -726,26 +729,26 @@
},
{
"name": "roots/sage-lib",
"version": "9.0.0-beta.3",
"version": "9.0.0-beta.4",
"source": {
"type": "git",
"url": "https://github.com/roots/sage-lib.git",
"reference": "d7789609eae857e910812cf62ae55355b836ad58"
"reference": "71ed6e54e831fd1ced5bae028f0515d277e8c1c1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/roots/sage-lib/zipball/d7789609eae857e910812cf62ae55355b836ad58",
"reference": "d7789609eae857e910812cf62ae55355b836ad58",
"url": "https://api.github.com/repos/roots/sage-lib/zipball/71ed6e54e831fd1ced5bae028f0515d277e8c1c1",
"reference": "71ed6e54e831fd1ced5bae028f0515d277e8c1c1",
"shasum": ""
},
"require": {
"composer/installers": "~1.0",
"illuminate/config": "~5.4",
"illuminate/view": "~5.4",
"php": ">=5.6.4"
"php": ">=7"
},
"require-dev": {
"squizlabs/php_codesniffer": "^2.8.0"
"squizlabs/php_codesniffer": "~3.0"
},
"type": "library",
"autoload": {
@ -774,20 +777,20 @@
"keywords": [
"wordpress"
],
"time": "2017-07-09T11:48:17+00:00"
"time": "2017-08-11T23:38:23+00:00"
},
{
"name": "soberwp/controller",
"version": "dev-master",
"version": "9.0.0-beta.4",
"source": {
"type": "git",
"url": "https://github.com/soberwp/controller.git",
"reference": "e9358ff900d6065f5252a114fb187403fbc594ec"
"reference": "2b6c8450f4a3100b16bfc482c825d89422b6adc6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/soberwp/controller/zipball/e9358ff900d6065f5252a114fb187403fbc594ec",
"reference": "e9358ff900d6065f5252a114fb187403fbc594ec",
"url": "https://api.github.com/repos/soberwp/controller/zipball/2b6c8450f4a3100b16bfc482c825d89422b6adc6",
"reference": "2b6c8450f4a3100b16bfc482c825d89422b6adc6",
"shasum": ""
},
"require": {
@ -826,20 +829,20 @@
"keywords": [
"wordpress"
],
"time": "2017-06-25T13:13:49+00:00"
"time": "2017-08-22T17:35:30+00:00"
},
{
"name": "symfony/debug",
"version": "v3.3.4",
"version": "v3.3.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
"reference": "63b85a968486d95ff9542228dc2e4247f16f9743"
"reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/63b85a968486d95ff9542228dc2e4247f16f9743",
"reference": "63b85a968486d95ff9542228dc2e4247f16f9743",
"url": "https://api.github.com/repos/symfony/debug/zipball/7c13ae8ce1e2adbbd574fc39de7be498e1284e13",
"reference": "7c13ae8ce1e2adbbd574fc39de7be498e1284e13",
"shasum": ""
},
"require": {
@ -882,11 +885,11 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
"time": "2017-07-05T13:02:37+00:00"
"time": "2017-07-28T15:27:31+00:00"
},
{
"name": "symfony/finder",
"version": "v3.3.4",
"version": "v3.3.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
@ -935,16 +938,16 @@
},
{
"name": "symfony/yaml",
"version": "v3.3.4",
"version": "v3.3.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "1f93a8d19b8241617f5074a123e282575b821df8"
"reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/1f93a8d19b8241617f5074a123e282575b821df8",
"reference": "1f93a8d19b8241617f5074a123e282575b821df8",
"url": "https://api.github.com/repos/symfony/yaml/zipball/ddc23324e6cfe066f3dd34a37ff494fa80b617ed",
"reference": "ddc23324e6cfe066f3dd34a37ff494fa80b617ed",
"shasum": ""
},
"require": {
@ -986,7 +989,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2017-06-15T12:58:50+00:00"
"time": "2017-07-23T12:43:26+00:00"
}
],
"packages-dev": [
@ -1096,16 +1099,16 @@
},
{
"name": "roots/sage-installer",
"version": "1.1.0",
"version": "1.3.1",
"source": {
"type": "git",
"url": "https://github.com/roots/sage-installer.git",
"reference": "837411acf1337d35e1b497c4ba3a8ed7cf6077fa"
"reference": "dca019cfa6f1f2cb2e155dfc6574829b80c689b7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/roots/sage-installer/zipball/837411acf1337d35e1b497c4ba3a8ed7cf6077fa",
"reference": "837411acf1337d35e1b497c4ba3a8ed7cf6077fa",
"url": "https://api.github.com/repos/roots/sage-installer/zipball/dca019cfa6f1f2cb2e155dfc6574829b80c689b7",
"reference": "dca019cfa6f1f2cb2e155dfc6574829b80c689b7",
"shasum": ""
},
"require": {
@ -1114,7 +1117,7 @@
"symfony/process": "~3.3"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.0"
"squizlabs/php_codesniffer": "~3.0"
},
"bin": [
"bin/sage"
@ -1151,7 +1154,7 @@
"theme",
"wordpress"
],
"time": "2017-07-04T17:57:47+00:00"
"time": "2017-08-12T00:16:45+00:00"
},
{
"name": "squizlabs/php_codesniffer",
@ -1233,16 +1236,16 @@
},
{
"name": "symfony/console",
"version": "v3.3.4",
"version": "v3.3.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "a97e45d98c59510f085fa05225a1acb74dfe0546"
"reference": "b0878233cb5c4391347e5495089c7af11b8e6201"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/a97e45d98c59510f085fa05225a1acb74dfe0546",
"reference": "a97e45d98c59510f085fa05225a1acb74dfe0546",
"url": "https://api.github.com/repos/symfony/console/zipball/b0878233cb5c4391347e5495089c7af11b8e6201",
"reference": "b0878233cb5c4391347e5495089c7af11b8e6201",
"shasum": ""
},
"require": {
@ -1298,20 +1301,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2017-07-03T13:19:36+00:00"
"time": "2017-07-29T21:27:59+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.4.0",
"version": "v1.5.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "f29dca382a6485c3cbe6379f0c61230167681937"
"reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f29dca382a6485c3cbe6379f0c61230167681937",
"reference": "f29dca382a6485c3cbe6379f0c61230167681937",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7c8fae0ac1d216eb54349e6a8baa57d515fe8803",
"reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803",
"shasum": ""
},
"require": {
@ -1323,7 +1326,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
"dev-master": "1.5-dev"
}
},
"autoload": {
@ -1357,20 +1360,20 @@
"portable",
"shim"
],
"time": "2017-06-09T14:24:12+00:00"
"time": "2017-06-14T15:44:48+00:00"
},
{
"name": "symfony/process",
"version": "v3.3.4",
"version": "v3.3.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "5ab8949b682b1bf9d4511a228b5e045c96758c30"
"reference": "07432804942b9f6dd7b7377faf9920af5f95d70a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/5ab8949b682b1bf9d4511a228b5e045c96758c30",
"reference": "5ab8949b682b1bf9d4511a228b5e045c96758c30",
"url": "https://api.github.com/repos/symfony/process/zipball/07432804942b9f6dd7b7377faf9920af5f95d70a",
"reference": "07432804942b9f6dd7b7377faf9920af5f95d70a",
"shasum": ""
},
"require": {
@ -1406,11 +1409,11 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2017-07-03T08:12:02+00:00"
"time": "2017-07-13T13:05:09+00:00"
},
{
"name": "symfony/translation",
"version": "v3.3.4",
"version": "v3.3.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
@ -1478,12 +1481,12 @@
"minimum-stability": "stable",
"stability-flags": {
"roots/sage-lib": 10,
"soberwp/controller": 20
"soberwp/controller": 10
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=5.6.4"
"php": ">=7"
},
"platform-dev": []
}

6
dist/assets.json vendored

@ -10,7 +10,7 @@
"vendor/fontawesome-webfont.ttf?v=4.7.0": "vendor/fontawesome-webfont_b06871f2.ttf",
"vendor/fontawesome-webfont.woff2?v=4.7.0": "vendor/fontawesome-webfont_af7ae505.woff2",
"vendor/fontawesome-webfont.woff?v=4.7.0": "vendor/fontawesome-webfont_fee66e71.woff",
"scripts/customizer.js": "scripts/customizer_66c3aaba.js",
"styles/main.css": "styles/main_66c3aaba.css",
"scripts/main.js": "scripts/main_66c3aaba.js"
"scripts/customizer.js": "scripts/customizer_9ceb9969.js",
"styles/main.css": "styles/main_9ceb9969.css",
"scripts/main.js": "scripts/main_9ceb9969.js"
}

0
dist/scripts/customizer_66c3aaba.js → dist/scripts/customizer_9ceb9969.js vendored

0
dist/scripts/main_66c3aaba.js → dist/scripts/main_9ceb9969.js vendored

2
dist/styles/main_66c3aaba.css → dist/styles/main_9ceb9969.css vendored

File diff suppressed because one or more lines are too long

10
resources/assets/styles/layouts/_header.scss

@ -54,6 +54,7 @@
}
&.is-active .icon {
// TODO
background: $white;
&::before,
@ -161,16 +162,17 @@
.brand {
align-self: center;
margin-top: 40px;
width: 247px;
height: 38px;
background-size: 247px 38px;
width: 265px;
height: 40px;
background-image: url('../images/logo@2x.png');
background-size: 265px 40px;
}
.primary-navigation {
position: absolute;
width: 100%;
max-width: 1440px;
height: 38px;
height: 40px;
top: 40px;
margin: 0;
display: flex;

10
resources/controllers/Home.php

@ -1,10 +0,0 @@
<?php
namespace App;
use Sober\Controller\Controller;
class Home extends Controller
{
}

12
resources/views/index.blade.php

@ -1,16 +1,18 @@
@extends('layouts.app')
@section('content')
<div class="banner-one"></div>
<div class="banner-two"></div>
@debug('controller')
{{ $sidebar_count }}
@if(is_active_sidebar('home-block-one') && is_active_sidebar('home-block-two'))
<div class="one-two">
@endif
<div class="block one">
<div class="inside">
@if(is_active_sidebar('home-block-one'))
@php(dynamic_sidebar('home-block-one'))
@else
<h3>{{ __('Welcome', 'pressbooks-aldine')}}</h3>
<p>{{ __('Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.', 'pressbooks-aldine')}}</p>
<h3>{{ __('About Pressbooks', 'pressbooks-aldine')}}</h3>
<p>{{ __('Pressbooks is easy-to-use book writing software that lets you create a book in all the formats you need to publish.', 'pressbooks-aldine')}}</p>
@endif
</div>
</div>
@ -21,7 +23,9 @@
</div>
</div>
@endif
@if(is_active_sidebar('home-block-one') && is_active_sidebar('home-block-two'))
</div>
@endif
@if(is_active_sidebar('home-block-three'))
<div class="block three">
<div class="inside">

4
resources/views/partials/header.blade.php

@ -8,8 +8,10 @@
@if(!is_user_logged_in())
<a class="signin" href="{{ wp_login_url() }}">{{ __('Sign in', 'pressbooks-aldine') }}</a>
<span class="sep">/</span>
@endif
<a class="signup" href="{{ network_home_url('/wp-signup.php') }}">{{ __('Sign up', 'pressbooks-aldine') }}</a>
@else
<a class="signin" href="{{ wp_logout_url() }}">{{ __('Sign out', 'pressbooks-aldine') }}</a>
@endif
</nav>
<div class="branding">
<h1><a href="{{ home_url('/') }}">{{ get_bloginfo('name', 'display') }}</a></h1>

Loading…
Cancel
Save