fixed panel stylesheet
This commit is contained in:
parent
34886a0daf
commit
c14289855a
@ -99,8 +99,8 @@ class Base
|
||||
$this->setPhpConfig();
|
||||
$this->_load_files();
|
||||
$this->_load_active_record();
|
||||
$this->initPlugins();
|
||||
$this->setDispatcher();
|
||||
$this->initPlugins();
|
||||
$this->init();
|
||||
$this->runInitializers();
|
||||
}
|
||||
@ -156,6 +156,7 @@ class Base
|
||||
|
||||
public function router()
|
||||
{
|
||||
// if (!$this->_dispatcher) vpe((new \Exception)->getTraceAsString());
|
||||
return $this->_dispatcher->router();
|
||||
}
|
||||
|
||||
|
@ -1,6 +0,0 @@
|
||||
/**
|
||||
*= require bootstrap
|
||||
*/
|
||||
body {
|
||||
padding-top: 60px;
|
||||
}
|
5
lib/Rails/Panel/assets/railspanel.css.php
Executable file
5
lib/Rails/Panel/assets/railspanel.css.php
Executable file
@ -0,0 +1,5 @@
|
||||
<?= file_get_contents(__DIR__ . '/railspanel-bootstrap.css') ?>
|
||||
|
||||
body {
|
||||
padding-top: 60px;
|
||||
}
|
@ -13,13 +13,15 @@ class AdminController extends ApplicationController
|
||||
|
||||
public function stylesheet()
|
||||
{
|
||||
$path = realpath(__DIR__ . '/../assets/panel.css');
|
||||
$file = new Rails\Assets\File('css', $path);
|
||||
$parser = new Rails\Assets\Parser\Base($file);
|
||||
$parser->parse();
|
||||
$file = realpath(__DIR__ . '/../assets/railspanel.css.php');
|
||||
ob_start();
|
||||
require $file;
|
||||
// $file = new Rails\Assets\File('css', $path);
|
||||
// $parser = new Rails\Assets\Parser\Base($file);
|
||||
// $parser->parse();
|
||||
|
||||
$this->response()->headers()->setContentType('text/css');
|
||||
$this->render(['text' => $parser->parsedFile()]);
|
||||
$this->render(['text' => ob_get_clean()]);
|
||||
}
|
||||
|
||||
final public function genTableData()
|
||||
|
@ -131,11 +131,7 @@ final class Rails
|
||||
$prefix = str_replace('\\', '/', self::$config->assets->prefix);
|
||||
|
||||
$router = self::application()->router();
|
||||
if ($router && $router->route() && $router->route()->isPanelRoute()) {
|
||||
$basePaths = [
|
||||
realpath(Rails::path() . '/../../vendor/assets')
|
||||
];
|
||||
} else {
|
||||
if (!$router || !$router->route() || !$router->route()->isPanelRoute()) {
|
||||
$basePaths = [
|
||||
str_replace('\\', '/', Rails::config()->paths->application) . $prefix,
|
||||
str_replace('\\', '/', Rails::root() . '/lib') . $prefix,
|
||||
@ -167,7 +163,7 @@ final class Rails
|
||||
|
||||
self::$assets->addPaths($paths);
|
||||
|
||||
self::$assets->addFilePatterns($this->config()->patterns->toArray();
|
||||
self::$assets->addFilePatterns(self::config()->assets->patterns->toArray());
|
||||
}
|
||||
return self::$assets;
|
||||
}
|
||||
@ -434,9 +430,10 @@ final class Rails
|
||||
|
||||
$autoloadFile = defined("COMPOSER_AUTOLOAD_FILE") ?
|
||||
COMPOSER_AUTOLOAD_FILE :
|
||||
Rails::path() . '/../../../autoload.php';
|
||||
Rails::path() . '/../../../../autoload.php';
|
||||
self::$loader->setComposerAutoload(require $autoloadFile);
|
||||
|
||||
// $loader = require $autoloadFile;
|
||||
// vpe($loader->loadClass("Rails\Bootstrap2\Initializer"));
|
||||
spl_autoload_register([Rails::loader(), 'loadClass']);
|
||||
|
||||
set_exception_handler('Rails::exceptionHandler');
|
||||
|
1
vendor/README
vendored
1
vendor/README
vendored
@ -1 +0,0 @@
|
||||
This assets folder is used by the Rails Panel.
|
Reference in New Issue
Block a user