Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
sampoyigi committed Oct 5, 2020
2 parents 7de4026 + 344f4c8 commit 11449fb
Show file tree
Hide file tree
Showing 19 changed files with 89 additions and 81 deletions.
8 changes: 0 additions & 8 deletions .gitattributes
Expand Up @@ -4,11 +4,3 @@

# Set the default behavior, in case people don't have core.autocrlf set.
text=auto

# Ignore files when exporting
/.gitattributes export-ignore
/.gitignore export-ignore
.github/ export-ignore
tests/ export-ignore
phpunit.xml export-ignore
phpunit.dusk.xml export-ignore
4 changes: 2 additions & 2 deletions app/admin/formwidgets/MapArea.php
Expand Up @@ -196,8 +196,8 @@ public function getMapShapeAttributes($area)
$areaColor = $this->getAreaColor($area->area_id);

$attributes = [
'data-id' => $area->area_id,
'data-name' => $area->name,
'data-id' => $area->area_id ?? 1,
'data-name' => $area->name ?? '',
'data-default' => $area->type ?? 'address',
'data-color' => $areaColor,
'data-polygon' => $area->boundaries['polygon'] ?? null,
Expand Down
2 changes: 1 addition & 1 deletion app/admin/formwidgets/maparea/assets/js/maparea.js
Expand Up @@ -108,7 +108,7 @@
this.$mapView.mapView('hideShape', areaId).mapView('showShape', areaId, type)
window.setTimeout(function() {
this.$mapView.mapView('resize')
}.bind(this), 200);
}.bind(this), 200);
}
}

Expand Down
@@ -1,7 +1,7 @@
<div class="permission-editor" {!! $field->getAttributes() !!}>
<div class="table-responsive">
<table class="table table-border mb-0">
@foreach ($groupedPermissions as $group => $permission)
@foreach ($groupedPermissions as $group => $permissions)
<thead>
<tr>
<th class="{{ $loop->first ? '' : 'pt-4' }}">
Expand Down
4 changes: 2 additions & 2 deletions app/admin/formwidgets/repeater/repeater.blade.php
Expand Up @@ -23,10 +23,10 @@ class="table {{ ($sortable) ? 'is-sortable' : '' }} mb-0">
</tr>
</thead>
<tbody id="{{ $this->getId('append-to') }}">
@forelse ($this->formWidgets as $widget)
@forelse ($this->formWidgets as $index => $widget)
{!! $this->makePartial('repeater/repeater_item', [
'widget' => $widget,
'indexValue' => $loop->iteration,
'indexValue' => $index,
]) !!}
@empty
<tr class="repeater-item-placeholder">
Expand Down
11 changes: 0 additions & 11 deletions app/admin/widgets/mapview/mapview.blade.php

This file was deleted.

3 changes: 1 addition & 2 deletions app/main/classes/MainController.php
Expand Up @@ -532,7 +532,7 @@ protected function initTemplateEnvironment()

$useCache = TRUE;
if ($useCache) {
$options['cache'] = new FileSystem(storage_path().'/system/templates');
$options['cache'] = new FileSystem(config('view.compiled'));
}

