Replaced Moment with Carbon #84
3 changed files with 22 additions and 8 deletions
|
@ -41,7 +41,7 @@ class RouteController extends Controller
|
|||
case 'theme':
|
||||
if ($this->member::status()) {
|
||||
if (isset($second)) {
|
||||
return $this->theme->getView($third);
|
||||
return $this->theme->getView($third, $fourth);
|
||||
} else {
|
||||
return $this->theme->start();
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ class ThemeController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
public function getView($view = 'index')
|
||||
public function getView($view = 'index', $id = null)
|
||||
{
|
||||
//move assets to theme testing dir
|
||||
$this->assets->moveToTheme();
|
||||
|
@ -53,11 +53,18 @@ class ThemeController extends Controller
|
|||
switch ($view) {
|
||||
case "index":
|
||||
case "page":
|
||||
$view == 'index' ?
|
||||
$template = $currentTheme . '.index' :
|
||||
$page;
|
||||
if ($view == 'index') {
|
||||
$template = $currentTheme . '.index';
|
||||
$page = $this->pages->getBySlug('first');
|
||||
} else {
|
||||
$template = $currentTheme . '.page';
|
||||
//TODO: Get rid of hard link page IDS
|
||||
$page = $this->pages->getById('F791DED9-0359-4662-8976-4C474803D2C6');
|
||||
//if coming from theme page, grabs id of latest page
|
||||
if ($id == null) {
|
||||
$id = $this->getPageID();
|
||||
}
|
||||
$page = $this->pages->getById($id);
|
||||
}
|
||||
$pageData = $this->sort->page($page);
|
||||
break;
|
||||
case "tags":
|
||||
|
@ -71,7 +78,7 @@ class ThemeController extends Controller
|
|||
break;
|
||||
default:
|
||||
$template = $currentTheme . '.index';
|
||||
$page = $this->pages->getById('26245BDB-1A38-4455-80A2-7A03DE26EE33');
|
||||
$page = $this->pages->getBySlug('first');
|
||||
$pageData = $this->sort->page($page);
|
||||
}
|
||||
if ($this->member::status()) {
|
||||
|
@ -80,4 +87,11 @@ class ThemeController extends Controller
|
|||
return redirect('dashboard/start');
|
||||
}
|
||||
}
|
||||
|
||||
private function getPageID()
|
||||
{
|
||||
$book = $this->pages->getAll();
|
||||
$page = $book->where('layout', 'page')->first();
|
||||
return $page['uuid'];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ if(isset($page['uuid']))
|
|||
<svg id="option-published-icon" class="icon">
|
||||
<use id="option-published-icon" xlink:href="/assets/images/global/sprite.svg#entypo-globe"/>
|
||||
</svg>
|
||||
</button><a href="/dashboard/page/preview/{{ $uuid }}" target="_blank"><button id="option-preview" class="option-inactive post-option-btn" data-active="false" title='preview page' aria-label="preview post">
|
||||
</button><a href="/theme/view/page/{{ $uuid }}" target="_blank"><button id="option-preview" class="option-inactive post-option-btn" data-active="false" title='preview page' aria-label="preview post">
|
||||
<svg id="option-preview-icon" class="icon">
|
||||
<use id="option-preview-icon" xlink:href="/assets/images/global/sprite.svg#entypo-eye"/>
|
||||
</svg>
|
||||
|
|
Loading…
Add table
Reference in a new issue