summaryrefslogtreecommitdiffstats
path: root/MCServer/webadmin/template.lua
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-10-06 10:46:46 +0200
committerMattes D <github@xoft.cz>2014-10-06 10:46:46 +0200
commit75003e15377560bc7ceb027a91e9b35a03f5acaa (patch)
treec419aa1db06c555bdeb1278aedefd52fded9e5fa /MCServer/webadmin/template.lua
parentMerge pull request #1510 from mc-server/TimedEvent (diff)
parentadded font callback (diff)
downloadcuberite-75003e15377560bc7ceb027a91e9b35a03f5acaa.tar
cuberite-75003e15377560bc7ceb027a91e9b35a03f5acaa.tar.gz
cuberite-75003e15377560bc7ceb027a91e9b35a03f5acaa.tar.bz2
cuberite-75003e15377560bc7ceb027a91e9b35a03f5acaa.tar.lz
cuberite-75003e15377560bc7ceb027a91e9b35a03f5acaa.tar.xz
cuberite-75003e15377560bc7ceb027a91e9b35a03f5acaa.tar.zst
cuberite-75003e15377560bc7ceb027a91e9b35a03f5acaa.zip
Diffstat (limited to 'MCServer/webadmin/template.lua')
-rw-r--r--MCServer/webadmin/template.lua63
1 files changed, 32 insertions, 31 deletions
diff --git a/MCServer/webadmin/template.lua b/MCServer/webadmin/template.lua
index a7480f83e..84a50b055 100644
--- a/MCServer/webadmin/template.lua
+++ b/MCServer/webadmin/template.lua
@@ -70,25 +70,33 @@ function ShowPage(WebAdmin, TemplateRequest)
PageContent, SubTitle = GetDefaultPage()
end
+ local reqParamsClass = ""
+
+ for key,value in pairs(TemplateRequest.Request.Params) do
+ reqParamsClass = reqParamsClass .. " param-" .. string.lower(string.gsub(key, "[^a-zA-Z0-9]+", "-") .. "-" .. string.gsub(value, "[^a-zA-Z0-9]+", "-"))
+ end
+
+ if (string.gsub(reqParamsClass, "%s", "") == "") then
+ reqParamsClass = " no-param"
+ end
+
Output([[
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" href="/favicon.ico">
<title>]] .. Title .. [[</title>
-<link rel="stylesheet" type="text/css" media="screen" href="/style.css">
+<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,600,300' rel='stylesheet' type='text/css'>
+<link rel="stylesheet" type="text/css" href="/style.css">
</head>
-
<body>
- <div id="wrapper">
- <!-- h1 tag stays for the logo, you can use the a tag for linking the index page -->
- <h1>
- <a href="]] .. BaseURL .. [["><span>MCServer</span></a>
- </h1>
- <div id="containerHolder">
- <div id="container">
- <div id="sidebar">
- <ul class="sideNav">
+<div id="wrapper">
+ <div id="containerHolder">
+ <a href="./" class="title light">MCServer</a>
+ <div id="container">
+ <div id="sidebar">
+ <ul class="sideNav">
+ <li class='link'><a href=']] .. BaseURL .. [['>Home</a></li>
]])
@@ -100,7 +108,7 @@ function ShowPage(WebAdmin, TemplateRequest)
Output("<li>"..PluginWebTitle.."</li>\n");
for webname,prettyname in pairs(TabNames) do
- Output("<li><a href='" .. BaseURL .. PluginWebTitle .. "/" .. webname .. "'>" .. prettyname .. "</a></li>\n")
+ Output("<li class='link'><a href='" .. BaseURL .. PluginWebTitle .. "/" .. webname .. "'>" .. prettyname .. "</a></li>\n")
end
end
end
@@ -108,30 +116,23 @@ function ShowPage(WebAdmin, TemplateRequest)
Output([[
</ul>
- <!-- // .sideNav -->
- </div>
- <!-- // #sidebar -->
- <!-- h2 stays for breadcrumbs -->
- <h2>Welcome ]] .. TemplateRequest.Request.Username .. [[</h2>
- <div id="main">
- <h3>]] .. SubTitle .. [[</h3>
- ]] .. PageContent .. [[
- </div>
- <!-- // #main -->
+ </div>
+
+ <div id="main" class="page-]] .. string.lower(PluginPage.PluginName .. "-" .. string.gsub(PluginPage.TabName, "[^a-zA-Z0-9]+", "-")) .. reqParamsClass .. [[">
+ <h2 class="welcome-msg">Welcome <span class="username">]] .. TemplateRequest.Request.Username .. [[</span></h2>
- <div class="clear"></div>
+ <hr/>
- </div>
- <!-- // #container -->
- </div>
- <!-- // #containerHolder -->
-
- <p id="footer">MCServer is using: ]] .. MemoryUsageKiB / 1024 .. [[ MiB of memory; Current chunk count: ]] .. NumChunks .. [[ </p>
+ <h3>]] .. SubTitle .. [[</h3>
+ ]] .. PageContent .. [[</div>
+ <div class="clear"></div>
+ </div>
</div>
- <!-- // #wrapper -->
+ <div id="footer"><div class="fleft">running MCServer using <span class="bold">]] .. MemoryUsageKiB / 1024 .. [[MB</span> of memory; <span class="bold">]] .. NumChunks .. [[</span> chunks</div><div class="fright">design by <a href="//www.github.com/WebFreak001">WebFreak001</a></div><div class="clear"></div></div>
+</div>
</body>
</html>
- ]])
+]])
return table.concat(SiteContent)
end