$this->template = new Environment($this->loader, $options);
Expand Down Expand Up @@ -607,7 +607,6 @@ public function renderPartial($name, array $params = [], $throwException = TRUE)
}
// Process Component partial
elseif (strpos($name, '::') !== FALSE) {

if (($partial = $this->loadComponentPartial($name, $throwException)) === FALSE)
return FALSE;

Expand Down
18 changes: 11 additions & 7 deletions app/main/template/ComponentPartial.php
Expand Up @@ -104,9 +104,6 @@ public static function loadOverrideCached($theme, $component, $fileName)
*/
public function find($fileName)
{
if ('' === File::extension($fileName))
$fileName .= '.'.$this->defaultExtension;

$filePath = $this->getFilePath($fileName);

if (!File::isFile($filePath)) {
Expand All @@ -117,7 +114,7 @@ public function find($fileName)
return null;
}

$this->fileName = $fileName;
$this->fileName = File::basename($filePath);
$this->mTime = File::lastModified($filePath);
$this->content = $content;

Expand Down Expand Up @@ -177,15 +174,22 @@ public function getFilePath($fileName = null)
$component = $this->component;
$componentPath = $component->getPath();

if (!File::isFile($path = $componentPath.'/'.$fileName)) {
foreach (['.blade.', '.'] as $part) {
$basename = $fileName;
if (!strlen(File::extension($basename)))
$basename .= $part.$this->defaultExtension;

if (File::isFile($path = $componentPath.'/'.$basename))
return $path;

// Check the shared "/partials" directory for the partial
$sharedPath = dirname($componentPath).'/partials/'.$fileName;
$sharedPath = dirname($componentPath).'/partials/'.$basename;
if (File::isFile($sharedPath)) {
return $sharedPath;
}
}

return $path;
return $componentPath.'/'.$fileName;
}

/**
Expand Down
13 changes: 11 additions & 2 deletions app/main/template/extension/BladeExtension.php
Expand Up @@ -10,9 +10,18 @@ public function getDirectives()
{
return [
'extends' => '@extends directive is not supported. Use theme layouts instead.',
'include' => '@include directive is not supported. Use @partial instead.',
'includeIf' => '@includeIf directive is not supported. Use @partial instead.',
'includeWhen' => '@includeWhen directive is not supported. Use @partial instead.',
'includeUnless' => '@includeUnless directive is not supported. Use @partial instead.',
'includeFirst' => '@includeFirst directive is not supported. Use @partial instead.',
'each' => '@each directive is not supported. Use @partial instead.',
'endcomponent' => '@endcomponent directive is not supported. Use @component instead.',
'componentfirst' => '@componentfirst directive is not supported. Use @component instead.',
'endcomponentfirst' => '@endcomponentfirst directive is not supported. Use @component instead.',
'content' => [$this, 'contentDirective'],
'componentPartial' => [$this, 'componentDirective'],
'hasComponentPartial' => [$this, 'hasComponentDirective'],
'component' => [$this, 'componentDirective'],
'hasComponent' => [$this, 'hasComponentDirective'],
'page' => [$this, 'pageDirective'],
'partial' => [$this, 'partialDirective'],
'placeholder' => [$this, 'placeholderDirective'],
Expand Down
2 changes: 1 addition & 1 deletion app/system/ServiceProvider.php
Expand Up @@ -474,7 +474,7 @@ protected function registerPagicParser()

App::singleton('pagic.environment', function () {
$pagic = new Environment(new Loader, [
'cache' => new FileCache(storage_path().'/system/templates'),
'cache' => new FileCache(config('view.compiled')),
]);

$pagic->addExtension(new BladeExtension());
Expand Down
2 changes: 1 addition & 1 deletion app/system/dashboardwidgets/Cache.php
Expand Up @@ -16,7 +16,7 @@ class Cache extends BaseDashboardWidget

protected static $caches = [
[
'path' => 'system/templates',
'path' => 'framework/views',
'color' => '#2980b9',
],
[
Expand Down
31 changes: 31 additions & 0 deletions themes/demo/_layouts/default.blade.php
@@ -0,0 +1,31 @@
---
description: Default layout
---
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ App::getLocale() }}">
<head>
@partial('head')
</head>
<body class="{{ $this->page->bodyClass }}">
<header id="main-header">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="logo">
<a class="" href="{{ page_url('home') }}">@lang($this->page->title)</a>
</div>
</div>
</div>
</div>
</header>

<div id="page-wrapper" class="content-area">
@page
</div>

<footer id="page-footer">
@partial('footer')
</footer>
<script type="text/javascript" src="{{ asset('app/admin/assets/js/admin.js') }}" id="app-js"></script>
{!! get_script_tags() !!}</body>
</html>
31 changes: 0 additions & 31 deletions themes/demo/_layouts/default.php

This file was deleted.

14 changes: 14 additions & 0 deletions themes/demo/_pages/components.blade.php
@@ -0,0 +1,14 @@
---
title: main::lang.contact.title
layout: default
permalink: /components

'[contact]':
---
<div class="container">
<div class="row">
<div class="col-md-6 m-auto">
@component('contact')
</div>
</div>
</div>
@@ -1,6 +1,7 @@
title = Error page (500)
layout = default
permalink = /error
---
title: Error page (500)
layout: default
permalink: /error
---
<div class="jumbotron">
<div class="container">
Expand Down
Expand Up @@ -9,7 +9,7 @@
<div class="col-sm-8">
<p class="mb-4">This is TastyIgniter's <b>demonstration theme</b> to help you get started if you plan on designing your theme from scratch.</p>
<p class="mb-4">
Navigate to your admin dashboard <a target="_blank" href="<?= admin_url('themes') ?>">(Design > Themes)</a>
Navigate to your admin dashboard <a target="_blank" href="{{ admin_url('themes') }}">(Design > Themes)</a>
to <b>choose from a variety of themes</b> pre-built for you to start receiving orders.
</p>

Expand Down
Expand Up @@ -2,12 +2,12 @@
<div class="container">
<div class="row">
<p class="small mb-0 p-3">
<?= sprintf(
{!! sprintf(
lang('main::lang.site_copyright'),
date('Y'),
setting('site_name'),
lang('system::lang.system_name')
).lang('system::lang.system_powered'); ?>
).lang('system::lang.system_powered') !!}
</p>
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions themes/demo/_partials/head.blade.php
@@ -0,0 +1,6 @@
{!! get_metas() !!}
<link href="{{ theme_url('demo/assets/images/favicon.ico') }}" rel="shortcut icon" type="image/ico">
<title>{{ sprintf(lang('main::lang.site_title'), lang(get_title()), setting('site_name')) }}</title>
<link href="{{ asset('app/admin/assets/css/admin.css') }}" rel="stylesheet" type="text/css" id="flame-css">
{!! get_style_tags() !!}
<link href="{{ theme_url('demo/assets/css/demo.css') }}" rel="stylesheet" type="text/css" id="demo-css">
6 changes: 0 additions & 6 deletions themes/demo/_partials/head.php

This file was deleted.

0 comments on commit 11449fb

Please sign in to comment.