Commit 27ae1aa1 authored by echicken's avatar echicken 🐔

If ctrl/modopts.ini -> [web] is missing, start with minimum

viable best-guess settings ({web_directory: '../webv4}). This
gives lib/init.js a chance to set further defaults.
parent 34e370b7
<?xjs
var settings = load('modopts.js', 'web');
var settings = load('modopts.js', 'web') || { web_directory: '../webv4' };
load(settings.web_directory + '/lib/init.js');
load(settings.web_lib + 'auth.js');
load(settings.web_lib + 'pages.js');
load(settings.web_lib + 'sidebar.js');
......@@ -17,14 +16,10 @@
var page_ctrl = getCtrlLine(pagePath);
?>
<?xjs
function _sidebar() {
if (settings.layout_sidebar_off || page_ctrl.options.no_sidebar) return;
?>
<? function _sidebar() { ?>
<? if (settings.layout_sidebar_off || page_ctrl.options.no_sidebar) return; ?>
<div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar"><? writeSidebarModules(); ?></div>
<?xjs
}
?>
<? } ?>
<?xjs
function loadComponent(fn) {
......@@ -54,9 +49,9 @@
<link href="./bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="./css/offcanvas.css" rel="stylesheet">
<link href="./css/style.css" rel="stylesheet">
<?xjs if (file_exists(settings.web_root + 'css/custom.css')) { ?>
<? if (file_exists(settings.web_root + 'css/custom.css')) { ?>
<link href="./css/custom.css" rel="stylesheet">
<?xjs } ?>
<? } ?>
</head>
<body>
......@@ -73,22 +68,22 @@
<div class="container<?xjs if (settings.layout_full_width) write('-fluid'); ?>">
<div class="row row-offcanvas row-offcanvas-<?xjs write(settings.layout_sidebar_left ? 'left' : 'right'); ?>">
<?xjs if (settings.layout_sidebar_left) _sidebar(); ?>
<? if (settings.layout_sidebar_left) _sidebar(); ?>
<div class="col-xs-12 col-sm-<?xjs write(settings.layout_sidebar_off || page_ctrl.options.no_sidebar ? 12 : 9); ?>">
<div style="clear:both;">
<p class="pull-<?xjs write(settings.layout_sidebar_left ? 'left' : 'right'); ?> visible-xs">
<button title="Toggle sidebar" type="button" class="btn btn-primary btn-xs" data-toggle="offcanvas"><span class="glyphicon glyphicon-tasks"></span><?xjs write(locale.strings.main.label_sidebar); ?></button>
</p>
</div>
<?xjs writePage(page); ?>
<? writePage(page); ?>
</div>
<?xjs if (!settings.layout_sidebar_left || settings.layout_sidebar_right) _sidebar(); ?>
<? if (!settings.layout_sidebar_left || settings.layout_sidebar_right) _sidebar(); ?>
</div>
<hr>
<footer>
<?xjs if (!loadComponent('footer.xjs')) { ?>
<p>&copy; <?xjs write(system.name + ", " + strftime("%Y")); ?></p>
<?xjs } ?>
<? if (!loadComponent('footer.xjs')) { ?>
<p>&copy; <? write(system.name + ", " + strftime("%Y")); ?></p>
<? } ?>
</footer>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment