Merge branch 'template_support' into dev
This commit is contained in:
+4
-6
@@ -1,8 +1,7 @@
|
||||
APP_ENV=testing
|
||||
APP_DEBUG=true
|
||||
APP_KEY=ZKZAzM23wQ6BPji6zffBjaTzZ3yW7zKQ
|
||||
APP_ENV=
|
||||
APP_DEBUG=
|
||||
|
||||
DB_HOST=localhost
|
||||
DB_HOST=
|
||||
DB_DATABASE=
|
||||
DB_USERNAME=
|
||||
DB_PASSWORD=
|
||||
@@ -16,5 +15,4 @@ MAIL_PASSWORD=
|
||||
|
||||
SITE_URL=/
|
||||
UPLOAD_URL=/public/uploads
|
||||
THUMBNAILS_URL=/uploads/thumbnails
|
||||
THEME=
|
||||
THUMBNAILS_URL=/uploads/thumbnails
|
||||
+3
-2
@@ -1,8 +1,9 @@
|
||||
# published files from modules
|
||||
/resources/views/modules
|
||||
/public/modules
|
||||
/resources/views/vendor
|
||||
/public/assets
|
||||
/resources/views/modules
|
||||
/resources/views/visitor
|
||||
/resources/views/vendor
|
||||
|
||||
# directories with custom templates
|
||||
**/views/**/custom/*
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Module;
|
||||
use Illuminate\Console\Command;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
class SetTemplate extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'template:set {template}';
|
||||
/**
|
||||
* The console command description.
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Install template';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$template = $this->argument('template');
|
||||
|
||||
$templatePath = app_path('../templates/' . $template);
|
||||
if (!is_dir($templatePath) || !file_exists($templatePath . '/config.php')) {
|
||||
throw new NotFoundHttpException('Invalid template ' . $template . '!');
|
||||
}
|
||||
|
||||
// try to find currently installed template
|
||||
$current = Module::where('is_template', true)
|
||||
->first();
|
||||
|
||||
// install template
|
||||
$config = @include $templatePath . '/config.php';
|
||||
$config['staticName'] = $template;
|
||||
|
||||
if ($current) {
|
||||
$info = json_decode($current->module_settings);
|
||||
|
||||
$this->line('Template is already installed. Currently using template ' . trans($current->name) . ' located in /templates/' . $info->staticName.'.');
|
||||
$confirm = $this->ask('Uninstall it and install *' . trans($config['name']) . '*? All data associated with installed template will be lost! [y/n]');
|
||||
|
||||
if ($confirm === 'y') {
|
||||
$this->line('Uninstalling ' . $current->name . '.');
|
||||
$current->uninstall();
|
||||
} else {
|
||||
$this->line('Aborting installation.');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Module::install($config['name'], $config['alias'], $config['description'], $config['handler'], false, $config);
|
||||
} catch (\Exception $e) {
|
||||
$this->error('Cannot install template ' . $template . '. Message: ' . $e->getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
// theme written
|
||||
$this->line('Template successfully setup.');
|
||||
$this->line('');
|
||||
$this->line(' ** PUBLISHING ASSETS AND VIEWS **');
|
||||
// publish assets and views for module and theme
|
||||
$this->call('vendor:publish', ['--tag' => ['public-assets'], '--force' => true]);
|
||||
$this->call('vendor:publish', ['--tag' => ['module-views'], '--force' => true]);
|
||||
$this->call('vendor:publish');
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Str;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
class SetTheme extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'theme:set {theme_name}';
|
||||
/**
|
||||
* The console command description.
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Set theme for visitor area';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$theme = $this->argument('theme_name');
|
||||
|
||||
if (!is_dir(resource_path('views/visitor/' . $theme))) {
|
||||
throw new NotFoundHttpException('Invalid theme ' . $theme . '!');
|
||||
}
|
||||
|
||||
// load .env file
|
||||
$envFile = base_path('.env');
|
||||
$env = file_get_contents($envFile);
|
||||
|
||||
if (!Str::contains($env, 'THEME=')) {
|
||||
$env = sprintf("%s\nTHEME=%s\n", $env, $theme);
|
||||
} else {
|
||||
$env = preg_replace('/THEME=(.*)/i', 'THEME=' . $theme, $env, -1, $cnt);
|
||||
}
|
||||
|
||||
// try to write content
|
||||
$bytesWritten = file_put_contents($envFile, $env);
|
||||
|
||||
// check if write was successfull
|
||||
if (!$bytesWritten) {
|
||||
throw new \Exception('Cannot write to ' . base_path('.env') . '. Add THEME=' . $theme . ' to your .env file manualy.');
|
||||
}
|
||||
|
||||
// theme written
|
||||
$this->line('Theme successfully setup.');
|
||||
$this->line('');
|
||||
$this->line(' ** PUBLISHING ASSETS AND VIEWS **');
|
||||
// publish assets and views for module and theme
|
||||
$this->call('vendor:publish', ['--tag' => ['public-assets'], '--force' => true]);
|
||||
$this->call('vendor:publish', ['--tag' => ['module-views'], '--force' => true]);
|
||||
$this->call('vendor:publish');
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ class Kernel extends ConsoleKernel
|
||||
Commands\Translations::class,
|
||||
Commands\TranslateAll::class,
|
||||
Commands\InitDatabaseSchema::class,
|
||||
Commands\SetTheme::class,
|
||||
Commands\SetTemplate::class,
|
||||
AddLanguage::class
|
||||
];
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ use App\Models\User;
|
||||
|
||||
interface BaseModuleHandler
|
||||
{
|
||||
public static function getModuleId();
|
||||
// public static function getModuleId();
|
||||
|
||||
/**
|
||||
* Register admin menu (or multiple ones)
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
namespace App\Handlers\Contracts;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use App\Models\Content;
|
||||
use App\Models\Module;
|
||||
|
||||
/**
|
||||
* Interface TemplateHandler
|
||||
*
|
||||
* Inerface used for registering template into CMS core.
|
||||
*
|
||||
* @package App\Handlers\Contracts
|
||||
*/
|
||||
interface TemplateHandler extends BaseModuleHandler
|
||||
{
|
||||
/**
|
||||
* Uninstall template
|
||||
*
|
||||
* Delete some items in database, delete files etc.
|
||||
*
|
||||
* @param Module $template
|
||||
*/
|
||||
public static function uninstall(Module $template);
|
||||
|
||||
/**
|
||||
* Get list of registered templates and supported modules.
|
||||
*
|
||||
* Returned array is expected to be array of arrays with following items: module, namespace and templateName.
|
||||
* Example:
|
||||
* return [
|
||||
* ['module' => 'Article', 'templateName' => 'article::template.name']
|
||||
* ];
|
||||
*
|
||||
* When no "namespace" is specified, value strtolower(module) is used instaed.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getPublicTemplatePaths();
|
||||
|
||||
/**
|
||||
* Prepare Content object to be rendered using Blade template
|
||||
*
|
||||
* @param Content $content
|
||||
*/
|
||||
public static function beforeRender(Content & $content);
|
||||
|
||||
/**
|
||||
* Modify input data into format which can be understood by edit template
|
||||
*
|
||||
* @param Content $content
|
||||
*/
|
||||
public static function beforePopulatingEditForm(Content & $content);
|
||||
|
||||
/**
|
||||
* Slightly modify Content object before saving into database.
|
||||
*
|
||||
* This way we can do almost whatever we want - even in template
|
||||
*
|
||||
* @param Content $content
|
||||
* @param Request $request
|
||||
*/
|
||||
public static function beforeSave(Content & $content, Request $request);
|
||||
}
|
||||
@@ -187,7 +187,6 @@ class TemplateRegistrator
|
||||
$registeredTemplates = Templates::getWithTranslations();
|
||||
|
||||
if (!in_array($templateName, $registeredTemplates)) {
|
||||
|
||||
$params = [
|
||||
'template_name' => $templateName,
|
||||
'name' => $templateName,
|
||||
|
||||
@@ -13,7 +13,7 @@ class Template
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
public static function name($template)
|
||||
public static function name($template, $throwExceptions = true)
|
||||
{
|
||||
$namespace = null;
|
||||
if (strpos($template, '::')) {
|
||||
@@ -21,10 +21,8 @@ class Template
|
||||
$namespace .= '::';
|
||||
}
|
||||
|
||||
$theme = config('app.theme');
|
||||
|
||||
// list of prefixes
|
||||
$prefixes = [$theme . '.custom.', $theme . '.', ''];
|
||||
$prefixes = ['custom.', ''];
|
||||
|
||||
$view = null;
|
||||
foreach ($prefixes as $prefix) {
|
||||
@@ -35,7 +33,11 @@ class Template
|
||||
}
|
||||
|
||||
if (is_null($view)) {
|
||||
throw new InvalidArgumentException('Cannot find template for ' . $namespace . $template);
|
||||
if ($throwExceptions) {
|
||||
throw new InvalidArgumentException('Cannot find template for ' . $namespace . $template);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return $view;
|
||||
@@ -59,6 +61,13 @@ class Template
|
||||
return config('app.upload_url') . '/' . $filename;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get path to given asset
|
||||
*
|
||||
* @param $path
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function asset($path)
|
||||
{
|
||||
if (env('APP_DEBUG')) {
|
||||
@@ -75,6 +84,14 @@ class Template
|
||||
return config('app.url') . '/assets/' . config('app.theme') . '/' . $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print date in configured format
|
||||
*
|
||||
* @param $datestamp
|
||||
* @param bool $withTime
|
||||
*
|
||||
* @return false|string
|
||||
*/
|
||||
public static function date($datestamp, $withTime = true)
|
||||
{
|
||||
$timestamp = strtotime($datestamp);
|
||||
|
||||
@@ -14,6 +14,7 @@ use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
|
||||
use Modules\Categories\Entities\Category;
|
||||
use Pingpong\Modules\Facades\Module as ModuleInstance;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
class CreateNewContent extends Controller
|
||||
{
|
||||
/**
|
||||
@@ -87,6 +88,9 @@ class CreateNewContent extends Controller
|
||||
public function postNew(CreateNewContentRequest $request, $moduleId)
|
||||
{
|
||||
$page = new Content();
|
||||
$template = Module::where('is_template', true)
|
||||
->where('enabled', true)
|
||||
->first();
|
||||
try {
|
||||
$module = Module::findOrFail($moduleId);
|
||||
} catch (NotFoundHttpException $e) {
|
||||
@@ -120,6 +124,10 @@ class CreateNewContent extends Controller
|
||||
|
||||
$page->title_photo = $file ? $file['filename'] : null;
|
||||
|
||||
// let template to modify request and content page
|
||||
|
||||
call_user_func_array([$template->handler, 'beforeSave'], [&$page, $request]);
|
||||
|
||||
// save module-specific stuff
|
||||
call_user_func_array([$module->handler, 'createNew'], [&$page, $request]);
|
||||
|
||||
|
||||
@@ -56,23 +56,32 @@ class EditContent extends Controller
|
||||
$page = Content::findOrFail($id);
|
||||
$page->module_settings = json_decode($page->module_settings);
|
||||
|
||||
$allModules = ModulesHandlerToId::getWithTranslations();
|
||||
$moduleId = $allModules[$page->module_handler];
|
||||
$module = Module::findOrFail($moduleId);
|
||||
// select template
|
||||
$template = Module::where('is_template', true)
|
||||
->where('enabled', true)
|
||||
->first();
|
||||
|
||||
// get module ID
|
||||
$module = Module::where('handler', $page->module_handler)->firstOrFail();
|
||||
|
||||
$templates = Template::where('module_id', $moduleId)
|
||||
// get all Blade templates for rendering page
|
||||
$templates = Template::where('module_id', $module->id)
|
||||
->select(['template_name', 'name', 'description'])
|
||||
->get();
|
||||
|
||||
// get module for Categories - PingPong module
|
||||
$categoryModule = ModuleInstance::get('categories');
|
||||
|
||||
// add categories, if supported
|
||||
$categories = [];
|
||||
if ($module->support_categories && $categoryModule->enabled()) {
|
||||
$categories = Category::where('module_id', $moduleId)
|
||||
$categories = Category::where('module_id', $module->id)
|
||||
->get();
|
||||
}
|
||||
|
||||
// modify data for edit form according to installed template
|
||||
call_user_func_array([$template->handler, 'beforePopulatingEditForm'], [&$page]);
|
||||
|
||||
$history = $this->history->getStructuredHistoryOf($page);
|
||||
|
||||
// render view
|
||||
@@ -107,6 +116,10 @@ class EditContent extends Controller
|
||||
* @var $page Content
|
||||
*/
|
||||
$page = Content::findOrFail($id);
|
||||
|
||||
$template = Module::where('is_template', true)
|
||||
->where('enabled', true)
|
||||
->first();
|
||||
} catch (NotFoundHttpException $e) {
|
||||
|
||||
// log attempt of invalid edit
|
||||
@@ -121,6 +134,9 @@ class EditContent extends Controller
|
||||
// upload file - if provided
|
||||
$file = $page->uploadTitlePhoto($request);
|
||||
|
||||
// let template to modify request and content page
|
||||
call_user_func_array([$template->handler, 'beforeSave'], [&$page, $request]);
|
||||
|
||||
$request->url = Str::slug($request->url);
|
||||
$request->parentPage = $request->parentPage ? $request->parentPage : null;
|
||||
|
||||
|
||||
@@ -79,6 +79,13 @@ class EditWidget extends Controller
|
||||
// create new widget
|
||||
$widget = Widget::findOrFail($id);
|
||||
|
||||
// check if widget area is deletable
|
||||
if (!$widget->deletable) {
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', trans('admin/widgets.notDeletable'));
|
||||
}
|
||||
|
||||
$widget->delete();
|
||||
|
||||
// redirect with success notification
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests;
|
||||
use App\Http\Requests\EditWidgetAreaRequest;
|
||||
use App\Models\WidgetArea;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
@@ -61,6 +60,13 @@ class EditWidgetArea extends Controller
|
||||
return $this->invalidArea();
|
||||
}
|
||||
|
||||
// check if widget area is deletable
|
||||
if (!$area->deletable) {
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', trans('admin/widgetAreas.notDeletableArea'));
|
||||
}
|
||||
|
||||
// delete area
|
||||
$area->delete();
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ namespace App\Http\Controllers\Visitor;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests;
|
||||
use App\Models\Content;
|
||||
use App\Models\Module;
|
||||
use App\Models\Template;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class ContentPage extends Controller
|
||||
@@ -59,6 +61,11 @@ class ContentPage extends Controller
|
||||
// get handler
|
||||
$handler = new $page->module_handler;
|
||||
|
||||
$template = Module::where('is_template', true)->where('enabled', true)->first();
|
||||
|
||||
// do something template-specific
|
||||
call_user_func_array([$template->handler, 'beforeRender'], [&$page]);
|
||||
|
||||
// render page
|
||||
return $handler->render($page, '');
|
||||
}
|
||||
|
||||
+51
-3
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Handlers\Contracts\TemplateHandler;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\App;
|
||||
|
||||
@@ -20,7 +21,8 @@ class Module extends Model
|
||||
'module_settings',
|
||||
'enabled',
|
||||
'support_categories',
|
||||
'manages_content'
|
||||
'manages_content',
|
||||
'is_template'
|
||||
];
|
||||
protected $guarded = [];
|
||||
|
||||
@@ -45,6 +47,7 @@ class Module extends Model
|
||||
}
|
||||
|
||||
$managesContent = $handler ? in_array('App\Handlers\Contracts\AppHandler', class_implements($handler)) : false;
|
||||
$isTemplate = $handler ? in_array(TemplateHandler::class, class_implements($handler)) : false;
|
||||
$supportCategories = $managesContent ? call_user_func([$handler, 'supportCategories']) : false;
|
||||
|
||||
if ($parentModuleId) {
|
||||
@@ -62,8 +65,9 @@ class Module extends Model
|
||||
'support_categories' => $supportCategories,
|
||||
'alias' => $alias,
|
||||
'module_settings' => json_encode($settings),
|
||||
'parent_id' => $parentModuleId,
|
||||
'enabled' => 1
|
||||
'parent_id' => $parentModuleId ? $parentModuleId : null,
|
||||
'enabled' => 1,
|
||||
'is_template' => $isTemplate
|
||||
]);
|
||||
|
||||
// install something module-specific
|
||||
@@ -73,4 +77,48 @@ class Module extends Model
|
||||
|
||||
return $module;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete module from database and uninstall its dependencies
|
||||
*
|
||||
* @throws \ErrorException
|
||||
*/
|
||||
public function uninstall()
|
||||
{
|
||||
// check if user does not want to install module in runtime
|
||||
if (!App::runningInConsole()) {
|
||||
throw new \ErrorException('Modules can be uninstalled only via Artisan!');
|
||||
}
|
||||
|
||||
// delete everything in /resources/views/visitor
|
||||
if ($this->is_template) {
|
||||
$this->deleteDirectory(resource_path('views/visitor'));
|
||||
$this->deleteDirectory(public_path('assets'));
|
||||
|
||||
// delete all template paths
|
||||
TemplatePath::getQuery()->delete();
|
||||
}
|
||||
|
||||
if ($this->handler && is_callable([$this->handler, 'uninstall'])) {
|
||||
call_user_func([$this->handler, 'uninstall'], $this);
|
||||
}
|
||||
|
||||
$this->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete directory when uninstalling module.
|
||||
*
|
||||
* @param $directory
|
||||
*
|
||||
* @throws \ErrorException
|
||||
*/
|
||||
private function deleteDirectory($directory)
|
||||
{
|
||||
$success = \File::deleteDirectory($directory, true);
|
||||
|
||||
if (!$success) {
|
||||
throw new \ErrorException('Cannot delete ' . $directory);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,8 +30,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
// ignore running from artisan
|
||||
if (App::runningInConsole()) {
|
||||
$this->publishViewResources();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -39,13 +37,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
$this->registerTemplates();
|
||||
$this->registerSettings();
|
||||
$this->registerSearch();
|
||||
|
||||
// check if given template is valid
|
||||
$theme = config('app.theme');
|
||||
$themeDir = resource_path('views/visitor/' . $theme);
|
||||
if (!$theme || empty($theme) || !is_dir($themeDir)) {
|
||||
throw new InvalidArgumentException('No or invalid theme set! Use artisan theme:set or edit .env file manually and include THEME option, please');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,10 +111,10 @@ class AppServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* @var $registrator TemplateRegistrator
|
||||
*/
|
||||
$registrator = $this->app->make('registerTemplateDir');
|
||||
$registrator->setBaseDirectory('resources/views/visitor');
|
||||
// $registrator = $this->app->make('registerTemplateDir');
|
||||
// $registrator->setBaseDirectory('resources/views/visitor');
|
||||
|
||||
$registrator->register(config('app.theme'), 'admin/templates.core');
|
||||
// $registrator->register(config('app.theme'), 'admin/templates.core');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -150,37 +141,5 @@ class AppServiceProvider extends ServiceProvider
|
||||
$registrator->register(new Files(), new AdminFiles(), SearchEngineRegistrator::ADMIN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Publish all public assets from all themes
|
||||
*/
|
||||
private function publishViewResources()
|
||||
{
|
||||
$theme = config('app.theme');
|
||||
$themeDir = resource_path('views/visitor/' . $theme);
|
||||
|
||||
// publish assets if exists for current theme
|
||||
if (is_dir($themeDir . '/' . Template::ASSETS_DIRECTORY)) {
|
||||
$this->publishes([$themeDir . '/' . Template::ASSETS_DIRECTORY => public_path('assets/' . $theme)], 'public-assets');
|
||||
}
|
||||
|
||||
if (is_dir($themeDir . '/' . Template::MODULES_DIRECTORY)) {
|
||||
$this->publishModuleViews($themeDir . '/' . Template::MODULES_DIRECTORY);
|
||||
}
|
||||
}
|
||||
|
||||
private function publishModuleViews($themeModules)
|
||||
{
|
||||
$theme = config('app.theme');
|
||||
$modules = File::directories($themeModules);
|
||||
|
||||
$moduleViews = [];
|
||||
foreach ($modules as $module) {
|
||||
$moduleName = strtolower(basename($module));
|
||||
$moduleViews[$module] = resource_path('views/modules/' . $moduleName . '/visitor/' . $theme);
|
||||
}
|
||||
|
||||
if (!empty($moduleViews)) {
|
||||
$this->publishes($moduleViews, 'module-views');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,18 +5,13 @@ use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
|
||||
use Symfony\Component\Translation\Translator;
|
||||
|
||||
class LaravelLocalizationServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function register()
|
||||
{
|
||||
try {
|
||||
$languages = DB::table('languages')
|
||||
->get();
|
||||
} catch (\Exception $e) {
|
||||
$languages = [];
|
||||
}
|
||||
$languages = DB::table('languages')
|
||||
->get();
|
||||
|
||||
$supportedLocales = [];
|
||||
if (empty($languages)) {
|
||||
@@ -28,11 +23,7 @@ class LaravelLocalizationServiceProvider extends ServiceProvider
|
||||
];
|
||||
|
||||
// create default language
|
||||
try {
|
||||
Language::create($supportedLocales[config('app.locale')]);
|
||||
} catch (\Exception $e) {
|
||||
// ignore, table languages probably does not exist.
|
||||
}
|
||||
Language::create($supportedLocales[config('app.locale')]);
|
||||
}
|
||||
|
||||
foreach ($languages as $language) {
|
||||
|
||||
@@ -21,7 +21,8 @@ class ModuleManager extends ServiceProvider
|
||||
}
|
||||
|
||||
// this service provider needs published config - config is merged right after this service provider
|
||||
$modules = Module::get();
|
||||
$modules = Module::where('is_template', false)
|
||||
->get();
|
||||
|
||||
// iterate over all modules and enable or disable them
|
||||
foreach ($modules as $module) {
|
||||
@@ -58,7 +59,7 @@ class ModuleManager extends ServiceProvider
|
||||
|
||||
// check if module config is writable
|
||||
if (!is_writable(dirname($path))) {
|
||||
Log::warning('Cannot write to '.$path);
|
||||
Log::warning('Cannot write to ' . $path);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Handlers\Registrators\TemplateRegistrator;
|
||||
use App\Models\Module;
|
||||
use App\Models\Template;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use InvalidArgumentException;
|
||||
|
||||
class TemplateServiceProvider extends ServiceProvider
|
||||
{
|
||||
private function getTemplate()
|
||||
{
|
||||
// select template
|
||||
$template = Module::where('is_template', true)
|
||||
->where('enabled', true)
|
||||
->first();
|
||||
|
||||
if ($template) {
|
||||
$template->settings = json_decode($template->module_settings);
|
||||
}
|
||||
|
||||
return $template;
|
||||
}
|
||||
|
||||
public function boot()
|
||||
{
|
||||
// ignore running from artisan
|
||||
if (App::runningInConsole()) {
|
||||
$this->publishViewResources();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$template = $this->getTemplate();
|
||||
|
||||
if (!$template) {
|
||||
throw new \ErrorException('Template is not set, cannot continue');
|
||||
}
|
||||
|
||||
// include files
|
||||
$files = isset($template->settings->files) ? $template->settings->files : [];
|
||||
|
||||
foreach ($files as $file) {
|
||||
include_once $file;
|
||||
}
|
||||
|
||||
// register templates
|
||||
$publicTemplates = call_user_func([$template->handler, 'getPublicTemplatePaths']);
|
||||
|
||||
if (!is_array($publicTemplates)) {
|
||||
throw new \ErrorException($template->handler . '::getPublicTemplatePaths() must return array!');
|
||||
}
|
||||
|
||||
if (empty($publicTemplates)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var $registrator TemplateRegistrator
|
||||
*/
|
||||
$registrator = $this->app->make('registerTemplateDir');
|
||||
foreach ($publicTemplates as $template) {
|
||||
// setup some global variables
|
||||
$module = strtolower($template['module']);
|
||||
$namespace = isset($template['namespace']) ? $template['namespace'] : strtolower($template['module']);
|
||||
try {
|
||||
$registrator->setBaseDirectory('resources/views/modules/' . $module);
|
||||
$registrator->setNamespace($namespace);
|
||||
$registrator->setModuleId(call_user_func([config($module . '.handler'), 'getModuleId']));
|
||||
|
||||
// register path with current template name
|
||||
$registrator->register('visitor', $template['templateName']);
|
||||
} catch (InvalidArgumentException $e) {
|
||||
// ignore this exception
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Publish all public assets from all themes
|
||||
*/
|
||||
private function publishViewResources()
|
||||
{
|
||||
$template = $this->getTemplate();
|
||||
if (!$template) {
|
||||
return;
|
||||
}
|
||||
|
||||
$templateDir = app_path('../templates/' . $template->settings->staticName . '/Resources');
|
||||
$assetsDir = $templateDir . '/' . Template::ASSETS_DIRECTORY;
|
||||
$viewsDir = $templateDir . '/views';
|
||||
|
||||
// publish assets if exists for current theme
|
||||
if (is_dir($assetsDir)) {
|
||||
$this->publishes([$assetsDir => public_path('assets/visitor')], 'public-assets');
|
||||
}
|
||||
|
||||
// publish base visitors views
|
||||
$this->publishes([$viewsDir . '/visitor' => resource_path('views/visitor')], 'module-views');
|
||||
|
||||
// publish admin views
|
||||
if (is_dir($viewsDir . '/modules')) {
|
||||
$this->publishes([$viewsDir . '/modules' => resource_path('views/modules')], 'module-views');
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -30,7 +30,8 @@
|
||||
],
|
||||
"psr-4": {
|
||||
"App\\": "app/",
|
||||
"Modules\\": "modules/"
|
||||
"Modules\\": "modules/",
|
||||
"Templates\\": "templates/"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
+77
-77
@@ -129,49 +129,49 @@ return [
|
||||
|
||||
'providers' => [
|
||||
|
||||
/*
|
||||
* Laravel Framework Service Providers...
|
||||
*/
|
||||
Illuminate\Auth\AuthServiceProvider::class,
|
||||
Illuminate\Broadcasting\BroadcastServiceProvider::class,
|
||||
Illuminate\Bus\BusServiceProvider::class,
|
||||
Illuminate\Cache\CacheServiceProvider::class,
|
||||
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
|
||||
Illuminate\Cookie\CookieServiceProvider::class,
|
||||
Illuminate\Database\DatabaseServiceProvider::class,
|
||||
Illuminate\Encryption\EncryptionServiceProvider::class,
|
||||
Illuminate\Filesystem\FilesystemServiceProvider::class,
|
||||
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
|
||||
Illuminate\Hashing\HashServiceProvider::class,
|
||||
Illuminate\Mail\MailServiceProvider::class,
|
||||
Illuminate\Pagination\PaginationServiceProvider::class,
|
||||
Illuminate\Pipeline\PipelineServiceProvider::class,
|
||||
Illuminate\Queue\QueueServiceProvider::class,
|
||||
Illuminate\Redis\RedisServiceProvider::class,
|
||||
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
|
||||
Illuminate\Session\SessionServiceProvider::class,
|
||||
Illuminate\Translation\TranslationServiceProvider::class,
|
||||
Illuminate\Validation\ValidationServiceProvider::class,
|
||||
Illuminate\View\ViewServiceProvider::class,
|
||||
Mcamara\LaravelLocalization\LaravelLocalizationServiceProvider::class,
|
||||
// this class must be before ModulesServiceProvider from PingPong, because it handles files module.json
|
||||
App\Providers\ModuleManager::class,
|
||||
Pingpong\Modules\ModulesServiceProvider::class,
|
||||
Pingpong\Menus\MenusServiceProvider::class,
|
||||
App\Providers\SubmodulesManager::class,
|
||||
/*
|
||||
* Laravel Framework Service Providers...
|
||||
*/
|
||||
Illuminate\Auth\AuthServiceProvider::class,
|
||||
Illuminate\Broadcasting\BroadcastServiceProvider::class,
|
||||
Illuminate\Bus\BusServiceProvider::class,
|
||||
Illuminate\Cache\CacheServiceProvider::class,
|
||||
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
|
||||
Illuminate\Cookie\CookieServiceProvider::class,
|
||||
Illuminate\Database\DatabaseServiceProvider::class,
|
||||
Illuminate\Encryption\EncryptionServiceProvider::class,
|
||||
Illuminate\Filesystem\FilesystemServiceProvider::class,
|
||||
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
|
||||
Illuminate\Hashing\HashServiceProvider::class,
|
||||
Illuminate\Mail\MailServiceProvider::class,
|
||||
Illuminate\Pagination\PaginationServiceProvider::class,
|
||||
Illuminate\Pipeline\PipelineServiceProvider::class,
|
||||
Illuminate\Queue\QueueServiceProvider::class,
|
||||
Illuminate\Redis\RedisServiceProvider::class,
|
||||
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
|
||||
Illuminate\Session\SessionServiceProvider::class,
|
||||
Illuminate\Translation\TranslationServiceProvider::class,
|
||||
Illuminate\Validation\ValidationServiceProvider::class,
|
||||
Illuminate\View\ViewServiceProvider::class,
|
||||
Mcamara\LaravelLocalization\LaravelLocalizationServiceProvider::class,
|
||||
// this class must be before ModulesServiceProvider from PingPong, because it handles files module.json
|
||||
App\Providers\ModuleManager::class,
|
||||
Pingpong\Modules\ModulesServiceProvider::class,
|
||||
Pingpong\Menus\MenusServiceProvider::class,
|
||||
App\Providers\SubmodulesManager::class,
|
||||
Franzose\ClosureTable\ClosureTableServiceProvider::class,
|
||||
\Watson\Sitemap\SitemapServiceProvider::class,
|
||||
/*
|
||||
* Application Service Providers...
|
||||
*/
|
||||
App\Providers\AppServiceProvider::class,
|
||||
App\Providers\AuthServiceProvider::class,
|
||||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
App\Providers\GlobalViewDataProvider::class,
|
||||
\App\Providers\TemplateServiceProvider::class,
|
||||
|
||||
Franzose\ClosureTable\ClosureTableServiceProvider::class,
|
||||
\Watson\Sitemap\SitemapServiceProvider::class,
|
||||
/*
|
||||
* Application Service Providers...
|
||||
*/
|
||||
App\Providers\AppServiceProvider::class,
|
||||
App\Providers\AuthServiceProvider::class,
|
||||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
App\Providers\GlobalViewDataProvider::class,
|
||||
|
||||
],
|
||||
],
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Class Aliases
|
||||
@@ -185,41 +185,41 @@ return [
|
||||
|
||||
'aliases' => [
|
||||
|
||||
'App' => Illuminate\Support\Facades\App::class,
|
||||
'Artisan' => Illuminate\Support\Facades\Artisan::class,
|
||||
'Auth' => Illuminate\Support\Facades\Auth::class,
|
||||
'Blade' => Illuminate\Support\Facades\Blade::class,
|
||||
'Cache' => Illuminate\Support\Facades\Cache::class,
|
||||
'Config' => Illuminate\Support\Facades\Config::class,
|
||||
'Cookie' => Illuminate\Support\Facades\Cookie::class,
|
||||
'Crypt' => Illuminate\Support\Facades\Crypt::class,
|
||||
'DB' => Illuminate\Support\Facades\DB::class,
|
||||
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
|
||||
'Event' => Illuminate\Support\Facades\Event::class,
|
||||
'File' => Illuminate\Support\Facades\File::class,
|
||||
'Gate' => Illuminate\Support\Facades\Gate::class,
|
||||
'Hash' => Illuminate\Support\Facades\Hash::class,
|
||||
'Lang' => Illuminate\Support\Facades\Lang::class,
|
||||
'Log' => Illuminate\Support\Facades\Log::class,
|
||||
'Mail' => Illuminate\Support\Facades\Mail::class,
|
||||
'Menu' => Pingpong\Menus\MenuFacade::class,
|
||||
'Module' => Pingpong\Modules\Facades\Module::class,
|
||||
'Password' => Illuminate\Support\Facades\Password::class,
|
||||
'Queue' => Illuminate\Support\Facades\Queue::class,
|
||||
'Redirect' => Illuminate\Support\Facades\Redirect::class,
|
||||
'Redis' => Illuminate\Support\Facades\Redis::class,
|
||||
'Request' => Illuminate\Support\Facades\Request::class,
|
||||
'Response' => Illuminate\Support\Facades\Response::class,
|
||||
'Route' => Illuminate\Support\Facades\Route::class,
|
||||
'Schema' => Illuminate\Support\Facades\Schema::class,
|
||||
'Session' => Illuminate\Support\Facades\Session::class,
|
||||
'Sitemap' => Watson\Sitemap\Facades\Sitemap::class,
|
||||
'Storage' => Illuminate\Support\Facades\Storage::class,
|
||||
'URL' => Illuminate\Support\Facades\URL::class,
|
||||
'Validator' => Illuminate\Support\Facades\Validator::class,
|
||||
'LaravelLocalization' => Mcamara\LaravelLocalization\Facades\LaravelLocalization::class,
|
||||
'View' => Illuminate\Support\Facades\View::class,
|
||||
'App' => Illuminate\Support\Facades\App::class,
|
||||
'Artisan' => Illuminate\Support\Facades\Artisan::class,
|
||||
'Auth' => Illuminate\Support\Facades\Auth::class,
|
||||
'Blade' => Illuminate\Support\Facades\Blade::class,
|
||||
'Cache' => Illuminate\Support\Facades\Cache::class,
|
||||
'Config' => Illuminate\Support\Facades\Config::class,
|
||||
'Cookie' => Illuminate\Support\Facades\Cookie::class,
|
||||
'Crypt' => Illuminate\Support\Facades\Crypt::class,
|
||||
'DB' => Illuminate\Support\Facades\DB::class,
|
||||
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
|
||||
'Event' => Illuminate\Support\Facades\Event::class,
|
||||
'File' => Illuminate\Support\Facades\File::class,
|
||||
'Gate' => Illuminate\Support\Facades\Gate::class,
|
||||
'Hash' => Illuminate\Support\Facades\Hash::class,
|
||||
'Lang' => Illuminate\Support\Facades\Lang::class,
|
||||
'Log' => Illuminate\Support\Facades\Log::class,
|
||||
'Mail' => Illuminate\Support\Facades\Mail::class,
|
||||
'Menu' => Pingpong\Menus\MenuFacade::class,
|
||||
'Module' => Pingpong\Modules\Facades\Module::class,
|
||||
'Password' => Illuminate\Support\Facades\Password::class,
|
||||
'Queue' => Illuminate\Support\Facades\Queue::class,
|
||||
'Redirect' => Illuminate\Support\Facades\Redirect::class,
|
||||
'Redis' => Illuminate\Support\Facades\Redis::class,
|
||||
'Request' => Illuminate\Support\Facades\Request::class,
|
||||
'Response' => Illuminate\Support\Facades\Response::class,
|
||||
'Route' => Illuminate\Support\Facades\Route::class,
|
||||
'Schema' => Illuminate\Support\Facades\Schema::class,
|
||||
'Session' => Illuminate\Support\Facades\Session::class,
|
||||
'Sitemap' => Watson\Sitemap\Facades\Sitemap::class,
|
||||
'Storage' => Illuminate\Support\Facades\Storage::class,
|
||||
'URL' => Illuminate\Support\Facades\URL::class,
|
||||
'Validator' => Illuminate\Support\Facades\Validator::class,
|
||||
'LaravelLocalization' => Mcamara\LaravelLocalization\Facades\LaravelLocalization::class,
|
||||
'View' => Illuminate\Support\Facades\View::class,
|
||||
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class SaveTemplatesIntoModulesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('modules', function (Blueprint $table){
|
||||
$table->boolean('is_template')->default(false)->comment('Templates can be treated as modules.');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('modules', function (Blueprint $table){
|
||||
$table->dropColumn('is_template');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddTemplateSupportToWidgets extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('widget_types', function (Blueprint $table) {
|
||||
$table->integer('template_id')
|
||||
->comment('Commes this widget with template?')
|
||||
->after('handler')
|
||||
->nullable(true)
|
||||
->default(null);
|
||||
$table->integer('module_id')
|
||||
->comment('Commes this widget with some module?')
|
||||
->after('template_id')
|
||||
->nullable(true)
|
||||
->default(null);
|
||||
|
||||
$table->foreign('template_id')
|
||||
->references('id')
|
||||
->on('modules')
|
||||
->onDelete('cascade')
|
||||
->onUpdate('cascade');
|
||||
|
||||
$table->foreign('module_id')
|
||||
->references('id')
|
||||
->on('modules')
|
||||
->onDelete('cascade')
|
||||
->onUpdate('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('widget_types', function (Blueprint $table) {
|
||||
$table->dropForeign('widget_types_module_id_foreign');
|
||||
$table->dropForeign('widget_types_template_id_foreign');
|
||||
$table->dropColumn(['template_id', 'module_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class MakeWidgetsAndWidgetAreasNotDeletable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('widgets', function (Blueprint $table) {
|
||||
$table->boolean('deletable')
|
||||
->default(true)
|
||||
->comment('Can this widget be deleted?');
|
||||
});
|
||||
|
||||
Schema::table('widget_areas', function (Blueprint $table) {
|
||||
$table->boolean('deletable')
|
||||
->default(true)
|
||||
->comment('Can this widget area be deleted?');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('widgets', function (Blueprint $table) {
|
||||
$table->dropColumn('deletable');
|
||||
});
|
||||
|
||||
Schema::table('widget_areas', function (Blueprint $table) {
|
||||
$table->dropColumn('deletable');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -62,22 +62,6 @@ class ArticleServiceProvider extends ServiceProvider {
|
||||
$this->loadViewsFrom(array_merge(array_map(function ($path) {
|
||||
return $path . '/modules/article';
|
||||
}, \Config::get('view.paths')), [$sourcePath]), 'article');
|
||||
|
||||
/**
|
||||
* @var $registrator TemplateRegistrator
|
||||
*/
|
||||
try {
|
||||
// setup some global variables
|
||||
$registrator = $this->app->make('registerTemplateDir');
|
||||
$registrator->setBaseDirectory('resources/views/modules/article/visitor');
|
||||
$registrator->setNamespace('article');
|
||||
$registrator->setModuleId(Article::getModuleId());
|
||||
|
||||
// register path with current template name
|
||||
$registrator->register(config('app.theme'), 'article::admin/adminMenu.templatePath');
|
||||
} catch (InvalidArgumentException $e) {
|
||||
// ignore this exception
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -62,22 +62,6 @@ class ContactFormServiceProvider extends ServiceProvider
|
||||
$this->loadViewsFrom(array_merge(array_map(function ($path) {
|
||||
return $path . '/modules/contactform';
|
||||
}, \Config::get('view.paths')), [$sourcePath]), 'contactform');
|
||||
|
||||
/**
|
||||
* @var $registrator TemplateRegistrator
|
||||
*/
|
||||
$registrator = $this->app->make('registerTemplateDir');
|
||||
try {
|
||||
// setup some global variables
|
||||
$registrator->setBaseDirectory('resources/views/modules/contactform/visitor');
|
||||
$registrator->setNamespace('contactform');
|
||||
$registrator->setModuleId(call_user_func([config('contactform.handler'), 'getModuleId']));
|
||||
|
||||
// register path with current template name
|
||||
$registrator->register(config('app.theme'), 'contactform::admin/adminMenu.templatePath');
|
||||
} catch (InvalidArgumentException $e) {
|
||||
// ignore this exception
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -62,22 +62,6 @@ class GalleryServiceProvider extends ServiceProvider
|
||||
$this->loadViewsFrom(array_merge(array_map(function ($path) {
|
||||
return $path.'/modules/gallery';
|
||||
}, \Config::get('view.paths')), [$sourcePath]), 'gallery');
|
||||
|
||||
/**
|
||||
* @var $registrator TemplateRegistrator
|
||||
*/
|
||||
$registrator = $this->app->make('registerTemplateDir');
|
||||
try {
|
||||
// setup some global variables
|
||||
$registrator->setBaseDirectory('resources/views/modules/gallery/visitor');
|
||||
$registrator->setNamespace('gallery');
|
||||
$registrator->setModuleId(call_user_func([config('gallery.handler'), 'getModuleId']));
|
||||
|
||||
// register path with current template name
|
||||
$registrator->register(config('app.theme'), 'gallery::admin/adminMenu.templatePath');
|
||||
} catch (InvalidArgumentException $e) {
|
||||
// ignore this exception
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,18 +38,6 @@ class StaticPagesServiceProvider extends ServiceProvider
|
||||
{
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Method for installing module into database
|
||||
// */
|
||||
// protected function install()
|
||||
// {
|
||||
// $handler = config('staticpages.handler');
|
||||
// $installedModules = ModulesHandlerToId::getWithTranslations();
|
||||
// if (!isset($installedModules[$handler])) {
|
||||
// Module::install('staticpages::module.name', 'staticpages', 'staticpages::module.description');
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* Register config.
|
||||
*
|
||||
@@ -69,30 +57,14 @@ class StaticPagesServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function registerViews()
|
||||
{
|
||||
$viewPath = base_path('resources/views/modules/staticpages');
|
||||
$sourcePath = __DIR__ . '/../Resources/views';
|
||||
$viewPath = base_path('resources/views/modules/staticpages');
|
||||
|
||||
$this->publishes([$sourcePath => $viewPath], 'module-views');
|
||||
|
||||
$this->loadViewsFrom(array_merge(array_map(function ($path) {
|
||||
return $path . '/modules/staticpages';
|
||||
}, \Config::get('view.paths')), [$sourcePath]), 'staticpages');
|
||||
|
||||
/**
|
||||
* @var $registrator TemplateRegistrator
|
||||
*/
|
||||
$registrator = $this->app->make('registerTemplateDir');
|
||||
try {
|
||||
// setup some global variables
|
||||
$registrator->setBaseDirectory('resources/views/modules/staticpages/visitor');
|
||||
$registrator->setNamespace('staticpages');
|
||||
$registrator->setModuleId(call_user_func([config('staticpages.handler'), 'getModuleId']));
|
||||
|
||||
// register path with current template name
|
||||
$registrator->register(config('app.theme'), 'staticpages::admin.templatePath');
|
||||
} catch (InvalidArgumentException $e) {
|
||||
// ignore this exception
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,17 +1,23 @@
|
||||
<?php
|
||||
return [
|
||||
"actions" => "Akce",
|
||||
"associateWidgets" => "Přiřadit widgety do této plochy",
|
||||
"code" => "Unikátní kód (používá se v šablonách pro vykreslení)",
|
||||
"createNew" => "Vytvořit novou plochu",
|
||||
"delete" => "Smazat",
|
||||
"description" => "Popis",
|
||||
"edit" => "Upravuji plochu :name",
|
||||
"editButton" => "Upravit",
|
||||
"editSuccessfull" => "Změny úspěšně uloženy",
|
||||
"editTooltip" => "Upravit plochu pro widgety",
|
||||
"invalidArea" => "Zvolená plocha pro widgety není platná. Vyberte prosím nějakou jinou.",
|
||||
"name" => "Jméno",
|
||||
"new" => "Nová plocha pro widgety",
|
||||
"noEntries" => "Zatím nebyla definována žádná plocha pro widgety.",
|
||||
"notDeletableArea" => "Nelze smazat požadovanou plochu. Tato plocha je nezbytnou součástí nainstalované šablony a její odstranění by znefunkčnilo celou šablonu.",
|
||||
"overview" => "Seznam všech ploch pro widgety",
|
||||
"save" => "Uložit",
|
||||
"successfullyCreated" => "Plocha pro widgety úspěšně vytvořena",
|
||||
"successfullyDeleted" => "Úspěšně smazáno",
|
||||
"uniqueCode" => "Unikátní kód",
|
||||
];
|
||||
|
||||
@@ -6,13 +6,16 @@ return [
|
||||
"associationExists" => "Tento widget již je přiřazený k této ploše pro widgety",
|
||||
"cannotSave" => "Nelze uložit widget. Došlo k nečekané vyjímce. Zpráva: :exception",
|
||||
"createdAt" => "Vytvořeno",
|
||||
"delete" => "Smazat",
|
||||
"deleteAssociation" => "Odstranit",
|
||||
"description" => "Popis",
|
||||
"descriptionOfWidgets" => "Widgety se zobrazují v plochách pro widgety. Tyto plochy je možné umístit na libovolné místo na webu.",
|
||||
"edit" => "Upravit",
|
||||
"editTooltip" => "Upravit tento widget",
|
||||
"missingValue" => "Nelze uložit bez hodnoty pro pole :field",
|
||||
"name" => "Jméno",
|
||||
"noEntries" => "Není dostupný žádný widget.",
|
||||
"notDeletable" => "Nelze smazat widget. Smazání widgetu by melo za následek možné znefunkčnění celé šablony.",
|
||||
"overview" => "Seznam všech widgetů",
|
||||
"preview" => "Náhled",
|
||||
"successfullyAssociated" => "Widget úspěšně vložen do plochy",
|
||||
|
||||
@@ -1,56 +1,57 @@
|
||||
<?php
|
||||
return [
|
||||
'status_deleted' => 'Deleted',
|
||||
'status_draft' => 'Draft',
|
||||
'status_protected' => 'Protected',
|
||||
'status_public' => 'Public',
|
||||
'new' => 'Create new :name',
|
||||
'category' => 'Category',
|
||||
'edit' => 'Edit :name',
|
||||
'editPlain' => 'Edit',
|
||||
'content' => 'Page content',
|
||||
'save' => 'Save page',
|
||||
'basicInfo' => 'Basic information',
|
||||
'metaOptions' => 'Meta information',
|
||||
'publicationOptions' => 'Publication setup',
|
||||
'field_title' => 'Page title',
|
||||
'field_url' => 'URL',
|
||||
'field_meta_keywords' => 'Keywords',
|
||||
'field_meta_description' => 'Page description',
|
||||
'field_published_from' => 'Published from',
|
||||
'field_published_to' => 'Published to',
|
||||
'successfullyCreated' => 'Page successfully created',
|
||||
'noPagesAvailable' => 'No static pages available. Try to create one first.',
|
||||
'viewPage' => 'View',
|
||||
'deletePage' => 'Delete',
|
||||
'makePublic' => 'Publish',
|
||||
'makeProtected' => 'Logged users only',
|
||||
'makeDraft' => 'Make draft',
|
||||
'invalidStatus' => 'Cannot change status to something undefined.',
|
||||
'statusChanged' => 'Status successfully changed.',
|
||||
'invalidPage' => 'Specified page does not exist.',
|
||||
'pageDeleted' => 'Page :name (:url) successfully deleted.',
|
||||
'nothingToEdit' => 'You did not submit any changes. Nothing was edited.',
|
||||
'successfullyEdited' => 'Edit successfull',
|
||||
'showHistory' => 'History (:count)',
|
||||
'appearance' => 'Appearance',
|
||||
'template' => 'Template of this page',
|
||||
'overview' => 'List of all content pages',
|
||||
'homepageSetup' => 'Homepage successfully set up.',
|
||||
'setHomepage' => 'Set page as homepage',
|
||||
'noParentPage' => ' -- No parent page -- ',
|
||||
'uploadTitleImage' => 'Upload title image',
|
||||
'noHomepage' => 'You have not set up your homepage yet, or your current homepage is draft! Try to select another one.',
|
||||
'homepageProtected' => 'Your homepage is displayed only for logged in users. This may or may not be an error.',
|
||||
'parentPage' => 'Parent page',
|
||||
'alreadyHomepage' => 'Homepage',
|
||||
'files' => 'Files',
|
||||
'lockUrl' => 'Keep URL',
|
||||
'noCategory' => ' -- No category -- ',
|
||||
'noTemplates' => 'Cannot create content page. There are no available templates for this module.',
|
||||
'title' => 'Title',
|
||||
'createdAt' => 'Created at',
|
||||
'status' => 'Status',
|
||||
'moduleName' => 'Module',
|
||||
'actions' => 'Actions'
|
||||
'status_deleted' => 'Deleted',
|
||||
'status_draft' => 'Draft',
|
||||
'status_protected' => 'Protected',
|
||||
'status_public' => 'Public',
|
||||
'new' => 'Create new :name',
|
||||
'category' => 'Category',
|
||||
'edit' => 'Edit :name',
|
||||
'editPlain' => 'Edit',
|
||||
'content' => 'Page content',
|
||||
'save' => 'Save page',
|
||||
'basicInfo' => 'Basic information',
|
||||
'metaOptions' => 'Meta information',
|
||||
'publicationOptions' => 'Publication setup',
|
||||
'field_title' => 'Page title',
|
||||
'field_url' => 'URL',
|
||||
'field_meta_keywords' => 'Keywords',
|
||||
'field_meta_description' => 'Page description',
|
||||
'field_published_from' => 'Published from',
|
||||
'field_published_to' => 'Published to',
|
||||
'successfullyCreated' => 'Page successfully created',
|
||||
'noPagesAvailable' => 'No static pages available. Try to create one first.',
|
||||
'viewPage' => 'View',
|
||||
'deletePage' => 'Delete',
|
||||
'makePublic' => 'Publish',
|
||||
'makeProtected' => 'Logged users only',
|
||||
'makeDraft' => 'Make draft',
|
||||
'invalidStatus' => 'Cannot change status to something undefined.',
|
||||
'statusChanged' => 'Status successfully changed.',
|
||||
'invalidPage' => 'Specified page does not exist.',
|
||||
'pageDeleted' => 'Page :name (:url) successfully deleted.',
|
||||
'nothingToEdit' => 'You did not submit any changes. Nothing was edited.',
|
||||
'successfullyEdited' => 'Edit successfull',
|
||||
'showHistory' => 'History (:count)',
|
||||
'appearance' => 'Appearance',
|
||||
'template' => 'Template of this page',
|
||||
'overview' => 'List of all content pages',
|
||||
'homepageSetup' => 'Homepage successfully set up.',
|
||||
'setHomepage' => 'Set page as homepage',
|
||||
'noParentPage' => ' -- No parent page -- ',
|
||||
'uploadTitleImage' => 'Upload title image',
|
||||
'noHomepage' => 'You have not set up your homepage yet, or your current homepage is draft! Try to select another one.',
|
||||
'homepageProtected' => 'Your homepage is displayed only for logged in users. This may or may not be an error.',
|
||||
'parentPage' => 'Parent page',
|
||||
'alreadyHomepage' => 'Homepage',
|
||||
'files' => 'Files',
|
||||
'lockUrl' => 'Keep URL',
|
||||
'noCategory' => ' -- No category -- ',
|
||||
'noTemplates' => 'Cannot create content page. There are no available templates for this module.',
|
||||
'title' => 'Title',
|
||||
'createdAt' => 'Created at',
|
||||
'status' => 'Status',
|
||||
'moduleName' => 'Module',
|
||||
'actions' => 'Actions',
|
||||
'invalidTemplateSelected' => 'Invalid template selected! This page cannot be rendered!'
|
||||
];
|
||||
@@ -13,7 +13,11 @@ return [
|
||||
'actions' => 'Actions',
|
||||
'noEntries' => 'No widget areas defined yet. Try to create some first.',
|
||||
'editButton' => 'Edit',
|
||||
'save' => 'Save',
|
||||
'save' => 'Save',
|
||||
'edit' => 'Editing widget area :name',
|
||||
'editTooltip' => 'Edit widget area',
|
||||
'associateWidgets' => 'Associate widgets with this widget area',
|
||||
'delete' => 'Delete widget area',
|
||||
'notDeletableArea' => 'Cannot delete desired widget area. This area is essential part of installed template and therefore cannot be deleted.',
|
||||
'editSuccessfull' => 'Successfully edited'
|
||||
];
|
||||
@@ -23,5 +23,8 @@ return [
|
||||
'successfullyDeassociated' => 'Successfully removed from widget area',
|
||||
'widgetExists' => 'Widget :id already exists.',
|
||||
'descriptionOfWidgets' => 'Widgets are displayed in widget areas.',
|
||||
'successfullyDeleted' => 'Widget successfully deleted'
|
||||
'successfullyDeleted' => 'Widget successfully deleted',
|
||||
'delete' => 'Delete',
|
||||
'editTooltip' => 'Edit this widget',
|
||||
'notDeletable' => 'Cannot delete this widget. It is essential part of currenty installed template and therefore cannot be deleted.'
|
||||
];
|
||||
@@ -4,6 +4,12 @@
|
||||
|
||||
@section('content')
|
||||
|
||||
@if(!count($templates))
|
||||
<div class="alert alert-warning">
|
||||
@lang('admin/contents.noTemplates')
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="POST" enctype="multipart/form-data" action="{{route('content.editPost', ['pageId' => $page->id])}}">
|
||||
{!! csrf_field() !!}
|
||||
|
||||
|
||||
@@ -35,11 +35,17 @@
|
||||
<div class="row p-tb-15">
|
||||
<div class="col-md-1 hidden-sm-down text-center with-placeholder">
|
||||
<a href="{{route('content.edit', ['id' => $page->id])}}">
|
||||
@if(!empty($page->title_photo))
|
||||
<img src="@upload($page->title_photo)" class="placeholder" alt="{{$page->title}}" />
|
||||
@if(!view()->exists(\App\Helpers\Template::name($page->template, false)))
|
||||
<i class="fa fa-2x text-warning fa-warning" data-toggle="tooltip"
|
||||
title="@lang('admin/contents.invalidTemplateSelected')"></i>
|
||||
@else
|
||||
<img src="{{asset('resources/assets/admin/img/placeholder.png')}}" class="placeholder"
|
||||
alt="{{$page->title}}" />
|
||||
@if(!empty($page->title_photo))
|
||||
<img src="@upload($page->title_photo)" class="placeholder" alt="{{$page->title}}" />
|
||||
@else
|
||||
<img src="{{asset('resources/assets/admin/img/placeholder.png')}}"
|
||||
class="placeholder"
|
||||
alt="{{$page->title}}" />
|
||||
@endif
|
||||
@endif
|
||||
</a>
|
||||
</div>
|
||||
@@ -71,14 +77,16 @@
|
||||
@if(!$page->is_homepage)
|
||||
<li>
|
||||
|
||||
<a href="{{route('content.setHomepage', ['id' => $page->id])}}" data-toggle="tooltip" title="@lang('admin/contents.setHomepage')">
|
||||
<a href="{{route('content.setHomepage', ['id' => $page->id])}}"
|
||||
data-toggle="tooltip" title="@lang('admin/contents.setHomepage')">
|
||||
<i class="fa fa-home"></i>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
<li>
|
||||
<a class="edit" href="{{route('content.edit', ['id' => $page->id])}}" data-toggle="tooltip" title="@lang('admin/contents.editPlain')">
|
||||
<a class="edit" href="{{route('content.edit', ['id' => $page->id])}}"
|
||||
data-toggle="tooltip" title="@lang('admin/contents.editPlain')">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
</li>
|
||||
@@ -86,7 +94,8 @@
|
||||
@if($page->status == \App\Models\Content::STATUS_DRAFT)
|
||||
<li>
|
||||
<a href="{{route('content.changeStatus', ['id' => $page->id, 'status' => \App\Models\Content::STATUS_PUBLIC])}}"
|
||||
class="confirm" data-toggle="tooltip" title="@lang('admin/contents.makePublic')">
|
||||
class="confirm" data-toggle="tooltip"
|
||||
title="@lang('admin/contents.makePublic')">
|
||||
<i class="fa fa-eye"></i>
|
||||
</a>
|
||||
</li>
|
||||
@@ -115,7 +124,8 @@
|
||||
|
||||
<li>
|
||||
<a href="{{route('content.delete', ['id' => $page->id])}}"
|
||||
class="button tiny alert remove confirm" data-toggle="tooltip" title="@lang('admin/contents.deletePage')"><i
|
||||
class="button tiny alert remove confirm" data-toggle="tooltip"
|
||||
title="@lang('admin/contents.deletePage')"><i
|
||||
class="fa fa-trash-o"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -27,18 +27,24 @@
|
||||
<div class="item-actions-block">
|
||||
<ul class="item-actions-list">
|
||||
<li>
|
||||
<a class="edit" href="{{route('widgetareas.edit', ['id' => $area->id])}}"><i
|
||||
<a class="edit" data-toggle="tooltip"
|
||||
title="@lang('admin/widgetAreas.editTooltip')"
|
||||
href="{{route('widgetareas.edit', ['id' => $area->id])}}"><i
|
||||
class="fa fa-pencil"></i></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('widgets.associate', ['widgetArea' => $area->id])}}"><i
|
||||
class="fa fa-plus"></i></a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="confirm remove"
|
||||
href="{{route('widgetareas.delete', ['id' => $area->id])}}"><i
|
||||
class="fa fa-trash"></i></a>
|
||||
<a href="{{route('widgets.associate', ['widgetArea' => $area->id])}}"
|
||||
data-toggle="tooltip"
|
||||
title="@lang('admin/widgetAreas.associateWidgets')">
|
||||
<i class="fa fa-plus"></i></a>
|
||||
</li>
|
||||
@if($area->deletable)
|
||||
<li>
|
||||
<a class="confirm remove" data-toggle="tooltip" title="@lang('admin/widgetAreas.delete')"
|
||||
href="{{route('widgetareas.delete', ['id' => $area->id])}}"><i
|
||||
class="fa fa-trash"></i></a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -4,31 +4,58 @@
|
||||
@section('pageDescription', @trans('admin/widgets.descriptionOfWidgets'))
|
||||
|
||||
@section('content')
|
||||
@if (count($widgets))
|
||||
<table class="table table-striped full-width">
|
||||
<tr>
|
||||
<th>@lang('admin/widgets.widgetType')</th>
|
||||
<th>@lang('admin/widgets.name')</th>
|
||||
<th>@lang('admin/widgets.description')</th>
|
||||
<th>@lang('admin/widgets.actions')</th>
|
||||
</tr>
|
||||
@if (count($widgets))
|
||||
<table class="table table-striped item-list">
|
||||
<tr>
|
||||
<th>@lang('admin/widgets.widgetType')</th>
|
||||
<th>@lang('admin/widgets.name')</th>
|
||||
<th>@lang('admin/widgets.description')</th>
|
||||
<th>@lang('admin/widgets.actions')</th>
|
||||
</tr>
|
||||
@foreach($widgets as $widget)
|
||||
<tr>
|
||||
<td>{{trans(call_user_func([$widget->widget_type_handler, 'getName']))}}</td>
|
||||
<td><a href="{{route('widgets.edit', ['id' => $widget->id])}}">{{$widget->name}}</a></td>
|
||||
<td>{{$widget->description}}</td>
|
||||
<td class="text-center">
|
||||
<a href="{{route('widgets.edit', ['id' => $widget->id])}}"><i class="fa fa-fw fa-pencil"></i></a>
|
||||
<a href="{{route('widgets.delete', ['id' => $widget->id])}}"><i class="fa fa-fw remove fa-trash"></i></a>
|
||||
|
||||
|
||||
<div class="item-actions-dropdown">
|
||||
<a class="item-actions-toggle-btn">
|
||||
<span class="inactive"><i class="fa fa-cog"></i></span>
|
||||
<span class="active"><i class="fa fa-chevron-circle-right"></i></span>
|
||||
</a>
|
||||
<div class="item-actions-block">
|
||||
<ul class="item-actions-list">
|
||||
<li>
|
||||
<a class="edit" data-toggle="tooltip"
|
||||
title="@lang('admin/widgets.editTooltip')"
|
||||
href="{{route('widgets.edit', ['id' => $widget->id])}}"><i
|
||||
class="fa fa-pencil"></i></a>
|
||||
</li>
|
||||
|
||||
@if($widget->deletable)
|
||||
<li>
|
||||
<a class="confirm remove" data-toggle="tooltip"
|
||||
title="@lang('admin/widgets.delete')"
|
||||
href="{{route('widgets.delete', ['id' => $widget->id])}}"><i
|
||||
class="fa fa-trash"></i></a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</table>
|
||||
|
||||
{!! $widgets->render() !!}
|
||||
@else
|
||||
<div class="alert alert-info">
|
||||
<em>@lang('admin/widgets.noEntries')</em>
|
||||
</div>
|
||||
@endif
|
||||
{!! $widgets->render() !!}
|
||||
@else
|
||||
<div class="alert alert-info">
|
||||
<em>@lang('admin/widgets.noEntries')</em>
|
||||
</div>
|
||||
@endif
|
||||
@stop
|
||||
@@ -1,58 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/actionLog.overview'))
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<h2>@lang('admin/actionLog.overview')</h2>
|
||||
</div>
|
||||
|
||||
<div class="row" data-equalizer>
|
||||
@if (!empty($actions))
|
||||
<ul class="accordion" data-accordion>
|
||||
@foreach($actions as $action)
|
||||
<li class="accordion-item" data-accordion-item>
|
||||
<a class="accordion-title">
|
||||
<img src="{{\App\Helpers\Gravatar::img($action->email, 20)}}" alt="{{$action->email}}" />
|
||||
<strong>{{$action->name}}</strong>
|
||||
{{date('d.m.Y', strtotime($action->created_at))}}
|
||||
</a>
|
||||
<div class="accordion-content" data-tab-content>
|
||||
<div class="row">
|
||||
<div class="column large-1 text-center">
|
||||
<img src="{{\App\Helpers\Gravatar::img($action->email, 70)}}"
|
||||
alt="{{$action->email}}" />
|
||||
<p>
|
||||
{{$action->user_name}}<br />
|
||||
{{date('G:i', strtotime($action->created_at))}}</p>
|
||||
</div>
|
||||
<div class="column large-11">
|
||||
<div class="row column">
|
||||
{{$action->value}}
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<div class="row column">
|
||||
<p>
|
||||
<strong>@lang('admin/actionLog.ip')</strong>: {{$action->ip}},
|
||||
<br />
|
||||
<strong>@lang('admin/actionLog.userAgent')</strong>: {{$action->user_agent}}
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@else
|
||||
<em>@lang('admin/userManagement.noActions')</em>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row pagination">
|
||||
{!! $actions->render() !!}
|
||||
</div>
|
||||
@stop
|
||||
@@ -1,14 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/contents.edit', ['name' => e($page->title)]))
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<h2>@lang('admin/contents.edit', ['name' => e($page->title)])</h2>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@include('admin.content.editForm')
|
||||
</div>
|
||||
@stop
|
||||
@@ -1,33 +0,0 @@
|
||||
@if (session('success'))
|
||||
<div data-alert class="callout success">
|
||||
<strong>{{ session('success') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div data-alert class="callout alert">
|
||||
<strong>{{ session('error') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="POST" enctype="multipart/form-data" action="{{route('content.editPost', ['pageId' => $page->id])}}">
|
||||
{!! csrf_field() !!}
|
||||
|
||||
@include('admin.content.formInputs')
|
||||
|
||||
<div class="row">
|
||||
<div class="columns large-6">
|
||||
<button type="submit" class="button success">@lang('admin/contents.edit', ['name' => $page->title])</button>
|
||||
</div>
|
||||
|
||||
@if ($historySize > 0)
|
||||
<div class="columns text-right large-6">
|
||||
<a class="button warning" href="{{route('content.history', ['id' => $page->id])}}">@lang('admin/contents.showHistory', ['count' => $historySize])</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@section('javascripts')
|
||||
@include('admin.snippets.ckEditor', ['textareaId' => 'pageContent'])
|
||||
@stop
|
||||
@@ -1,17 +0,0 @@
|
||||
<ul class="tabs" data-tabs id="static-page-controls">
|
||||
@foreach($formSectionNames as $section => $sectionName)
|
||||
<li class="tabs-title @if($sectionName == reset($formSectionNames)) is-active @endif">
|
||||
<a href="#{{$section}}" @if($sectionName == reset($formSectionNames)) aria-selected="true" @endif>
|
||||
{{trans($sectionName)}}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<div class="tabs-content" data-tabs-content="static-page-controls">
|
||||
@foreach($formSections as $section => $view)
|
||||
<div class="tabs-panel @if($view == reset($formSections)) is-active @endif" id="{{$section}}">
|
||||
@include($view)
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@@ -1,50 +0,0 @@
|
||||
@if($page->title_photo)
|
||||
<div class="row">
|
||||
<div class="column large-12 title-photo text-center">
|
||||
<img src="{{config('app.upload_url')}}/{{$page->title_photo}}" alt="" />
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="column large-12">
|
||||
<label>
|
||||
@lang('admin/contents.uploadTitleImage')
|
||||
<input type="file" id="titlePhoto" name="titlePhoto" />
|
||||
</label>
|
||||
@if (isset($errors) && $errors->has('titlePhoto'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('titlePhoto') }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="columns large-12">
|
||||
<label>
|
||||
@lang('admin/contents.template')
|
||||
|
||||
<select name="template">
|
||||
@foreach($templates as $template)
|
||||
<option value="{{$template->template_name}}"
|
||||
@if(old('template', $page->template) == $template->template_name) selected @endif>
|
||||
{{$template->name}}
|
||||
@if($template->description != '')
|
||||
- {{str_limit($template->description, 60)}}
|
||||
@endif
|
||||
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
@if (isset($errors) && $errors->has('template'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('template') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,103 +0,0 @@
|
||||
<div class="row">
|
||||
<div class="columns large-6">
|
||||
<label>
|
||||
@lang('admin/contents.field_title')
|
||||
|
||||
<input type="text" name="title" class="slug-source" placeholder="@lang('admin/contents.field_title')"
|
||||
value="{{old('title', $page->title)}}" />
|
||||
</label>
|
||||
</div>
|
||||
<div class="columns large-4">
|
||||
<label>
|
||||
@lang('admin/contents.field_url')
|
||||
|
||||
<input type="text" name="url" class="slug-target" placeholder="@lang('admin/contents.field_url')"
|
||||
value="{{old('url', $page->url)}}" />
|
||||
|
||||
@if (isset($errors) && $errors->has('url'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('url') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
</div>
|
||||
<div class="column large-2 text-center">
|
||||
<label>
|
||||
@lang('admin/contents.lockUrl')<br />
|
||||
|
||||
<input type="checkbox" value="1" id="lockUrl"
|
||||
@if(old('lockUrl') || ($page->id > 0 && \Illuminate\Support\Str::slug($page->title) != $page->url)) checked
|
||||
@endif name="lockUrl" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="columns large-6">
|
||||
<label>
|
||||
<select name="status">
|
||||
@foreach($contentStatuses as $status => $translation)
|
||||
<option value="{{$status}}" @if(old('status', $page->status) == $status) selected @endif>
|
||||
{{$translation}}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</label>
|
||||
|
||||
@if (isset($errors) && $errors->has('status'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('status') }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="column large-6">
|
||||
<label>
|
||||
<select name="parentPage">
|
||||
<option value="">@lang('admin/contents.noParentPage')</option>
|
||||
|
||||
@foreach($rootPages as $rootPage)
|
||||
<option value="{{$rootPage->id}}"
|
||||
@if(old('parent_page', $page->parent_id) == $rootPage->id) selected @endif>
|
||||
{{$rootPage->title}}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</label>
|
||||
|
||||
@if (isset($errors) && $errors->has('parentPage'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('parentPage') }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if($module->support_categories && count($categories))
|
||||
<div class="column large-12">
|
||||
<label>
|
||||
@lang('admin/contents.category')
|
||||
|
||||
<select name="category">
|
||||
<option value=""> ---</option>
|
||||
@foreach($categories as $category)
|
||||
<option value="{{$category->id}}"
|
||||
@if($category->id == old('category', $page->category_id)) selected @endif>
|
||||
{{str_repeat(' - ', $category->real_depth)}} {{$category->name}}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="columns large-12">
|
||||
<label>
|
||||
<textarea name="pageContent" id="pageContent" class="wysiwyg-editor">
|
||||
{{old('pageContent', $page->content)}}
|
||||
</textarea>
|
||||
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,20 +0,0 @@
|
||||
<div class="row">
|
||||
|
||||
@if(count($page->files))
|
||||
<div class="column large-6">
|
||||
<ul>
|
||||
@foreach($page->files as $file)
|
||||
<li><label><input type="checkbox" name="keepAssigned[{{$file->id}}]" checked /> {{$file->original_filename}}</label></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="columns large-6">
|
||||
<label>
|
||||
@lang('admin/contents.files')
|
||||
|
||||
<input type="file" name="files[]" multiple />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,18 +0,0 @@
|
||||
<div class="row">
|
||||
<div class="columns large-12">
|
||||
<label>
|
||||
@lang('admin/contents.field_meta_keywords')
|
||||
|
||||
<input type="text" name="metaKeywords" value="{{old('meta_keywords', $page->meta_keywords)}}" placeholder="@lang('admin/contents.field_meta_keywords')" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="columns large-12">
|
||||
<label>
|
||||
@lang('admin/contents.field_meta_description')
|
||||
|
||||
<textarea name="metaDescription" placeholder="@lang('admin/contents.field_meta_description')" rows="5">{{old('meta_description', $page->meta_description)}}</textarea>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,31 +0,0 @@
|
||||
<div class="row">
|
||||
<div class="columns large-6">
|
||||
<label>
|
||||
@lang('admin/contents.field_published_from')
|
||||
|
||||
<input type="datetime" name="published_from" value="{{old('published_from', $page->published_from)}}"
|
||||
placeholder="@lang('admin/contents.field_published_from')" />
|
||||
|
||||
@if (isset($errors) && $errors->has('published_from'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('published_from') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="columns large-6">
|
||||
<label>
|
||||
@lang('admin/contents.field_published_to')
|
||||
|
||||
<input type="datetime" name="published_to" value="{{old('published_to', $page->published_to)}}"
|
||||
placeholder="@lang('admin/contents.field_published_to')" />
|
||||
|
||||
@if (isset($errors) && $errors->has('published_to'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('published_to') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,14 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/contents.new', ['name' => $moduleName]))
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<h2>@lang('admin/contents.new', ['name' => $moduleName])</h2>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@include('admin.content.newForm')
|
||||
</div>
|
||||
@stop
|
||||
@@ -1,27 +0,0 @@
|
||||
@if (session('success'))
|
||||
<div data-alert class="callout success">
|
||||
<strong>{{ session('success') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div data-alert class="callout alert">
|
||||
<strong>{{ session('error') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="POST" enctype="multipart/form-data" action="{{route('content.newPost', ['moduleId' => $moduleId])}}">
|
||||
{!! csrf_field() !!}
|
||||
|
||||
@include('admin.content.formInputs')
|
||||
|
||||
<div class="row">
|
||||
<div class="columns large-12">
|
||||
<button type="submit" class="button success">@lang('admin/contents.save')</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@section('javascripts')
|
||||
@include('admin.snippets.ckEditor', ['textareaId' => 'pageContent'])
|
||||
@stop
|
||||
@@ -1,39 +0,0 @@
|
||||
@extends('admin/layout')
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<h1>@lang('admin/contents.overview')</h1>
|
||||
|
||||
@if (session('success'))
|
||||
<div data-alert class="callout success">
|
||||
<strong>{{ session('success') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div data-alert class="callout alert">
|
||||
<strong>{{ session('error') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if (!$homepage)
|
||||
<div class="row">
|
||||
<div class="callout alert">
|
||||
<strong>@lang('admin/contents.noHomepage')</strong>
|
||||
</div>
|
||||
</div>
|
||||
@elseif(!$homepage->isPublic())
|
||||
<div class="row">
|
||||
<div class="callout warning">
|
||||
<strong>@lang('admin/contents.homepageProtected')</strong>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@include('admin.content.overviewTiles')
|
||||
|
||||
<div class="row">
|
||||
{!! $pages->render() !!}
|
||||
</div>
|
||||
@stop
|
||||
@@ -1,83 +0,0 @@
|
||||
@forelse($pages as $page)
|
||||
<div class="page callout page {{$page->status}} row">
|
||||
|
||||
<div class="row column">
|
||||
@if ($page->parent_id && $page->parent_url)
|
||||
<span class="parent">
|
||||
@lang('admin/contents.parentPage'):
|
||||
<a href="{{route('content.edit', ['id' => $page->parent_id])}}">{{$page->parent_title}}</a>,
|
||||
</span>
|
||||
@endif
|
||||
|
||||
<span class="author">{{$page->author_name}}</span>,
|
||||
<span class="date">{{date('d.m.Y', strtotime($page->created_at))}}</span>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="column large-1">
|
||||
@if ($page->title_photo)
|
||||
<a href="{{route('content.edit', ['id' => $page->id])}}">
|
||||
<img src="@upload($page->title_photo)" class="float-left" alt="" />
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
<div class="column large-8">
|
||||
<h4>
|
||||
<a href="{{route('content.edit', ['id' => $page->id])}}">
|
||||
{{$page->title}}
|
||||
<small>(@lang($page->module_name))</small>
|
||||
</a>
|
||||
</h4>
|
||||
|
||||
<p class="perex">
|
||||
@if (trim($page->meta_description))
|
||||
{{str_limit($page->meta_description)}}
|
||||
@else
|
||||
{{str_limit(strip_tags($page->content))}}
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="controls column float-right large-3">
|
||||
@if($page->is_homepage)
|
||||
<a class="button tiny disabled">
|
||||
<i class="fa fa-home"></i>
|
||||
@lang('admin/contents.alreadyHomepage')
|
||||
</a>
|
||||
@else
|
||||
<a href="{{route('content.setHomepage', ['id' => $page->id])}}"
|
||||
class="button tiny success">
|
||||
<i class="fa fa-home"></i>
|
||||
@lang('admin/contents.setHomepage')
|
||||
</a>
|
||||
@endif
|
||||
|
||||
<a href="{{route('content.edit', ['id' => $page->id])}}" class="button tiny success">
|
||||
<i class="fa fa-edit"></i>
|
||||
@lang('admin/contents.editPlain')
|
||||
</a>
|
||||
|
||||
@if($page->status == \App\Models\Content::STATUS_DRAFT)
|
||||
<a href="{{route('content.changeStatus', ['id' => $page->id, 'status' => \App\Models\Content::STATUS_PUBLIC])}}"
|
||||
class="button tiny success confirm">
|
||||
<i class="fa fa-eye"></i> @lang('admin/contents.makePublic')</a>
|
||||
<a href="{{route('content.changeStatus', ['id' => $page->id, 'status' => \App\Models\Content::STATUS_PROTECTED])}}"
|
||||
class="button tiny warning confirm">
|
||||
<i class="fa fa-lock"></i> @lang('admin/contents.makeProtected')</a>
|
||||
@else
|
||||
<a href="{{route('page.content', ['url' => $page->url])}}" target="_blank"
|
||||
class="button tiny secondary"><i
|
||||
class="fa fa-desktop"></i> @lang('admin/contents.viewPage')</a>
|
||||
<a href="{{route('content.changeStatus', ['id' => $page->id, 'status' => \App\Models\Content::STATUS_DRAFT])}}"
|
||||
class="button tiny warning confirm"><i
|
||||
class="fa fa-eye-slash"></i> @lang('admin/contents.makeDraft')</a>
|
||||
@endif
|
||||
|
||||
<a href="{{route('content.delete', ['id' => $page->id])}}"
|
||||
class="button tiny alert confirm"><i
|
||||
class="fa fa-remove"></i> @lang('admin/contents.deletePage')</a>
|
||||
</div>
|
||||
</div>
|
||||
@empty
|
||||
<em>@lang('admin/contents.noPagesAvailable')</em>
|
||||
@endforelse
|
||||
@@ -1,14 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/customFields.edit', ['name' => $field->name]))
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<h2>@lang('admin/customFields.edit', ['name' => $field->name])</h2>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@include('admin.customFields.editForm')
|
||||
</div>
|
||||
@stop
|
||||
@@ -1,136 +0,0 @@
|
||||
@if (session('success'))
|
||||
<div data-alert class="callout success">
|
||||
<strong>{{ session('success') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div data-alert class="callout alert">
|
||||
<strong>{{ session('error') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{route('customfields.editPost', ['id' => $field->id])}}">
|
||||
{!! csrf_field() !!}
|
||||
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<label>
|
||||
@lang('admin/customFields.name')
|
||||
<input type="text" placeholder="@lang('admin/customFields.name')" value="{{$field->name}}" name="name">
|
||||
|
||||
@if (isset($errors) && $errors->has('name'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('name') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-6 columns">
|
||||
<label>
|
||||
@lang('admin/customFields.description')
|
||||
|
||||
<textarea rows="5" name="description" placeholder="@lang('admin/customFields.description')">{{$field->description}}</textarea>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="large-6 columns">
|
||||
|
||||
<label>
|
||||
@lang('admin/customFields.type')
|
||||
|
||||
<select name="type" disabled>
|
||||
@foreach($types as $type => $translation)
|
||||
<option value="{{$type}}"@if($field->type_id == $type) selected @endif>{{$translation}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
@if (isset($errors) && $errors->has('type'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('type') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/customFields.resource')
|
||||
|
||||
<select name="resource" disabled>
|
||||
@foreach($resources as $resource => $translation)
|
||||
<option value="{{$resource}}"@if($field->resource_id == $resource) selected @endif>{{$translation}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
@if (isset($errors) && $errors->has('resource'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('resource') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/customFields.required')
|
||||
|
||||
<input type="checkbox" placeholder="@lang('admin/customFields.required')" @if ($field->required) checked="checked" @endif name="required">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="columns large-6">
|
||||
<label>
|
||||
@lang('admin/customFields.possibleValues')
|
||||
|
||||
<textarea placeholder="@lang('admin/customFields.possibleValues')" name="possibleValues" rows="4">{{$field->possibleValues}}</textarea>
|
||||
</label>
|
||||
</div>
|
||||
<div class="columns large-6">
|
||||
<label>
|
||||
@lang('admin/customFields.defaultValue')
|
||||
|
||||
<input type="text" placeholder="@lang('admin/customFields.defaultValue')" value="{{$field->defaultValue}}" name="defaultValue">
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/customFields.regExp')
|
||||
|
||||
<input type="text" placeholder="@lang('admin/customFields.regExp')" value="{{$field->regExp}}" name="regExp">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="large-6 columns">
|
||||
<label>
|
||||
@lang('admin/customFields.minLength')
|
||||
|
||||
<input type="text" placeholder="@lang('admin/customFields.minLength')" value="{{$field->minLength}}" name="minLength">
|
||||
|
||||
@if (isset($errors) && $errors->has('minLength'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('minLength') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
</div>
|
||||
<div class="large-6 columns">
|
||||
<label>
|
||||
@lang('admin/customFields.maxLength')
|
||||
|
||||
<input type="text" placeholder="@lang('admin/customFields.maxLength')" value="{{$field->macLength}}" name="maxLength">
|
||||
|
||||
@if (isset($errors) && $errors->has('maxLength'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('maxLength') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label>
|
||||
<button type="submit" class="button success">@lang('admin/customFields.createNew')</button>
|
||||
</label>
|
||||
</form>
|
||||
@@ -1,26 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/customFields.new'))
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<h2>@lang('admin/customFields.new')</h2>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@if (session('success'))
|
||||
<div data-alert class="callout success">
|
||||
<strong>{{ session('success') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div data-alert class="callout alert">
|
||||
<strong>{{ session('error') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
@include('admin.customFields.newForm')
|
||||
</div>
|
||||
@stop
|
||||
@@ -1,124 +0,0 @@
|
||||
<form method="POST" action="{{route('customfields.newPost')}}">
|
||||
{!! csrf_field() !!}
|
||||
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<label>
|
||||
@lang('admin/customFields.name')
|
||||
<input type="text" placeholder="@lang('admin/customFields.name')" value="{{old('name')}}" name="name">
|
||||
|
||||
@if (isset($errors) && $errors->has('name'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('name') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-6 columns">
|
||||
<label>
|
||||
@lang('admin/customFields.description')
|
||||
|
||||
<textarea rows="5" name="description" placeholder="@lang('admin/customFields.description')">{{old('description')}}</textarea>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="large-6 columns">
|
||||
|
||||
<label>
|
||||
@lang('admin/customFields.type')
|
||||
|
||||
<select name="type">
|
||||
@foreach($types as $type => $translation)
|
||||
<option value="{{$type}}"@if(old('type') == $type) selected @endif>{{$translation}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
@if (isset($errors) && $errors->has('type'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('type') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/customFields.resource')
|
||||
|
||||
<select name="resource">
|
||||
@foreach($resources as $resource => $translation)
|
||||
<option value="{{$resource}}"@if(old('resource') == $resource) selected @endif>{{$translation}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
@if (isset($errors) && $errors->has('resource'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('resource') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/customFields.required')
|
||||
|
||||
<input type="checkbox" placeholder="@lang('admin/customFields.required')" @if (old('required')) checked="checked" @endif name="required">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="columns large-6">
|
||||
<label>
|
||||
@lang('admin/customFields.possibleValues')
|
||||
|
||||
<textarea placeholder="@lang('admin/customFields.possibleValues')" name="possibleValues" rows="4">{{old('possibleValues')}}</textarea>
|
||||
</label>
|
||||
</div>
|
||||
<div class="columns large-6">
|
||||
<label>
|
||||
@lang('admin/customFields.defaultValue')
|
||||
|
||||
<input type="text" placeholder="@lang('admin/customFields.defaultValue')" value="{{old('defaultValue')}}" name="defaultValue">
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/customFields.regExp')
|
||||
|
||||
<input type="text" placeholder="@lang('admin/customFields.regExp')" value="{{old('regExp')}}" name="regExp">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="large-6 columns">
|
||||
<label>
|
||||
@lang('admin/customFields.minLength')
|
||||
|
||||
<input type="text" placeholder="@lang('admin/customFields.minLength')" value="{{old('minLength')}}" name="minLength">
|
||||
|
||||
@if (isset($errors) && $errors->has('minLength'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('minLength') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
</div>
|
||||
<div class="large-6 columns">
|
||||
<label>
|
||||
@lang('admin/customFields.maxLength')
|
||||
|
||||
<input type="text" placeholder="@lang('admin/customFields.maxLength')" value="{{old('macLength')}}" name="maxLength">
|
||||
|
||||
@if (isset($errors) && $errors->has('maxLength'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('maxLength') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label>
|
||||
<button type="submit" class="button success">@lang('admin/customFields.createNew')</button>
|
||||
</label>
|
||||
</form>
|
||||
@@ -1,74 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/customFields.overview'))
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<h2>@lang('admin/customFields.overview')</h2>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
@if (session('success'))
|
||||
<div data-alert class="callout success">
|
||||
<strong>{{ session('success') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div data-alert class="callout alert">
|
||||
<strong>{{ session('error') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
{{--draw tabs--}}
|
||||
@if (!empty($usedResources))
|
||||
<ul class="tabs" data-tabs id="customFieldsOverview">
|
||||
<?php $isFirst = true?>
|
||||
@foreach($usedResources as $i => $resource)
|
||||
<li class="tabs-title @if($isFirst)is-active @endif"><a href="#customFieldResource{{$resource}}">@lang($resources[$resource])</a></li>
|
||||
<?php $isFirst = false?>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
{{--display list of custom fields--}}
|
||||
<?php $isFirst = true?>
|
||||
<div class="tabs-content" data-tabs-content="customFieldsOverview">
|
||||
@foreach($customFields as $resourceId => $fields)
|
||||
<div class="tabs-panel @if($isFirst)is-active @endif" id="customFieldResource{{$resourceId}}">
|
||||
<table class="full-width">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>@lang('admin/customFields.name')</th>
|
||||
<th>@lang('admin/customFields.description')</th>
|
||||
<th>@lang('admin/customFields.type')</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($fields as $field)
|
||||
<tr>
|
||||
<td>{{$field->name}}</td>
|
||||
<td>{{str_limit($field->description)}}</td>
|
||||
<td>@lang($types[$field->type_id])</td>
|
||||
<td>
|
||||
<a href="{{route('customfields.delete', ['id' => $field->id])}}"><i class="fa red confirm fa-remove"></i></a>
|
||||
<a href="{{route('customfields.edit', ['id' => $field->id])}}"><i class="fa green fa-edit"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php $isFirst = false?>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@else
|
||||
<em>@lang('admin/customFields.noFields')</em>
|
||||
@endif
|
||||
</div>
|
||||
@stop
|
||||
@@ -1,7 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('content')
|
||||
<h1>Dashboard</h1>
|
||||
|
||||
some fancy content
|
||||
@stop
|
||||
@@ -1,20 +0,0 @@
|
||||
<h3>@lang('admin/fileManager.editDirectory')</h3>
|
||||
|
||||
<form method="POST" action="{{route('upload.postEditDirectory', ['id' => $directory->id])}}">
|
||||
{!! csrf_field() !!}
|
||||
|
||||
<label>
|
||||
@lang('admin/fileManager.directoryName')
|
||||
|
||||
<input type="text" name="name" value="{{old('name', $directory->name)}}" />
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/fileManager.directoryDescription')
|
||||
|
||||
<textarea name="description" rows="3">{{old('description', $directory->description)}}</textarea>
|
||||
</label>
|
||||
|
||||
<button type="submit" class="button success">@lang('admin/fileManager.editDirectory')</button>
|
||||
|
||||
</form>
|
||||
@@ -1,36 +0,0 @@
|
||||
<h3>@lang('admin/fileManager.newDirectory')</h3>
|
||||
|
||||
<form method="POST" action="{{route('upload.postNewDirectory')}}">
|
||||
{!! csrf_field() !!}
|
||||
|
||||
@if($directory->id)
|
||||
<input type="hidden" value="{{$directory->id}}" name="parentDirectory" />
|
||||
@endif
|
||||
|
||||
<label>
|
||||
@lang('admin/fileManager.directoryName')
|
||||
|
||||
<input type="text" name="name" value="{{old('name')}}" />
|
||||
|
||||
@if (isset($errors) && $errors->has('name'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('name') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/fileManager.directoryDescription')
|
||||
|
||||
<textarea name="description" rows="2">{{old('description')}}</textarea>
|
||||
|
||||
@if (isset($errors) && $errors->has('description'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('description') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<button type="submit" class="button success">@lang('admin/fileManager.newDirectory')</button>
|
||||
|
||||
</form>
|
||||
@@ -1,36 +0,0 @@
|
||||
<div class="tile-overview" data-equalizer>
|
||||
|
||||
@if($directory->id)
|
||||
<div class="columns large-2">
|
||||
<div class="item directory" data-equalizer-watch>
|
||||
<div class="preview row">
|
||||
<a href="{{route('upload.overview', ['id' => $directory->parent_id])}}">
|
||||
<i class="fa fa-level-up"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="detail row text-center highlight">
|
||||
@lang('admin/fileManager.parentDirectory')
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@forelse($subdirectories as $dir)
|
||||
|
||||
<div class="columns large-2">
|
||||
<div class="item directory" data-equalizer-watch>
|
||||
<div class="preview row">
|
||||
<a href="{{route('upload.overview', ['id' => $dir->id])}}">
|
||||
<i class="fa fa-folder"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="detail row text-center highlight">
|
||||
{{str_limit($dir->name, 15)}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@empty
|
||||
{{--<em>@lang('admin/fileManager.noSubdirectories')</em>--}}
|
||||
@endforelse
|
||||
</div>
|
||||
@@ -1,58 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/fileManager.edit', ['name' => $file->original_filename]))
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<h2>@lang('admin/fileManager.edit', ['name' => $file->original_filename])</h2>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="column large-8">
|
||||
<div class="large-preview">
|
||||
{!! \App\Helpers\FileManager::getLargePreview($file) !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="column large-4">
|
||||
|
||||
<div class="row callout secondary">
|
||||
<div class="column">
|
||||
<h3>{{$file->original_filename}}</h3>
|
||||
|
||||
<ul>
|
||||
<li>@lang('admin/fileManager.createdAt'): {{$file->created_at}}</li>
|
||||
<li>@lang('admin/fileManager.updatedAt'): {{$file->updated_at}}</li>
|
||||
<li>@lang('admin/fileManager.mime'): {{$file->mime_type}}</li>
|
||||
<li>@lang('admin/fileManager.hash'): <span title="{{$file->file_hash}}">{{str_limit($file->file_hash, 10)}}</span></li>
|
||||
<li>@lang('admin/fileManager.url'): <a href="{{config('app.upload_url')}}/{{$file->filename}}">{{$file->filename}}</a></li>
|
||||
<li>@lang('admin/fileManager.fileSize'): {{\App\Helpers\FileManager::getFormattedSize($file)}}</li>
|
||||
|
||||
@foreach($extraInfo as $column => $info)
|
||||
<li>{{$column}}: {{$info}}</li>
|
||||
@endforeach
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@include('admin.fileManager.editForm')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('head_stylesheets')
|
||||
<link rel="stylesheet" href="{{asset('/resources/assets/js/vendor/highlightjs/style/default.css')}}">
|
||||
@stop
|
||||
|
||||
@section('javascripts')
|
||||
|
||||
<script type="text/javascript" src="{{asset('/resources/assets/js/vendor/highlightjs/highlight.min.js')}}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
hljs.initHighlightingOnLoad();
|
||||
</script>
|
||||
|
||||
@stop
|
||||
@@ -1,53 +0,0 @@
|
||||
@if (session('success'))
|
||||
<div data-alert class="callout success">
|
||||
<strong>{{ session('success') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div data-alert class="callout alert">
|
||||
<strong>{{ session('error') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
<form method="POST" action="{{route('upload.postEdit', ['id' => $file->id])}}" enctype="multipart/form-data">
|
||||
{!! csrf_field() !!}
|
||||
|
||||
<label>
|
||||
@lang('admin/fileManager.name')
|
||||
|
||||
<input type="text" name="name" id="name" value="{{$file->name}}"/>
|
||||
|
||||
@if (isset($errors) && $errors->has('name'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('name') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/fileManager.keywords')
|
||||
|
||||
<input type="text" name="keywords" id="keywords" value="{{$file->keywords}}"/>
|
||||
|
||||
@if (isset($errors) && $errors->has('keywords'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('keywords') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/fileManager.description')
|
||||
|
||||
<textarea rows="3" name="description" id="description">{{$file->description}}</textarea>
|
||||
</label>
|
||||
|
||||
<button type="submit" class="button primary">@lang('admin/fileManager.editButton')</button>
|
||||
<a href="{{route('upload.delete', ['id' => $file->id])}}" class="button text-center confirm alert pull-right" title="@lang('admin/fileManager.delete')">
|
||||
<i class="fa fa-remove"></i>
|
||||
</a>
|
||||
</form>
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
<div class="row tile-overview" data-equalizer>
|
||||
@forelse($files as $file)
|
||||
<div class="columns large-2">
|
||||
<div class="item" data-equalizer-watch>
|
||||
<div class="preview row" title="{{ \App\Helpers\FileManager::getFormattedSize($file) }}">
|
||||
<a href="{{route('upload.detail', ['id' => $file->id])}}">
|
||||
{!! \App\Helpers\FileManager::getPreview($file) !!}
|
||||
</a>
|
||||
</div>
|
||||
<div class="detail row text-center">
|
||||
<div class="highlight">
|
||||
{{str_limit($file->original_filename, 15)}}
|
||||
</div>
|
||||
<div class="small">
|
||||
{{$file->mime_type}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="controls row">
|
||||
<a href="{{route('upload.detail', ['id' => $file->id])}}" class="button text-center primary column large-6" title="@lang('admin/fileManager.edit')">
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
<a href="{{route('upload.delete', ['id' => $file->id])}}" class="button text-center confirm alert column large-6" title="@lang('admin/fileManager.delete')">
|
||||
<i class="fa fa-remove"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@empty
|
||||
<em>@lang('admin/fileManager.noFiles')</em>
|
||||
@endforelse
|
||||
</div>
|
||||
@@ -1,52 +0,0 @@
|
||||
<h3>@lang('admin/fileManager.newFile')</h3>
|
||||
|
||||
<form method="POST" action="{{route('upload.postFile')}}" enctype="multipart/form-data">
|
||||
{!! csrf_field() !!}
|
||||
|
||||
@if(isset($directory))
|
||||
<input type="hidden" name="directoryId" value="{{$directory->id}}" />
|
||||
@endif
|
||||
|
||||
<label>
|
||||
@lang('admin/fileManager.selectFile')
|
||||
|
||||
<input type="file" multiple name="files[]" id="file" />
|
||||
|
||||
@if (isset($errors) && $errors->has('files[]'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('files[]') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/fileManager.name')
|
||||
|
||||
<input type="text" name="name" id="name" value="{{old('name')}}"/>
|
||||
|
||||
@if (isset($errors) && $errors->has('name'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('name') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/fileManager.keywords')
|
||||
|
||||
<input type="text" name="keywords" id="keywords" value="{{old('keywords')}}" />
|
||||
|
||||
@if (isset($errors) && $errors->has('keywords'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('keywords') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/fileManager.description')
|
||||
|
||||
<textarea rows="3" name="description" id="description">{{old('description')}}</textarea>
|
||||
</label>
|
||||
<button type="submit" class="button primary">@lang('admin/fileManager.upload')</button>
|
||||
</form>
|
||||
@@ -1,71 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@if ($directory->id)
|
||||
@section('pageName', @trans('admin/fileManager.directories', ['directory' => $directory->name]))
|
||||
@else
|
||||
@section('pageName', @trans('admin/fileManager.rootDirectories'))
|
||||
@endif
|
||||
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<h2>
|
||||
@if ($directory->id)
|
||||
@lang('admin/fileManager.directories', ['directory' => $directory->name])
|
||||
@else
|
||||
@lang('admin/fileManager.rootDirectories')
|
||||
@endif
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
@if (session('success'))
|
||||
<div data-alert class="callout success">
|
||||
<strong>{{ session('success') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div data-alert class="callout alert">
|
||||
<strong>{{ session('error') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="columns large-8">
|
||||
<div class="row">
|
||||
@include('admin.fileManager.directories.subdirectoriesTiles')
|
||||
</div>
|
||||
<div class="row">
|
||||
@include('admin.fileManager.filesTiles')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="column large-4">
|
||||
<ul class="accordion" data-accordion data-allow-all-closed="true">
|
||||
<li class="accordion-item is-active" data-accordion-item>
|
||||
<a href="#" class="accordion-title">@lang('admin/fileManager.newFile')</a>
|
||||
|
||||
<div class="accordion-content" data-tab-content>
|
||||
@include('admin.fileManager.newFileForm')
|
||||
</div>
|
||||
</li>
|
||||
<li class="accordion-item" data-accordion-item>
|
||||
<a href="#" class="accordion-title">@lang('admin/fileManager.newDirectory')</a>
|
||||
|
||||
<div class="accordion-content" data-tab-content>
|
||||
@include('admin.fileManager.directories.newForm')
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@if ($directory->id)
|
||||
<li class="accordion-item" data-accordion-item>
|
||||
<a href="#" class="accordion-title">@lang('admin/fileManager.editDirectory')</a>
|
||||
|
||||
<div class="accordion-content" data-tab-content>
|
||||
@include('admin.fileManager.directories.editForm')
|
||||
</div>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
@stop
|
||||
@@ -1,25 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/history.diffPageName', ['column' => $columnName]))
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<h2>@lang('admin/history.diffPageName', ['column' => $columnName])</h2>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row callout">
|
||||
{!! $diff !!}
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<a href="{{route('content.history', ['id' => $change->content_id])}}" class="button success">
|
||||
@lang('admin/history.backToOverview')
|
||||
</a>
|
||||
|
||||
<a href="{{route('content.edit', ['id' => $change->content_id])}}" class="button success">
|
||||
@lang('admin/history.backToEdit')
|
||||
</a>
|
||||
</div>
|
||||
@stop
|
||||
@@ -1,35 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/history.pageName', ['name' => $page->title]))
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<h2>@lang('admin/history.pageName', ['name' => $page->title])</h2>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<ul class="accordion" data-accordion>
|
||||
@foreach($history['changesets'] as $revision => $changes)
|
||||
<li class="accordion-item" data-accordion-item>
|
||||
<a class="accordion-title">
|
||||
<strong>{{$history['info'][$revision]['user']['name']}}</strong> |
|
||||
{{$history['info'][$revision]['changed_at']}} |
|
||||
{{trans_choice('admin/history.numOfChanges', count($changes))}}
|
||||
</a>
|
||||
|
||||
@foreach($changes as $change)
|
||||
<div class="accordion-content" data-tab-content>
|
||||
<strong>{{$change->column_trans}}</strong>: {!! $change->diff !!}
|
||||
</div>
|
||||
@endforeach
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<a href="{{route('content.edit', ['id' => $page->id])}}" class="button success">
|
||||
@lang('admin/history.backToEdit')
|
||||
</a>
|
||||
@stop
|
||||
@@ -1,75 +0,0 @@
|
||||
<!doctype html>
|
||||
<html class="no-js" lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
@yield('head_meta')
|
||||
<title>@yield('pageName', @trans('admin/common.admin')) | {{isset($pageName) ? $pageName : ''}}</title>
|
||||
<link rel="stylesheet" href="{{asset('resources/assets/css/foundation.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('resources/assets/css/font-awesome.min.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('resources/assets/css/admin.css')}}" />
|
||||
@yield('head_stylesheets')
|
||||
</head>
|
||||
<body class="admin">
|
||||
|
||||
<div id="container">
|
||||
|
||||
<header class="row nav top-bar">
|
||||
<section class="logo columns small-1 medium-3 large-2">
|
||||
<ul class="dropdown menu language_bar_chooser" data-dropdown-menu>
|
||||
<li>
|
||||
<a href="#">@lang(LaravelLocalization::getCurrentLocaleName())</a>
|
||||
<ul class="menu">
|
||||
@foreach(LaravelLocalization::getSupportedLocales() as $localeCode => $properties)
|
||||
<li @if(LaravelLocalization::getCurrentLocale() == $localeCode) class="active" @endif>
|
||||
<a rel="alternate" hreflang="{{$localeCode}}"
|
||||
href="{{LaravelLocalization::getLocalizedURL($localeCode) }}">
|
||||
{{ $properties['native'] }}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section class="heading columns small-10 medium-8 large-8">
|
||||
@include('admin.search.miniSearchForm')
|
||||
</section>
|
||||
|
||||
<section class="profile columns small-10 medium-1 large-2">
|
||||
<ul class="vertical dropdown menu" data-dropdown-menu>
|
||||
<li>
|
||||
<a href="#">
|
||||
<img src="{{Auth::user()->gravatar(25)}}" alt="" />
|
||||
{{Auth::user()->getAttribute('name')}}
|
||||
</a>
|
||||
{!! Menu::render('profileMenu', 'foundation-dropdown-initialized') !!}
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<section class="sidebar large-2 columns">
|
||||
{!! Menu::render('mainMenu', 'foundation-drilldown') !!}
|
||||
</section>
|
||||
|
||||
<section class="content small-11 medium-9 large-10 columns">
|
||||
@yield('content')
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<footer class="row text-center">
|
||||
© {{isset($pageName) ? $pageName : ''}} {{date('Y')}}
|
||||
</footer>
|
||||
</div>
|
||||
<script src="{{asset('resources/assets/js/vendor/jquery.min.js')}}"></script>
|
||||
<script src="{{asset('resources/assets/js/vendor/what-input.min.js')}}"></script>
|
||||
<script src="{{asset('resources/assets/js/foundation.min.js')}}"></script>
|
||||
<script src="{{asset('resources/assets/js/app.js')}}"></script>
|
||||
|
||||
@yield('javascripts')
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,74 +0,0 @@
|
||||
<!doctype html>
|
||||
<html class="no-js" lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@lang('admin/loginForm.login') | {{isset($pageName) ? $pageName : ''}}</title>
|
||||
<link rel="stylesheet" href="{{asset('/resources/assets/css/foundation.css')}}" />
|
||||
<link rel="stylesheet" href="{{asset('/resources/assets/css/admin.css')}}" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="row">
|
||||
<div class="medium-6 medium-centered large-4 large-centered columns login-form">
|
||||
|
||||
@if (session('success'))
|
||||
<div data-alert class="callout success">
|
||||
<strong>{{ session('success') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div data-alert class="callout alert">
|
||||
<strong>{{ session('error') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{ route('login') }}">
|
||||
{!! csrf_field() !!}
|
||||
|
||||
<div class="row column log-in-form{{ $errors->has('email') ? ' has-error' : '' }}">
|
||||
<h4 class="text-center">@lang('admin/loginForm.formHeading')</h4>
|
||||
|
||||
<label>
|
||||
@lang('admin/loginForm.email')
|
||||
<input type="text" placeholder="somebody@example.com" value="{{old('email')}}" name="email">
|
||||
|
||||
@if ($errors->has('email'))
|
||||
<div data-alert class="callout alert text-center small">
|
||||
{{ $errors->first('email') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/loginForm.password')
|
||||
<input type="password" placeholder="@lang('admin/loginForm.password')" name="password">
|
||||
|
||||
@if ($errors->has('password'))
|
||||
<div data-alert class="callout alert text-center small">
|
||||
{{ $errors->first('password') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
{{--<label>--}}
|
||||
{{--@lang('admin/loginForm.rememberMe')--}}
|
||||
{{--<input type="checkbox" name="remember">--}}
|
||||
{{--</label>--}}
|
||||
|
||||
<p>
|
||||
<button type="submit" class="button expanded">@lang('admin/loginForm.login')</button>
|
||||
</p>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="{{asset('/resources/assets/js/vendor/jquery.min.js')}}"></script>
|
||||
<script src="{{asset('/resources/assets/js/vendor/what-input.min.js')}}"></script>
|
||||
<script src="{{asset('/resources/assets/js/foundation.min.js')}}"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,9 +0,0 @@
|
||||
<form action="{{route('search')}}" method="get">
|
||||
<div class="input-group">
|
||||
<input type="text" class="input-group-field" value="@if(isset($search)){{$search}}@endif" placeholder="@lang('search.term')" name="search" />
|
||||
|
||||
<div class="input-group-button">
|
||||
<button class="button success"><i class="fa fa-search"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -1 +0,0 @@
|
||||
@include('admin.search.form')
|
||||
@@ -1,41 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('search.pageTitle'))
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<h2>@lang('search.pageTitle')</h2>
|
||||
</div>
|
||||
|
||||
@if (session('success'))
|
||||
<div data-alert class="callout success">
|
||||
<strong>{{ session('success') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div data-alert class="callout alert">
|
||||
<strong>{{ session('error') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($search)
|
||||
<div class="row">
|
||||
<div class="column large-8">
|
||||
<h3>@lang('search.results')</h3>
|
||||
@include('admin.search.results')
|
||||
</div>
|
||||
<div class="column large-4">
|
||||
<h3>@lang('search.term')</h3>
|
||||
@include('admin.search.form')
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="row">
|
||||
@include('admin.search.form')
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@stop
|
||||
@@ -1,7 +0,0 @@
|
||||
|
||||
@foreach($results as $id => $result)
|
||||
<div class="search-result" id="{{$id}}">
|
||||
<h4>{{$result['name']}} ({{$result['count']}})</h4>
|
||||
{!! $result['content'] !!}
|
||||
</div>
|
||||
@endforeach
|
||||
@@ -1,3 +0,0 @@
|
||||
<div class="content search-result">
|
||||
<h3>{{$page->title}}</h3>
|
||||
</div>
|
||||
@@ -1,50 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/settings.overview'))
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<h2>@lang('admin/settings.overview')</h2>
|
||||
</div>
|
||||
|
||||
@if (session('success'))
|
||||
<div data-alert class="callout success">
|
||||
<strong>{{ session('success') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div data-alert class="callout alert">
|
||||
<strong>{{ session('error') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<ul class="tabs" data-tabs id="static-page-controls">
|
||||
@foreach($formSections as $id => $section)
|
||||
<li class="tabs-title @if($section->getId() == reset($formSections)->getId()) is-active @endif">
|
||||
<a href="#{{$id}}" @if($section->getId() == reset($formSections)->getId()) aria-selected="true" @endif>
|
||||
{{trans($section->getName())}}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<form action="{{route('settings.save')}}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<div class="tabs-content" data-tabs-content="static-page-controls">
|
||||
@foreach($formSections as $id => $section)
|
||||
<div class="tabs-panel @if($id == reset($formSections)->getId()) is-active @endif" id="{{$section->getId()}}">
|
||||
@include($section->getView())
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="columns large-12">
|
||||
<button type="submit" class="button success">@lang('admin/settings.save')</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@stop
|
||||
@@ -1,27 +0,0 @@
|
||||
<label>
|
||||
@lang('admin/settings.pageName')
|
||||
|
||||
<input type="text" name="pageName" value="{{old('pageName', isset($settings->pageName) ? $settings->pageName['val'] : '')}}" />
|
||||
|
||||
@if (isset($errors) && $errors->has('pageName'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('pageName') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/settings.author')
|
||||
|
||||
<input type="text" name="author" value="{{old('author', isset($settings->author) ? $settings->author['val'] : '')}}" />
|
||||
|
||||
@include('admin.settings.snippets.commonSettings', ['field' => 'author'])
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/settings.googleAnalyticsCode')
|
||||
|
||||
<input type="text" name="googleAnalyticsCode" value="{{old('googleAnalyticsCode', isset($settings->googleAnalyticsCode) ? $settings->googleAnalyticsCode['val'] : '')}}" />
|
||||
|
||||
@include('admin.settings.snippets.commonSettings', ['field' => 'googleAnalyticsCode'])
|
||||
</label>
|
||||
@@ -1,13 +0,0 @@
|
||||
<label>
|
||||
@lang('admin/settings.metaKeywords')
|
||||
|
||||
<input type="text" name="metaKeywords"
|
||||
value="{{old('metaKeywords', isset($settings->metaKeywords) ? $settings->metaKeywords['val'] : '')}}" />
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/settings.metaDescription')
|
||||
|
||||
<textarea name="metaDescription"
|
||||
rows="3">{{old('metaDescription', isset($settings->metaDescription) ? $settings->metaDescription['val'] : '')}}</textarea>
|
||||
</label>
|
||||
@@ -1,29 +0,0 @@
|
||||
<label>
|
||||
@lang('admin/settings.social.facebook')
|
||||
|
||||
<input type="text" name="facebookProfile" value="{{old('facebookProfile', isset($settings->facebookProfile) ? $settings->facebookProfile['val'] : '')}}" />
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/settings.social.twitter')
|
||||
|
||||
<input type="text" name="twitterProfile" value="{{old('twitterProfile', isset($settings->twitterProfile) ? $settings->twitterProfile['val'] : '')}}" />
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/settings.social.pinterest')
|
||||
|
||||
<input type="text" name="pinterestProfile" value="{{old('pinterestProfile', isset($settings->pinterestProfile) ? $settings->pinterestProfile['val'] : '')}}" />
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/settings.social.gplus')
|
||||
|
||||
<input type="text" name="gplusProfile" value="{{old('gplusProfile', isset($settings->gplusProfile) ? $settings->gplusProfile['val'] : '')}}" />
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/settings.social.instagram')
|
||||
|
||||
<input type="text" name="instagramProfile" value="{{old('instagramProfile', isset($settings->instagramProfile) ? $settings->instagramProfile['val'] : '')}}" />
|
||||
</label>
|
||||
@@ -1,5 +0,0 @@
|
||||
<input type="checkbox" name="commonSettings[{{$field}}]" value="1"
|
||||
@if(!isset($settings->{$field}) || $settings->{$field}['lang'] == null)
|
||||
checked
|
||||
@endif />
|
||||
@lang('admin/settings.commonSettings')
|
||||
@@ -1,21 +0,0 @@
|
||||
<div class="ace-editor-container large">
|
||||
<textarea class="ace-editor-textarea" name="{{$name}}" id="{{$name}}">{{$value}}</textarea>
|
||||
|
||||
<div class="ace-editor" id="{{$name}}Editor">{{$value}}</div>
|
||||
</div>
|
||||
|
||||
@section('javascripts')
|
||||
<script src="{{asset('resources/assets/js/vendor/ace/ace.js')}}"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
var editor = ace.edit("{{$name}}Editor");
|
||||
editor.setTheme("ace/theme/{{$theme}}");
|
||||
editor.getSession().setMode("ace/mode/{{$mode}}");
|
||||
|
||||
var textarea = $('#{{$name}}');//.hide();
|
||||
editor.getSession().setValue(textarea.val());
|
||||
editor.getSession().on('change', function(){
|
||||
textarea.val(editor.getSession().getValue());
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -1,26 +0,0 @@
|
||||
<script src="{{asset('/resources/assets/js/vendor/ckeditor/ckeditor.js')}}"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
CKEDITOR.replace ('{{$textareaId}}', {
|
||||
uiColor: "#F5F5F5",
|
||||
forcePasteAsPlainText: true,
|
||||
entities: false,
|
||||
basicEntities: false,
|
||||
entities_greek: false,
|
||||
entities_latin: false,
|
||||
removePlugins: 'elementspath,about,scayt',
|
||||
extraPlugins: 'justify',
|
||||
toolbarGroups: [
|
||||
{name: 'undo', groups: ['undo']},
|
||||
{name: 'styles'},
|
||||
{name: 'basicstyles', groups: ['basicstyles', 'cleanup']},
|
||||
{name: 'paragraph', groups: ['list', 'indent', 'align', 'blocks']},
|
||||
{name: 'links'},
|
||||
{name: 'editing', groups: ['find', 'selection']},
|
||||
{name: 'insert'},
|
||||
{name: 'forms'},
|
||||
{name: 'document', groups: ['mode', 'document', 'doctools']},
|
||||
{name: 'tools'}
|
||||
]
|
||||
});
|
||||
</script>
|
||||
@@ -1,25 +0,0 @@
|
||||
@if($directory->parent_id)
|
||||
<a href="{{route('templates.overview', ['path' => $directory->parent_id])}}" class="button full-width secondary">
|
||||
@lang('admin/templates.parentDirectory') <i class="fa fa-level-up"></i>
|
||||
</a>
|
||||
<br />
|
||||
@endif
|
||||
|
||||
<h4>@lang($directory->name)</h4>
|
||||
|
||||
{{--@if (true || isset($isWritable) && $isWritable)--}}
|
||||
{{--<div class="text-right">--}}
|
||||
{{--<a href="{{route('templates.new', ['pathId' => $directory->id])}}"><i class="fa fa-plus"></i> @lang('admin/templates.new')</a> <br />--}}
|
||||
{{--</div>--}}
|
||||
{{--@endif--}}
|
||||
|
||||
<div>
|
||||
|
||||
<h5>@lang('admin/templates.subdirectories')</h5>
|
||||
|
||||
@forelse($subdirectories as $subdirectory)
|
||||
<a href="{{route('templates.overview', ['path' => $subdirectory->id])}}">{{trans($subdirectory->name)}}</a>
|
||||
@empty
|
||||
<em>@lang('admin/templates.noSubdirectories')</em>
|
||||
@endforelse
|
||||
</div>
|
||||
@@ -1,14 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/templates.edit', ['name' => $template->template_name]))
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<h2>@lang('admin/templates.edit', ['name' => $template->template_name])</h2>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@include('admin.templates.editForm')
|
||||
</div>
|
||||
@stop
|
||||
@@ -1,54 +0,0 @@
|
||||
@if (session('success'))
|
||||
<div data-alert class="callout success">
|
||||
<strong>{{ session('success') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div data-alert class="callout alert">
|
||||
<strong>{{ session('error') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (!$isWritable)
|
||||
<div data-alert class="callout warning">
|
||||
@lang('admin/templates.notWritable', ['file' => $path->path])
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form action="{{route('templates.postEdit', ['id' => $template->id])}}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<div class="row">
|
||||
<div class="column large-8">
|
||||
<div style="height: 30em">
|
||||
@include('admin.snippets.aceEditor', [
|
||||
'value' => old('templateContent', $templateContent),
|
||||
'theme' => 'xcode',
|
||||
'mode' => 'html',
|
||||
'name' => 'templateContent'
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="column large-4">
|
||||
<label>
|
||||
@lang('admin/templates.name')
|
||||
|
||||
<input type="text" name="name" value="{{old('name', $template->name)}}" />
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/templates.description')
|
||||
|
||||
<textarea name="description" rows="3">{{old('description', $template->description)}}</textarea>
|
||||
</label>
|
||||
|
||||
<button type="submit" class="button success">
|
||||
@lang('admin/templates.edit', ['name' => $template->template_name])
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/templates.overview'))
|
||||
|
||||
@section('content')
|
||||
<h1>@lang('admin/templates.overview')</h1>
|
||||
|
||||
@if (session('success'))
|
||||
<div data-alert class="callout success">
|
||||
<strong>{{ session('success') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div data-alert class="callout alert">
|
||||
<strong>{{ session('error') }}</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<div class="column large-9">
|
||||
@include('admin.templates.templatesTiles')
|
||||
</div>
|
||||
|
||||
<div class="column large-3">
|
||||
<div class="callout">
|
||||
@include('admin.templates.directoriesList')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
@@ -1,69 +0,0 @@
|
||||
<div class="tile-overview" data-equalizer>
|
||||
@forelse($templates as $template)
|
||||
<div class="columns large-3">
|
||||
<div class="item" data-equalizer-watch>
|
||||
<div class="detail row text-center">
|
||||
<div class="highlight" title="{{$template->name}}">
|
||||
{{str_limit($template->name, 15)}}
|
||||
</div>
|
||||
<div>
|
||||
{{str_limit($template->description, 150)}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="controls row">
|
||||
@if($isWritable)
|
||||
<a data-template-id="{{$template->id}}" data-template-name="{{$template->template_name}}"
|
||||
class="button primary column large-6 copy-template"
|
||||
title="@lang('admin/templates.copy')">
|
||||
<i class="fa fa-copy"></i>
|
||||
</a>
|
||||
@else
|
||||
<a href="#" class="button primary disabled column large-6"
|
||||
title="@lang('admin/templates.cannotCopy')">
|
||||
<i class="fa fa-copy"></i>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if ($template->editable)
|
||||
<a href="{{route('templates.edit', ['id' => $template->id])}}"
|
||||
class="button success column large-6"
|
||||
title="@lang('admin/templates.edit', ['name' => $template->name])">
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@empty
|
||||
<em>@lang('admin/templates.noTemplates')</em>
|
||||
@endforelse
|
||||
</div>
|
||||
|
||||
@section('javascripts')
|
||||
<script type="text/javascript">
|
||||
$ ('.copy-template').click (function () {
|
||||
var link = $ (this);
|
||||
var templateId = link.data ('template-id');
|
||||
var templateName = link.data ('template-name');
|
||||
templateName = templateName.substr (templateName.search ('::') + 2, templateName.length);
|
||||
|
||||
var newTemplateName = prompt ("@lang('admin/templates.newTemplateName')", templateName + "_" + "@lang('admin/templates.newTemplateNameSuffix')");
|
||||
|
||||
// no name given - give up
|
||||
if (newTemplateName == null) return;
|
||||
|
||||
// copy given template
|
||||
$.post ('{{route('templates.postCopy')}}', {
|
||||
templateId: templateId,
|
||||
newName: newTemplateName,
|
||||
_token: "{{csrf_token()}}"
|
||||
}, function (data) {
|
||||
if (data.status == 'success') {
|
||||
location.reload ();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -1,66 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/userManagement.detail', ['name' => $user->name, 'email' => $user->email]))
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<h3>@lang('admin/userManagement.detail', ['name' => str_limit($user->name, 20), 'email' => $user->email])</h3>
|
||||
|
||||
<div class="columns large-4">
|
||||
<div class="callout">
|
||||
<div class="user-img text-center">
|
||||
<img src="{{$user->gravatar(200)}}" alt="" />
|
||||
</div>
|
||||
<div class="user-detail text-center">
|
||||
<ul>
|
||||
<li>{{$user->name}}</li>
|
||||
<li>{{$user->email}}</li>
|
||||
|
||||
{{--todo: add custom fields--}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="callout">
|
||||
<h3>@lang('admin/userManagement.usersActions')</h3>
|
||||
|
||||
@if (!empty($actions))
|
||||
<ul class="accordion" data-accordion>
|
||||
@foreach($actions as $action)
|
||||
<li class="accordion-item" data-accordion-item>
|
||||
<a class="accordion-title">{{$action->name}}</a>
|
||||
<div class="accordion-content" data-tab-content>
|
||||
{{date('d.m.Y G:i', strtotime($action->created_at))}} <br />
|
||||
{{$action->value}}
|
||||
</div>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@else
|
||||
<em>@lang('admin/userManagement.noActions')</em>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="columns large-8">
|
||||
|
||||
@if (session('success'))
|
||||
<div class="callout success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div class="callout alert">
|
||||
{{ session('error') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="callout">
|
||||
<h3>@lang('admin/userManagement.editUser', ['name' => str_limit($user->name, 20), 'email' => $user->email])</h3>
|
||||
@include('admin.userManagement.editForm')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
@@ -1,24 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/userManagement.editUser', ['name' => str_limit($user->name, 20), 'email' => $user->email]))
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<h1>@lang('admin/userManagement.editUser', ['name' => str_limit($user->name, 20), 'email' => $user->email])</h1>
|
||||
|
||||
@if (session('success'))
|
||||
<div class="callout success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div class="callout alert">
|
||||
{{ session('error') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@include('admin.userManagement.editForm')
|
||||
</div>
|
||||
@stop
|
||||
@@ -1,64 +0,0 @@
|
||||
<form method="POST" action="{{route('users.editPost', ['id' => $user->id])}}">
|
||||
{!! csrf_field() !!}
|
||||
|
||||
<label>
|
||||
@lang('admin/userManagement.name')
|
||||
<input type="text" placeholder="@lang('admin/userManagement.name')" value="{{$user->name}}" name="name">
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/userManagement.email')
|
||||
|
||||
<input type="text" name="email" value="{{$user->email}}" placeholder="somebody@example.com">
|
||||
|
||||
@if (isset($errors) && $errors->has('email'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('email') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/userManagement.password') <em>(@lang('admin/userManagement.passwordLeaveEmpty'))</em>
|
||||
|
||||
<input type="text" name="password" value="">
|
||||
</label>
|
||||
|
||||
@if (\Auth::user()->role == \App\Models\User::ROLE_ADMIN && \Auth::user()->id != $user->id)
|
||||
<label>
|
||||
@lang('admin/userManagement.roles')
|
||||
|
||||
<select name="role">
|
||||
@foreach($roles as $role => $translation)
|
||||
<option value="{{$role}}" @if($role == $user->role) selected @endif>{{$translation}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</label>
|
||||
|
||||
@if (isset($errors) && $errors->has('role'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('role') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<label>
|
||||
@lang('admin/userManagement.status')
|
||||
|
||||
<select name="status">
|
||||
@foreach($states as $status => $translation)
|
||||
<option value="{{$status}}" @if($status == $user->status) selected @endif>{{$translation}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</label>
|
||||
|
||||
@if (isset($errors) && $errors->has('role'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('role') }}
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<label>
|
||||
<button type="submit" class="button success">@lang('admin/userManagement.update')</button>
|
||||
</label>
|
||||
</form>
|
||||
@@ -1,22 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/userManagement.addNewUser'))
|
||||
|
||||
@section('content')
|
||||
|
||||
<h1>@lang('admin/userManagement.addNewUser')</h1>
|
||||
|
||||
@if (session('success'))
|
||||
<div class="callout success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div class="callout alert">
|
||||
{{ session('error') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@include('admin.userManagement.newForm', ['roles' => $roles])
|
||||
@stop
|
||||
@@ -1,54 +0,0 @@
|
||||
<form method="POST" action="{{route('users.newPost')}}">
|
||||
{!! csrf_field() !!}
|
||||
|
||||
<label>
|
||||
@lang('admin/userManagement.name')
|
||||
<input type="text" placeholder="@lang('admin/userManagement.name')" name="name">
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/userManagement.email')
|
||||
|
||||
<input type="text" name="email" placeholder="somebody@example.com">
|
||||
|
||||
@if (isset($errors) && $errors->has('email'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('email') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/userManagement.password')
|
||||
|
||||
<input type="text" name="password">
|
||||
|
||||
@if (isset($errors) && $errors->has('password'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('password') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
|
||||
<label>
|
||||
@lang('admin/userManagement.roles')
|
||||
|
||||
<select name="role">
|
||||
@foreach($roles as $role => $translation)
|
||||
<option value="{{$role}}">{{$translation}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</label>
|
||||
|
||||
|
||||
@if (isset($errors) && $errors->has('role'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('role') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<label>
|
||||
<button type="submit" class="button success">@lang('admin/userManagement.register')</button>
|
||||
</label>
|
||||
</form>
|
||||
@@ -1,41 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/userManagement.overview'))
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<h2>@lang('admin/userManagement.overview')</h2>
|
||||
|
||||
<p>
|
||||
@foreach($statuses as $status => $translation)
|
||||
<a class="button tiny @if($status != $currentStatus) secondary @else primary @endif" href="{{route('users.overview', ['status' => $status])}}">{{$translation}}</a>
|
||||
@endforeach
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row" data-equalizer>
|
||||
@forelse($users as $user)
|
||||
<div class="user-detail large-2 medium-3 small-4 columns">
|
||||
<div class="callout text-center small" data-equalizer-watch>
|
||||
<a href="{{route('users.detail', ['id' => $user->id])}}" data-tooltip title="{{$roles[$user->role]}}">
|
||||
<div class="user-img">
|
||||
<img src="{{$user->gravatar(350)}}" alt="" />
|
||||
</div>
|
||||
<div class="user-info text-center">
|
||||
{{ $user->name}}
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@empty
|
||||
<em>@lang('admin/userManagement.noUsers')</em>
|
||||
@endforelse
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row pagination">
|
||||
{!! $users->render() !!}
|
||||
</div>
|
||||
@stop
|
||||
@@ -1,10 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/widgetAreas.edit', ['name' => $area->name]))
|
||||
|
||||
@section('content')
|
||||
<h1>@lang('admin/widgetAreas.edit', ['name' => $area->name])</h1>
|
||||
|
||||
@include('admin.widgets.area.editForm')
|
||||
@stop
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
@if (session('success'))
|
||||
<div class="callout success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div class="callout alert">
|
||||
{{ session('error') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form action="{{route('widgetareas.postEdit', ['id' => $area->id])}}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<label>
|
||||
@lang('admin/widgetAreas.name')
|
||||
|
||||
<input type="text" name="name" value="{{$area->name}}" placeholder="@lang('admin/widgetAreas.name')" />
|
||||
|
||||
@if (isset($errors) && $errors->has('name'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('name') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/widgetAreas.code')
|
||||
|
||||
<input type="text" name="code" disabled="true" value="{{$area->code}}"
|
||||
placeholder="@lang('admin/widgetAreas.code')" />
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/widgetAreas.description')
|
||||
|
||||
<textarea rows="3" name="description"
|
||||
placeholder="@lang('admin/widgetAreas.description')">{{$area->description}}</textarea>
|
||||
|
||||
@if (isset($errors) && $errors->has('description'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('description') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<button type="submit" class="button success">@lang('admin/widgetAreas.editButton')</button>
|
||||
</form>
|
||||
@@ -1,10 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/widgetAreas.new'))
|
||||
|
||||
@section('content')
|
||||
<h1>@lang('admin/widgetAreas.new')</h1>
|
||||
|
||||
@include('admin.widgets.area.newForm')
|
||||
@stop
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
@if (!isset($hideMessages))
|
||||
@if (session('success'))
|
||||
<div class="callout success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div class="callout alert">
|
||||
{{ session('error') }}
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<form action="{{route('widgetareas.postNew')}}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<label>
|
||||
@lang('admin/widgetAreas.name')
|
||||
|
||||
<input type="text" name="name" value="{{old("name")}}" placeholder="@lang('admin/widgetAreas.name')" />
|
||||
|
||||
@if (isset($errors) && $errors->has('name'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('name') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/widgetAreas.code')
|
||||
|
||||
<input type="text" name="code" value="{{old("code")}}" placeholder="@lang('admin/widgetAreas.code')" />
|
||||
|
||||
@if (isset($errors) && $errors->has('code'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('code') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('admin/widgetAreas.description')
|
||||
|
||||
<textarea rows="3" name="description"
|
||||
placeholder="@lang('admin/widgetAreas.description')">{{old("description")}}</textarea>
|
||||
|
||||
@if (isset($errors) && $errors->has('description'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('description') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<button type="submit" class="button success">@lang('admin/widgetAreas.createNew')</button>
|
||||
</form>
|
||||
@@ -1,62 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/widgetAreas.overview'))
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<h2>@lang('admin/widgetAreas.overview')</h2>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
@if (session('success'))
|
||||
<div class="callout success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div class="callout alert">
|
||||
{{ session('error') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="column large-8">
|
||||
@if (count($areas) > 0)
|
||||
<table class="full-width">
|
||||
<tr>
|
||||
<th>@lang('admin/widgetAreas.name')</th>
|
||||
<th>@lang('admin/widgetAreas.code')</th>
|
||||
<th>@lang('admin/widgetAreas.description')</th>
|
||||
<th>@lang('admin/widgetAreas.actions')</th>
|
||||
</tr>
|
||||
@foreach($areas as $area)
|
||||
<tr>
|
||||
<td>{{$area->name}}</td>
|
||||
<td>{{$area->code}}</td>
|
||||
<td>{{str_limit($area->description, 100)}}</td>
|
||||
<td class="text-center">
|
||||
<a href="{{route('widgets.associate', ['widgetArea' => $area->id])}}"><i class="fa fa-plus"></i></a>
|
||||
<a href="{{route('widgetareas.edit', ['id' => $area->id])}}"><i class="fa fa-edit"></i></a>
|
||||
<a href="{{route('widgetareas.delete', ['id' => $area->id])}}"><i
|
||||
class="fa fa-remove confirm"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@else
|
||||
<em>@lang('admin/widgetAreas.noEntries')</em>
|
||||
@endif
|
||||
</div>
|
||||
<div class="column large-4">
|
||||
<h3>@lang('admin/widgetAreas.new')</h3>
|
||||
|
||||
@include('admin.widgets.area.newForm', ['hideMessages' => true])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row pagination">
|
||||
{!! $areas->render() !!}
|
||||
</div>
|
||||
@stop
|
||||
@@ -1,79 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('admin/widgets.overview'))
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
|
||||
@if (session('success'))
|
||||
<div class="callout success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div class="callout alert">
|
||||
{{ session('error') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="column large-9 tile-overview" data-equalizer>
|
||||
|
||||
<h2>@lang('admin/widgets.overview')</h2>
|
||||
|
||||
@forelse($widgets as $widget)
|
||||
<div class="column large-4">
|
||||
<div class="item" data-equalizer-watch>
|
||||
<h4>{{str_limit($widget->name, 20)}}</h4>
|
||||
<p>
|
||||
{{trans(call_user_func([$widget->widget_type_handler, 'getName']))}}
|
||||
</p>
|
||||
<p>
|
||||
{{str_limit($widget->description, 150)}}
|
||||
</p>
|
||||
|
||||
<div class="controls row text-center">
|
||||
<a href="{{route('widgets.edit', ['id' => $widget->id])}}" class="button column large-6 primary"><i class="fa fa-edit"></i></a>
|
||||
|
||||
@if (in_array($widget->id, $associatedWidgetIds))
|
||||
<a href="{{route('widgets.deleteAssociation', ['widgetId' => $widget->id, 'widgetArea' => $widgetArea->id])}}"
|
||||
class="button column confirm large-6 alert">
|
||||
<i class="fa fa-remove"></i>
|
||||
</a>
|
||||
@else
|
||||
<a href="{{route('widgets.makeAssociation', ['widgetId' => $widget->id, 'widgetArea' => $widgetArea->id])}}"
|
||||
class="button column large-6 success"><i class="fa fa-plus"></i></a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@empty
|
||||
<em>@lang('admin/widgets.noEntries')</em>
|
||||
@endforelse
|
||||
|
||||
<div class="row">
|
||||
{!! $widgets->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="column large-3">
|
||||
<h2>{{$widgetArea->name}}</h2>
|
||||
|
||||
<p>
|
||||
{{$widgetArea->description}}
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>@lang('admin/widgets.createdAt'): {{$widgetArea->created_at}}</li>
|
||||
<li>@lang('admin/widgets.updatedAt'): {{$widgetArea->updated_at}}</li>
|
||||
</ul>
|
||||
|
||||
<a href="{{route('widgetareas.edit', ['id' => $widgetArea->id])}}">@lang('admin/widgetAreas.editButton')</a>
|
||||
|
||||
@if (!empty($associatedWidgetIds))
|
||||
<h3>@lang('admin/widgets.preview')</h3>
|
||||
|
||||
@widgetArea($widgetArea->code)
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
@@ -1,20 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('widgets/htmlCode.edit', ['name' => $widget->name]))
|
||||
|
||||
@section('content')
|
||||
<h1>@lang('widgets/htmlCode.edit', ['name' => $widget->name])</h1>
|
||||
|
||||
<div class="row">
|
||||
<div class="column large-8">
|
||||
@include('admin.widgets.htmlCode.editForm')
|
||||
|
||||
</div>
|
||||
<div class="column large-4">
|
||||
<h3>@lang('widgets/htmlCode.preview')</h3>
|
||||
|
||||
@widgetPreview($widget)
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
@if (!isset($hideMessages))
|
||||
@if (session('success'))
|
||||
<div class="callout success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (session('error'))
|
||||
<div class="callout alert">
|
||||
{{ session('error') }}
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<form action="{{route('widgets.postEdit', ['id' => $widget->id])}}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<label>
|
||||
@lang('widgets/htmlCode.name')
|
||||
|
||||
<input type="text" name="name" value="{{$widget->name}}" placeholder="@lang('widgets/htmlCode.name')" />
|
||||
|
||||
@if (isset($errors) && $errors->has('name'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('name') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('widgets/htmlCode.description')
|
||||
|
||||
<input type="text" name="description" placeholder="@lang('widgets/htmlCode.description')"
|
||||
value="{{$widget->description}}" />
|
||||
|
||||
@if (isset($errors) && $errors->has('description'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('description') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('widgets/htmlCode.containerClass')
|
||||
|
||||
<input type="text" name="containerClass" placeholder="@lang('widgets/htmlCode.containerClass')"
|
||||
value="{{$settings->containerClass}}" />
|
||||
|
||||
@if (isset($errors) && $errors->has('containerClass'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('description') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<label>
|
||||
@lang('widgets/htmlCode.code')
|
||||
|
||||
<textarea rows="4" name="code" placeholder="@lang('widgets/htmlCode.code')">{{$settings->code}}</textarea>
|
||||
|
||||
@if (isset($errors) && $errors->has('code'))
|
||||
<div class="callout alert">
|
||||
{{ $errors->first('code') }}
|
||||
</div>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<button type="submit" class="button success">@lang('widgets/htmlCode.editExisting')</button>
|
||||
</form>
|
||||
@@ -1,10 +0,0 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('pageName', @trans('widgets/htmlCode.new'))
|
||||
|
||||
@section('content')
|
||||
<h1>@lang('widgets/htmlCode.new')</h1>
|
||||
|
||||
@include('admin.widgets.htmlCode.newForm')
|
||||
@stop
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user