mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 07:33:12 +09:00
Move the ejs templates to the default Express.js views/ folder and change their extension to .ejs. Reconfigure Express.js to look for templates in the views folders as well as the plugins folder. This enables plugins to render templates using paths of following format "pluginName/path/to/page-or-view".
38 lines
1.3 KiB
Plaintext
38 lines
1.3 KiB
Plaintext
<nav class="navbar nav-pills nav-fill">
|
|
<div class="nav-item col-3">
|
|
<a class="navbar-brand border-0" href="/">
|
|
<img src="/pictures/logo.png" width="50" height="50" class="d-inline-block align-middle " alt=""/>
|
|
<h3 class=" ml-3 nav-title">Clusterio</h3>
|
|
</a>
|
|
</div>
|
|
<div class="nav-item mr-1">
|
|
<a class="nav-link align-middle" href="/">Storage</a>
|
|
</div>
|
|
<div class="nav-item mr-1">
|
|
<a class="nav-link align-middle" href="/nodes">Slaves</a>
|
|
</div>
|
|
<%# Very ugly ejs code to hide the Players button if the playerManager plugin isn`t installed %>
|
|
<%
|
|
let sidebarPluginButtonsHtml = "";
|
|
for(let o in locals.masterPlugins){
|
|
let plug = locals.masterPlugins[o];
|
|
if(plug.main
|
|
&& plug.main.ui
|
|
&& typeof plug.main.ui.sidebar == "object"
|
|
&& Array.isArray(plug.main.ui.sidebar)){
|
|
let sidebarEntries = plug.main.ui.sidebar;
|
|
for(let i in sidebarEntries){
|
|
let button = sidebarEntries[i];
|
|
if(button.getHtml && typeof button.getHtml == "function"){
|
|
sidebarPluginButtonsHtml += button.getHtml();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
%>
|
|
<%- sidebarPluginButtonsHtml %>
|
|
<div class="nav-item">
|
|
<a class="nav-link align-middle" href="/settings">Settings</a>
|
|
</div>
|
|
</nav>
|