converted index template to blade

started the front end template conversion with the index page
This commit is contained in:
ro 2024-03-14 20:03:46 -06:00
parent a5583debbd
commit ba2e75b186
No known key found for this signature in database
GPG key ID: 29B551CDBD4D3B50
4 changed files with 90 additions and 21 deletions

View file

@ -94,18 +94,30 @@ class ThemeController extends Controller
}
}
public function getView($view)
public function getView($view = 'index')
{
$template = 'fipamo-default-v2.index';
switch ($view) {
case "page":
$template = 'fipamo-default-v2.page';
break;
}
if ($this->auth::status()) {
$page = $this->pages->getById('09E5A362-BA31-4AE2-9DEE-C93DFBE005C3')->first();
$options = $this->sort->page($page);
return view('fipamo-default-v2.base', [
$page = $this->pages->getById('58E3D3DA-E7E4-4396-B4E5-0C30781C2F19')->first();
$data = $this->sort->page($page);
return view($template, [
"debug" => "true",
"theme" => 'fipamo-default-v2',
"status" => $this->auth::status(),
"title" => "THEME PAGE",
"menu" => $data['menu'],
"page" => $page,
"info" => $options['info'],
"info" => $data['info'],
"media" => $data['media'],
"content" => $data['content'],
"recent" => $data['recent'],
"feature" => $data['featured'],
"dynamicRender" => $data['dynamicRender'],
]);
} else {
return redirect('dashboard/start');

View file

@ -163,7 +163,7 @@ class SortingService
}
}
}
//TODO: get rid of if statement and always return recent and featured
if ($page['layout'] == 'index') {
$recent = [];
$featured = [];
@ -223,7 +223,6 @@ class SortingService
'files' => $page['docs'],
];
}
//var_dump($pageOptions);
return $pageOptions;
}
}

View file

@ -41,18 +41,18 @@
@endif
@endforeach
@else
@if($page['media'] != '')
@if($page['media']['type'] == "mp4")
@if($media != '')
@if($media[0]['type'] == "mp4")
<div id="0" role="slide">
<video controls autoplay muted>
<source src="{{$page['media'][0]['file']}}" type="video/mp4">
<source src="{{$media[0]['file']}}" type="video/mp4">
Please get a better browser. They're free.
</video>
</div>
@else
<div id="0" role="slide" style="background: url({{ $page['media'][0]['file'] }}) no-repeat center center / cover"></div>
<div id="0" role="slide" style="background: url({{ $media[0]['file'] }}) no-repeat center center / cover"></div>
@endif
@endif
@endif
@ -65,15 +65,15 @@
</div>
<div class="right">
@if(isset($menu))
@foreach($media as $link)
@foreach($menu as $link)
@if(isset($dynamicRender))
@if($dynamicRender == 'true')
<a href="{{"/".$link['slug']}}" class="menu-link">{{link['title']}}</a><br/>
<a href="{{"/".$link['slug']}}" class="menu-link">{{$link['title']}}</a><br/>
@else
<a href="{{"/".$link['slug'].".html"}}" class="menu-link">{{link['link']}}</a><br/>
<a href="{{"/".$link['slug'].".html"}}" class="menu-link">{{$link['title']}}</a><br/>
@endif
@else
<a href="{{"/".$link['slug'].".html"}}" class="menu-link">{{link['tilte']}}</a><br/>
<a href="{{"/".$link['slug'].".html"}}" class="menu-link">{{$link['title']}}</a><br/>
@endif
@endforeach
@endif
@ -81,7 +81,10 @@
</nav>
</header>
<div id="main-content" class="container">
CONTAINTER BOY BOY
@spaceless
@section('main-content')
@show
@endspaceless
</div>
<footer>

View file

@ -0,0 +1,55 @@
@extends('fipamo-default-v2.base')
@section('title', $title)
@section('main-content')
<article>
<h1>{{ $title }}</h1>
<p>{!!$content!!}</p>
</article>
<section role="page-meta">
<div>
<h2>RECENT</h2>
@foreach($recent as $item)
@if(isset($dynamicRender))
@if($dynamicRender == 'true')
<a href="{{ "/".$item['path']."/".$item['slug'] }}">
{{ $item['title'] }}
</a><br/>
@else
<a href="{{ "/".$item['path']."/".$item['slug'].".html" }}">
{{ $item['title'] }}
</a><br/>
@endif
@else
<a href="{{ "/".$item['path']."/".$item['slug'].".html" }}">
{{ $item['title'] }}
</a><br/>
@endif
@endforeach
</div>
<div>
<h2>FEATURED</h2>
@foreach($feature as $item)
@if(isset($dynamicRender))
@if($dynamicRender == 'true')
<a href="{{ "/".$item['path']."/".$item['slug'] }}">
{{ $item['title'] }}
</a><br/>
@else
<a href="{{ "/".$item['path']."/".$item['slug'].".html" }}">
{{ $item['title'] }}
</a><br/>
@endif
@else
<a href="{{ "/".$item['path']."/".$item['slug'].".html" }}">
{{ $item['title'] }}
</a><br/>
@endif
@endforeach
</div>
</section>
@endsection