Commit 0b74e276 authored by nirgendswo's avatar nirgendswo

bugfix for viewHelper

update env
parent a4e9cace
......@@ -2,6 +2,6 @@ APP_DEBUG=false
APP_SITE_TITLE="Fuzzy CMS"
APP_THEME=default
APP_THEME=FuzzyCms
APP_LOCALE=en
APP_RSS_TYPES=post
......@@ -104,7 +104,7 @@ class ViewHelper
$result = '';
if (($page->slug === '' && Request::path() === '/') ||
(Request::path() === '/'.route('page.show', ['slug' => $page->slug]))) {
(Request::path() === $page->slug)) {
$result = $class;
}
......@@ -133,6 +133,8 @@ class ViewHelper
/**
* check if $data has a index, and returning him
*
* @TODO maybe create a own helper for forms
*
* @param string $key
* @param array $data
* @return mixed
......@@ -151,6 +153,8 @@ class ViewHelper
/**
* check if $data has a index, and returning checked="checked" as string
*
* @TODO maybe create a own helper for forms
*
* @param string $key
* @param array $data
* @return mixed
......@@ -169,6 +173,8 @@ class ViewHelper
/**
* check if $data has a index, and returning selected="selected" as string
*
* @TODO maybe create a own helper for forms
*
* @param string $key
* @param array $data
* @return mixed
......
<?php
namespace App\Http\Actions;
use Illuminate\Http\Request;
use App\Models\PageModel as Page;
/**
* Abstract to handle put-action
*
*
* @author Björn Hase
*/
abstract class PutActionAbstract implements PostActionInterface
{
/** */
protected $result;
/** */
protected $request;
/** */
protected $page;
/**
*
* @param Page $page
* @param Request $request
*/
public function __construct(Page $page, Request $request)
{
$this->page = $page;
$this->request = $request;
}
/**
*
*
* @return mixed
*/
public function getResult()
{
return $this->result;
}
}
<?php
namespace App\Http\Actions;
/**
* Interface to handle post-action
*
*
* @author Björn Hase
*/
interface PutActionInterface
{
public function process();
}
......@@ -17,11 +17,12 @@
{!! $page->data['title'] !!}
</h1>
<hr>
<div class="grid grid--justify-center">
@foreach($pageRepository->find(
['type' => 'post'],
['parent' => '/blog', 'orderBy' => ['createdAt' => 'asc']]) as $post)
<article class="grid__col-xs-6 grid__col-md-3 grid--justify-center">
<div class="content">
<article class="grid__col-xs-12 grid__col-md-8">
<div class="box">
<h2>
{{ $post->data['title'] }}
</h2>
......@@ -34,6 +35,7 @@
</div>
</article>
@endforeach
</div>
</section>
</div>
</div>
......
......@@ -13,30 +13,34 @@
<div class="grid">
<div class="grid__col-xs-12">
<article class="page">
<h1 class="page__title">
{!! $page->data['title'] !!}
</h1>
<hr>
<header class="page__header">
<h1 class="page__title">
{!! $page->data['title'] !!}
</h1>
<hr>
</header>
<div class="box">
<div class="content" action="#">
<div class="content">
{!! $page->html() !!}
<div class="result">
<dl>
<dt>result['value']</dt><dd>{{ $viewHelper->text('value', $result) }}</dd>
<dt>result['checkbox']</dt><dd>{{ $viewHelper->text('checkbox', $result) }}</dd>
</dl>
</div>
<form id="form" class="form" method="post" action="#form">
<div class="form__field">
<label for="form-input-value">Value</label>
<input id="form-input-value" type="text" name="value" value="{{ $viewHelper->text('value', $result) }}">
</div>
<div class="form__field">
<input id="form-input-checkbox" type="checkbox" name="checkbox" {{ $viewHelper->checkbox('checkbox', $result) }}>
<label for="form-input-checkbox">Checkbox</label>
<div class="code">
<div class="result">
<dl>
<dt>result['value']</dt><dd>{{ $viewHelper->text('value', $result) }}</dd>
<dt>result['checkbox']</dt><dd>{{ $viewHelper->text('checkbox', $result) }}</dd>
</dl>
</div>
<input type="submit">
</form>
<form id="form" class="form" method="post" action="#form">
<div class="form__field">
<label for="form-input-value">Value</label>
<input id="form-input-value" type="text" name="value" value="{{ $viewHelper->text('value', $result) }}">
</div>
<div class="form__field">
<input id="form-input-checkbox" type="checkbox" name="checkbox" {{ $viewHelper->checkbox('checkbox', $result) }}>
<label for="form-input-checkbox">Checkbox</label>
</div>
<input type="submit">
</form>
</div>
</div>
</div>
</article>
......
......@@ -9,16 +9,16 @@
</div>
<div lass="github">
<a class="github-button" href="https://github.com/nirgendswo/fuzzy-cms/fork" data-icon="octicon-repo-forked" data-style="mega" aria-label="Fork nirgendswo/fuzzy-csm on GitHub">Fork</a>
<a class="github-button" href="https://github.com/nirgendswo/fuzzy-csm" data-icon="octicon-star" data-style="mega" aria-label="Star nirgendswo/fuzzy-csm on GitHub">Star</a>
<a class="github-button" href="https://github.com/nirgendswo/fuzzy-csm/archive/master.zip" data-icon="octicon-cloud-download" data-style="mega" aria-label="Download nirgendswo/fuzzy-csm on GitHub">Download</a>
<a class="github-button" href="https://github.com/nirgendswo/fuzzy-csm/issues" data-icon="octicon-issue-opened" data-style="mega" aria-label="Issue nirgendswo/fuzzy-csm on GitHub">Issue</a>
<a class="github-button" href="https://github.com/nirgendswo/fuzzy-cms" data-icon="octicon-star" data-style="mega" aria-label="Star nirgendswo/fuzzy-csm on GitHub">Star</a>
<a class="github-button" href="https://github.com/nirgendswo/fuzzy-cms/archive/master.zip" data-icon="octicon-cloud-download" data-style="mega" aria-label="Download nirgendswo/fuzzy-csm on GitHub">Download</a>
<a class="github-button" href="https://github.com/nirgendswo/fuzzy-cms/issues" data-icon="octicon-issue-opened" data-style="mega" aria-label="Issue nirgendswo/fuzzy-csm on GitHub">Issue</a>
</div>
</div>
</div>
@endsection
@section('content')
<div class="grid">
<section class="grid">
@foreach($pageRepository->find(
['type' => 'feature'],
['parent' => '/features', 'orderBy' => ['order' => 'asc']]) as $feature)
......@@ -31,19 +31,29 @@
</div>
</article>
@endforeach
</div>
<div class="grid">
<div class="grid__col-xs-4">
<h2>Next Features</h2>
</section>
<section class="grid grid--justify-center">
<div class="grid__col-xs-12 grid__col-md-6">
<header class="grid__col-xs-12">
<h2 class="page__title">
Next Features
</h2>
<hr>
</header>
@foreach($pageRepository->find(
['type' => 'next'],
['parent' => '/next', 'orderBy' => ['order' => 'asc']]) as $next)
<article>
<article class="grid__col-xs-12">
<div class="box box--next">
{!! $next->html() !!}
<h3 class="box__title">
{{ $next->data['title'] }} <span class="badge badge--{{ $next->data['state'] }}">{{ $next->data['state'] }}</span>
</h3>
<div class="content">
{!! $next->html() !!}
</div>
</div>
</article>
@endforeach
</div>
</div>
</section>
@endsection
......@@ -30,10 +30,6 @@ $app->group(['middleware' => 'parameters'], function() use ($app) {
'as' => 'page.post', 'uses' => 'PageController@postAction'
]);
$app->put('{slug:[0-9\/a-z,-]+}', [
'as' => 'page.put', 'uses' => 'PageController@putAction'
]);
$app->get('{slug:[0-9\/a-z,-]+}', [
'as' => 'page.show', 'uses' => 'PageController@showAction'
]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment