luci-theme-material: Decrease font and spacing

1) Decrease font and spacing
2) Synchronized to the LUCI version 99f5d4e

Signed-off-by: Lutty Yang <lutty@wcan.in>
This commit is contained in:
Lutty Yang 2016-02-18 20:29:19 +08:00
parent 99f5d4e902
commit c63f8be459
3 changed files with 308 additions and 236 deletions

View file

@ -57,7 +57,7 @@
.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 { .h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
font-family: inherit; font-family: inherit;
font-weight: 500; font-weight: 400;
line-height: 1.1; line-height: 1.1;
color: inherit; color: inherit;
} }
@ -67,16 +67,16 @@ html {
-ms-text-size-adjust: 100%; -ms-text-size-adjust: 100%;
} }
body {
font-size: 0.8rem;
background-color: #EEE;
}
html, body { html, body {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
height: 100%; height: 100%;
font-family: "Helvetica Neue", Helvetica, Microsoft Yahei, Hiragino Sans GB, WenQuanYi Micro Hei, sans-serif; font-family: Microsoft Yahei, WenQuanYi Micro Hei, sans-serif, "Helvetica Neue", Helvetica, Hiragino Sans GB;
font-size: 62.5%; /* font-size 1rem = 10px on default browser settings */
}
body {
font-size: 1.3rem; /* 1.3rem = 13px */
} }
select { select {
@ -92,23 +92,19 @@ input {
background-color: transparent; background-color: transparent;
color: rgba(0, 0, 0, .87); color: rgba(0, 0, 0, .87);
border: none; border: none;
border-bottom: 1px solid rgba(0, 0, 0, .26); border-bottom: 2px solid rgba(0, 0, 0, .26);
outline: 0; outline: 0;
padding: 0; padding: 0;
box-shadow: none; box-shadow: none;
border-radius: 0; border-radius: 0;
background-image: none; background-image: none;
height: 2rem; height: 1.8rem;
font-size: 1.1rem; font-size: 0.8rem;
} }
select:not([multiple="multiple"]):focus, select:not([multiple="multiple"]):focus,
input:focus { input:focus {
height: 2rem;
height: calc(2rem + 1px);
margin-bottom: -1px;
border-color: #0099CC; border-color: #0099CC;
border-width: 2px;
} }
select[multiple="multiple"] { select[multiple="multiple"] {
@ -125,7 +121,7 @@ abbr {
cursor: help; cursor: help;
} }
hr{ hr {
margin: 1rem 0; margin: 1rem 0;
border-color: #EEE; border-color: #EEE;
opacity: 0.1; opacity: 0.1;
@ -181,7 +177,7 @@ footer > a {
text-align: center; text-align: center;
margin-top: 2rem; margin-top: 2rem;
color: #888; color: #888;
font-size: 1.3rem; font-size: 1.2rem;
} }
.main > .loading > span > .loading-img:before { .main > .loading > span > .loading-img:before {
@ -211,18 +207,17 @@ footer > a {
float: left; float: left;
top: 4rem; top: 4rem;
width: 15%; width: 15%;
width: calc(0% + 17rem); width: calc(0% + 15rem);
height: 100%; height: 100%;
height: calc(100% - 4rem); height: calc(100% - 4rem);
background-color: white; background-color: white;
overflow-x: auto; overflow-x: auto;
position: fixed; position: fixed;
} }
.main-right { .main-right {
width: 85%; width: 85%;
width: calc(100% - 17rem); width: calc(100% - 15rem);
float: right; float: right;
height: 100%; height: 100%;
background-color: #EEE; background-color: #EEE;
@ -251,7 +246,7 @@ header > .container {
} }
header > .container > .brand { header > .container > .brand {
font-size: 1.5rem; font-size: 1.4rem;
color: white; color: white;
text-decoration: none; text-decoration: none;
cursor: default; cursor: default;
@ -308,7 +303,7 @@ header > .container > .brand {
background-image: none; background-image: none;
min-width: 6rem; min-width: 6rem;
padding: 0.5rem 1rem; padding: 0.5rem 1rem;
font-size: 1.1rem; font-size: 0.9rem;
line-height: 1.42857143; line-height: 1.42857143;
color: #fff; color: #fff;
background-color: #5bc0de; background-color: #5bc0de;
@ -349,7 +344,7 @@ header > .container > .brand {
padding: 0.5rem 1rem; padding: 0.5rem 1rem;
text-decoration: none; text-decoration: none;
cursor: default; cursor: default;
font-size: 1.2rem; font-size: 1.15rem;
} }
.main > .main-left > .nav > li:hover, .main > .main-left > .nav > li:hover,
@ -396,21 +391,21 @@ li {
} }
h1 { h1 {
font-size: 4rem; font-size: 2rem;
padding-bottom: 10px; padding-bottom: 10px;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
h2 { h2 {
margin: 2rem 0 0 0; margin: 2rem 0 0 0;
font-size: 2.5rem; font-size: 1.8rem;
padding-bottom: 10px; padding-bottom: 10px;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
h3 { h3 {
margin: 2rem 0 0 0; margin: 2rem 0 0 0;
font-size: 2rem; font-size: 1.4rem;
padding-bottom: 10px; padding-bottom: 10px;
} }
@ -438,6 +433,10 @@ fieldset {
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
} }
.cbi-map-descr + fieldset {
margin-top: 1rem;
}
fieldset > legend { fieldset > legend {
display: none !important; display: none !important;
} }
@ -454,8 +453,8 @@ fieldset > fieldset {
display: block; display: block;
line-height: 1; line-height: 1;
color: #404040; color: #404040;
font-size: 1.9rem; font-size: 1.4rem;
padding-bottom: 2rem; padding-bottom: 1rem;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
@ -467,10 +466,8 @@ table {
} }
table > tbody > tr > td, table > tbody > tr > th, table > tfoot > tr > td, table > tfoot > tr > th, table > thead > tr > td, table > thead > tr > th { table > tbody > tr > td, table > tbody > tr > th, table > tfoot > tr > td, table > tfoot > tr > th, table > thead > tr > td, table > thead > tr > th {
padding: 8px; padding: .5rem;
line-height: 1.42857143;
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
white-space: nowrap; white-space: nowrap;
} }
@ -482,7 +479,7 @@ table > tbody > tr > td, table > tbody > tr > th, table > tfoot > tr > td, table
text-align: center; text-align: center;
} }
fieldset > table > tbody > tr:nth-of-type(odd) { fieldset > table > tbody > tr:nth-of-type(2n) {
background-color: #f9f9f9; background-color: #f9f9f9;
} }
@ -494,7 +491,7 @@ fieldset > table > tbody > tr:nth-of-type(odd) {
#conns > div, #conns > div,
#memtotal > div { #memtotal > div {
width: 100% !important; width: 100% !important;
height: 1.4rem !important; height: 1.2rem !important;
} }
#swaptotal > div > div, #swaptotal > div > div,
@ -503,7 +500,7 @@ fieldset > table > tbody > tr:nth-of-type(odd) {
#membuff > div > div, #membuff > div > div,
#conns > div > div, #conns > div > div,
#memtotal > div > div { #memtotal > div > div {
height: 1.4rem !important; height: 100% !important;
background-color: #0099CC !important; background-color: #0099CC !important;
} }
@ -534,7 +531,7 @@ td > table > tbody > tr > td {
background-color: #F0F0F0; background-color: #F0F0F0;
transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out;
display: inline-block; display: inline-block;
padding: 0.5rem 1rem; padding: 0 0.8rem;
border: none; border: none;
border-radius: 0.2rem; border-radius: 0.2rem;
cursor: pointer; cursor: pointer;
@ -548,7 +545,7 @@ td > table > tbody > tr > td {
-moz-user-select: none; -moz-user-select: none;
-ms-user-select: none; -ms-user-select: none;
user-select: none; user-select: none;
font-size: 1rem; font-size: 0.8rem;
width: auto !important; width: auto !important;
} }
@ -610,6 +607,7 @@ form.inline + form.inline,
} }
.cbi-input-reset, .cbi-input-reset,
.cbi-section-remove > .cbi-button,
.cbi-button-remove { .cbi-button-remove {
color: #fff !important; color: #fff !important;
background-color: #d9534f !important; background-color: #d9534f !important;
@ -631,14 +629,14 @@ form.inline + form.inline,
.cbi-tabmenu > li, .cbi-tabmenu > li,
.tabs > li { .tabs > li {
display: inline-block; display: inline-block;
padding: 0.9rem 0rem; padding: 0.6rem 0rem;
} }
.cbi-tabmenu > li > a, .cbi-tabmenu > li > a,
.tabs > li > a { .tabs > li > a {
text-decoration: none; text-decoration: none;
color: #404040; color: #404040;
padding: 0.9rem 1.5rem; padding: 0.5rem 0.8rem;
} }
.tabs > li[class~="active"], .tabs > li[class~="active"],
@ -675,6 +673,11 @@ form.inline + form.inline,
background-color: #D4D4D4; background-color: #D4D4D4;
} }
.cbi-section-remove:nth-of-type(2n),
.cbi-section-node:nth-of-type(2n){
background-color: #f9f9f9;
}
.cbi-section-node-tabbed { .cbi-section-node-tabbed {
padding: 0; padding: 0;
margin-top: 0; margin-top: 0;
@ -690,6 +693,7 @@ form.inline + form.inline,
.cbi-value-field, .cbi-value-field,
.cbi-value-description { .cbi-value-description {
display: table-cell; display: table-cell;
line-height: 1.25;
} }
.cbi-value-helpicon > img { .cbi-value-helpicon > img {
@ -717,7 +721,7 @@ form.inline + form.inline,
} }
.cbi-value { .cbi-value {
padding: 1rem; padding: 0.3rem 1rem;
display: inline-block; display: inline-block;
width: 100%; width: 100%;
} }
@ -732,7 +736,7 @@ form.inline + form.inline,
} }
.cbi-rowstyle-2 .cbi-button-up, .cbi-rowstyle-2 .cbi-button-up,
.cbi-rowstyle-2 .cbi-button-down{ .cbi-rowstyle-2 .cbi-button-down {
background-color: #FFF !important; background-color: #FFF !important;
} }
@ -768,7 +772,7 @@ form.inline + form.inline,
.cbi-page-actions { .cbi-page-actions {
border-top: 1px solid #eee; border-top: 1px solid #eee;
padding-top: 2rem; padding-top: 1rem;
text-align: right; text-align: right;
} }
@ -792,18 +796,23 @@ form.inline + form.inline,
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
} }
td > .ifacebadge {
background-color: #F0F0F0;
font-size: 0.9rem;
}
.ifacebadge > img { .ifacebadge > img {
float: right; float: right;
margin-left: 0.3rem; margin: 0 0.3rem;
} }
/*textarea*/ /*textarea*/
.cbi-input-textarea { .cbi-input-textarea {
width: 100%; width: 100%;
min-height: 16rem; min-height: 14rem;
padding: 1rem; padding: 0.8rem;
font-size: 0.9rem; font-size: 0.8rem;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: black; color: black;
} }
@ -933,7 +942,26 @@ form.inline + form.inline,
.cbi-value-field .cbi-input-checkbox, .cbi-value-field .cbi-input-checkbox,
.cbi-value-field .cbi-input-radio { .cbi-value-field .cbi-input-radio {
margin-top: 0.3rem; margin-top: 0.5rem;
height: 1rem;
}
.cbi-value-field > input + .cbi-value-description {
padding: 0;
}
.cbi-value-field > ul > li {
display: flex;
}
.cbi-value-field > ul > li > label {
margin-top: 0.5rem;
}
.cbi-value-field > ul > li .ifacebadge {
background-color: #eee;
margin-left: 0.4rem;
margin-top: -0.5rem;
} }
.cbi-section-table-row > .cbi-value-field .cbi-input-select { .cbi-section-table-row > .cbi-value-field .cbi-input-select {
@ -944,14 +972,19 @@ form.inline + form.inline,
margin: 0.5rem; margin: 0.5rem;
} }
.cbi-section-remove {
padding: 0.5rem;
}
div.cbi-value var, td.cbi-value-field var { div.cbi-value var, td.cbi-value-field var {
font-style: italic; font-style: italic;
color: #0069D6; color: #0069D6;
} }
small { small {
font-size: small; font-size: 90%;
white-space: normal; white-space: normal;
line-height: 1.42857143;
} }
.cbi-button-up, .cbi-button-up,
@ -959,7 +992,7 @@ small {
display: inline-block; display: inline-block;
min-width: 0; min-width: 0;
padding: 0.2rem 0.3rem; padding: 0.2rem 0.3rem;
font-size: 1.3rem; font-size: 1.2rem;
} }
.cbi-optionals { .cbi-optionals {
@ -976,7 +1009,7 @@ small {
-moz-border-radius: 3px; -moz-border-radius: 3px;
white-space: pre-wrap; white-space: pre-wrap;
word-wrap: break-word; word-wrap: break-word;
font-size: 1.5rem; font-size: 1.4rem;
color: #404040; color: #404040;
} }
@ -998,7 +1031,7 @@ header > .container > .pull-right > * {
.label { .label {
padding: 0.3rem 0.8rem; padding: 0.3rem 0.8rem;
font-size: 1rem; font-size: 0.8rem;
font-weight: bold; font-weight: bold;
color: #ffffff !important; color: #ffffff !important;
text-transform: uppercase; text-transform: uppercase;
@ -1115,6 +1148,7 @@ header > .container > .pull-right > * {
/* fix Services Network Shares*/ /* fix Services Network Shares*/
.node-services-samba > .main .cbi-tabcontainer:nth-child(3) .cbi-value-title { .node-services-samba > .main .cbi-tabcontainer:nth-child(3) .cbi-value-title {
margin-bottom: 1rem; margin-bottom: 1rem;
width: auto;
} }
.node-services-samba > .main .cbi-tabcontainer:nth-child(3) .cbi-value-field { .node-services-samba > .main .cbi-tabcontainer:nth-child(3) .cbi-value-field {
@ -1137,7 +1171,7 @@ header > .container > .pull-right > * {
} }
.node-system-packages > .main .cbi-tabmenu > li > a, .tabs > li > a { .node-system-packages > .main .cbi-tabmenu > li > a, .tabs > li > a {
padding: 0.5rem 1rem; padding: 0.5rem 0.8rem;
} }
.node-system-packages > .main .cbi-value > pre { .node-system-packages > .main .cbi-value > pre {
@ -1168,25 +1202,28 @@ header > .container > .pull-right > * {
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .16), 0 0 2px 0 rgba(0, 0, 0, .12); box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .16), 0 0 2px 0 rgba(0, 0, 0, .12);
} }
.node-system-flashops form.inline + form.inline {
margin-left: 0;
}
#cbi-firewall-redirect table *, #cbi-firewall-redirect table *,
#cbi-network-switch_vlan table *, #cbi-network-switch_vlan table *,
#cbi-firewall-zone table *{ #cbi-firewall-zone table * {
font-size: small; font-size: small;
} }
#cbi-firewall-redirect table input[type="text"], #cbi-firewall-redirect table input[type="text"],
#cbi-network-switch_vlan table input[type="text"], #cbi-network-switch_vlan table input[type="text"],
#cbi-firewall-zone table input[type="text"]{ #cbi-firewall-zone table input[type="text"] {
width: 5rem; width: 5rem;
} }
#cbi-firewall-redirect table select, #cbi-firewall-redirect table select,
#cbi-network-switch_vlan table select, #cbi-network-switch_vlan table select,
#cbi-firewall-zone table select{ #cbi-firewall-zone table select {
min-width: 3.5rem; min-width: 3.5rem;
} }
/* language fix */ /* language fix */
body.lang_pl.node-main-login .cbi-value-title { body.lang_pl.node-main-login .cbi-value-title {
width: 12rem; width: 12rem;
@ -1194,17 +1231,16 @@ body.lang_pl.node-main-login .cbi-value-title {
@media screen and (max-width: 1600px) { @media screen and (max-width: 1600px) {
.main-left { .main-left {
width: calc(0% + 15rem); width: calc(0% + 13rem);
} }
.main-right { .main-right {
width: calc(100% - 15rem); width: calc(100% - 13rem);
} }
.cbi-button { .cbi-button {
padding: 0.3rem 0.6rem; padding: 0.3rem 0.6rem;
font-size: 1rem; font-size: 0.8rem;
line-height: 1.5;
} }
header > .container > .pull-right > * { header > .container > .pull-right > * {
@ -1262,23 +1298,23 @@ body.lang_pl.node-main-login .cbi-value-title {
} }
.panel-title { .panel-title {
font-size: 1.3rem; font-size: 1.1rem;
padding-bottom: 1rem; padding-bottom: 1rem;
} }
table { table {
font-size: 0.8rem !important; font-size: 0.7rem !important;
width: 100% !important; width: 100% !important;
} }
.main > .main-left > .nav > li, .main > .main-left > .nav > li,
.main > .main-left > .nav > li a, .main > .main-left > .nav > li a,
.main > .main-left > .nav > .slide > .menu { .main > .main-left > .nav > .slide > .menu {
font-size: 1.1rem; font-size: 0.9rem;
} }
.main > .main-left > .nav > .slide > .slide-menu > li > a { .main > .main-left > .nav > .slide > .slide-menu > li > a {
font-size: 0.9rem; font-size: 0.7rem;
} }
} }
@ -1335,7 +1371,7 @@ body.lang_pl.node-main-login .cbi-value-title {
} }
#diag-rc-output > pre { #diag-rc-output > pre {
font-size: 1.2rem; font-size: 1rem;
} }
.node-main-login > .main .cbi-value-title { .node-main-login > .main .cbi-value-title {
@ -1344,6 +1380,10 @@ body.lang_pl.node-main-login .cbi-value-title {
} }
@media screen and (max-width: 480px) { @media screen and (max-width: 480px) {
body {
font-size: 1rem;
}
fieldset { fieldset {
padding: 1rem; padding: 1rem;
margin: 1rem 0 0 0; margin: 1rem 0 0 0;
@ -1465,12 +1505,12 @@ body.lang_pl.node-main-login .cbi-value-title {
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
} }
.node-status-iptables > .main div > .cbi-map > form input[type="submit"]{ .node-status-iptables > .main div > .cbi-map > form input[type="submit"] {
width: 100% !important; width: 100% !important;
margin: 0; margin: 0;
} }
.node-status-iptables > .main div > .cbi-map > form input[type="submit"] + input[type="submit"]{ .node-status-iptables > .main div > .cbi-map > form input[type="submit"] + input[type="submit"] {
margin-top: 1rem; margin-top: 1rem;
} }
} }
@ -1506,4 +1546,4 @@ body.lang_pl.node-main-login .cbi-value-title {
.cbi-value-field .cbi-input-select { .cbi-value-field .cbi-input-select {
min-width: 25rem; min-width: 25rem;
} }
} }

View file

@ -95,6 +95,7 @@
ul.removeClass("active"); ul.removeClass("active");
}); });
} }
return false;
}); });
/** /**
@ -115,7 +116,7 @@
$(this).addClass("active"); $(this).addClass("active");
$(".main > .loading").fadeIn("fast"); $(".main > .loading").fadeIn("fast");
window.location = $($(this).find("a")[0]).attr("href"); window.location = $($(this).find("a")[0]).attr("href");
return; return false;
}); });
/** /**
@ -198,6 +199,13 @@
that.after("<span class='panel-title'>" + that.text() + "</span>"); that.after("<span class='panel-title'>" + that.text() + "</span>");
}); });
$(".cbi-section-table-titles, .cbi-section-table-descr, .cbi-section-descr").each(function () {
var that = $(this);
if (that.text().trim() == ""){
that.css("display", "none");
}
});
$(".main-right").focus(); $(".main-right").focus();
$(".main-right").blur(); $(".main-right").blur();

View file

@ -1,116 +1,121 @@
<%# <%#
Material is a clean HTML5 theme for LuCI. It is based on luci-theme-bootstrap and MUI Material is a clean HTML5 theme for LuCI. It is based on luci-theme-bootstrap and MUI
luci-theme-material luci-theme-material
Copyright 2015 Lutty Yang <lutty@wcan.in> Copyright 2015 Lutty Yang
<lutty@wcan.in>
Have a bug? Please create an issue here on GitHub! Have a bug? Please create an issue here on GitHub!
https://github.com/LuttyYang/luci-theme-material/issues https://github.com/LuttyYang/luci-theme-material/issues
luci-theme-bootstrap: luci-theme-bootstrap:
Copyright 2008 Steven Barth <steven@midlink.org> Copyright 2008 Steven Barth
Copyright 2008 Jo-Philipp Wich <jow@openwrt.org> <steven@midlink.org>
Copyright 2012 David Menting <david@nut-bolt.nl> Copyright 2008 Jo-Philipp Wich
<jow@openwrt.org>
Copyright 2012 David Menting
<david@nut-bolt.nl>
MUI: MUI:
https://github.com/muicss/mui https://github.com/muicss/mui
Licensed to the public under the Apache License 2.0 Licensed to the public under the Apache License 2.0
-%> -%>
<% <%
local ver = require "luci.version" local ver = require "luci.version"
local sys = require "luci.sys" local sys = require "luci.sys"
local util = require "luci.util" local util = require "luci.util"
local http = require "luci.http" local http = require "luci.http"
local disp = require "luci.dispatcher" local disp = require "luci.dispatcher"
local boardinfo = util.ubus("system", "board") local boardinfo = util.ubus("system", "board")
local request = disp.context.path local request = disp.context.path
local request2 = disp.context.request local request2 = disp.context.request
local category = request[1] local category = request[1]
local cattree = category and disp.node(category) local cattree = category and disp.node(category)
local leaf = request2[#request2] local leaf = request2[#request2]
local tree = disp.node() local tree = disp.node()
local node = disp.context.dispatched local node = disp.context.dispatched
local categories = disp.node_childs(tree) local categories = disp.node_childs(tree)
local c = tree local c = tree
local i, r local i, r
-- tag all nodes leading to this page -- tag all nodes leading to this page
for i, r in ipairs(request) do for i, r in ipairs(request) do
if c.nodes and c.nodes[r] then if c.nodes and c.nodes[r] then
c = c.nodes[r] c = c.nodes[r]
c._menu_selected = true c._menu_selected = true
end end
end end
-- send as HTML5
http.prepare_content("text/html")
local function nodeurl(prefix, name, query) -- send as HTML5
local url = controller .. prefix .. name .. "/" http.prepare_content("text/html")
if query then
url = url .. http.build_querystring(query)
end
return pcdata(url)
end
local function subtree(prefix, node, level) local function nodeurl(prefix, name, query)
if not level then local url = controller .. prefix .. name .. "/"
level = 1 if query then
end url = url .. http.build_querystring(query)
end
return pcdata(url)
end
local childs = disp.node_childs(node) local function subtree(prefix, node, level)
if #childs > 0 then if not level then
level = 1
if level > 2 then end
local childs = disp.node_childs(node)
if #childs > 0 then
if level > 2 then
%> %>
<ul class="tabs"> <ul class="tabs">
<% <%
end end
local selected_node local selected_node
local selected_name local selected_name
local i, v local i, v
for i, v in ipairs(childs) do for i, v in ipairs(childs) do
local nnode = node.nodes[v] local nnode = node.nodes[v]
if nnode._menu_selected then if nnode._menu_selected then
selected_node = nnode selected_node = nnode
selected_name = v selected_name = v
end end
if level > 2 then if level > 2 then
%> %>
<li class="tabmenu-item-<%=v%><%- if nnode._menu_selected or (node.leaf and v == leaf) then %> active<% end %>"> <li class="tabmenu-item-<%=v%><%- if nnode._menu_selected or (node.leaf and v == leaf) then %> active<% end %>">
<a href="<%=nodeurl(prefix, v, nnode.query)%>"><%=striptags(translate(nnode.title))%></a> <a href="<%=nodeurl(prefix, v, nnode.query)%>"><%=striptags(translate(nnode.title))%></a>
</li> </li>
<% end <% end
end end
if level > 2 then if level > 2 then
%> %>
</ul> </ul>
<% end <% end
if selected_node then if selected_node then
subtree(prefix .. selected_name .. "/", selected_node, level + 1) subtree(prefix .. selected_name .. "/", selected_node, level + 1)
end end
end end
end end
-%> -%>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<%=luci.i18n.context.lang%>"> <html lang="<%=luci.i18n.context.lang%>">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title><%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI</title> <title><%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" /> '')) %> - LuCI</title>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/>
<meta name="format-detection" content="telephone=no, email=no"/> <meta name="format-detection" content="telephone=no, email=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes">
@ -121,16 +126,29 @@
<meta name="theme-color" content="#0099CC"> <meta name="theme-color" content="#0099CC">
<meta name="msapplication-tap-highlight" content="no"> <meta name="msapplication-tap-highlight" content="no">
<meta name="msapplication-TileColor" content="#0099CC"> <meta name="msapplication-TileColor" content="#0099CC">
<meta name="application-name" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI">
<meta name="apple-mobile-web-app-title" content="<%=striptags( (boardinfo.hostname or "?") ) %> - LuCI">
<meta name="msapplication-TileImage" content="<%=media%>/logo.png"/> <meta name="msapplication-TileImage" content="<%=media%>/logo.png"/>
<link rel="icon" href="<%=media%>/logo.png" sizes="144x144">
<link rel="apple-touch-icon-precomposed" href="<%=media%>/logo.png" sizes="144x144">
<link rel="stylesheet" href="<%=media%>/css/style.css"> <link rel="stylesheet" href="<%=media%>/css/style.css">
<link rel="shortcut icon" href="<%=media%>/favicon.ico"> <link rel="shortcut icon" href="<%=media%>/favicon.ico">
<% if node and node.css then %> <% if node and node.css then %>
<link rel="stylesheet" href="<%=resource%>/<%=node.css%>"> <link rel="stylesheet" href="<%=resource%>/<%=node.css%>">
<% end -%> <% end -%>
<% if css then %> <% if css then %>
<style title="text/css"> <style title="text/css">
<%-= css %> <
</style> %
-
=
css
%
>
</style>
<% end -%> <% end -%>
<script src="<%=resource%>/xhr.js"></script> <script src="<%=resource%>/xhr.js"></script>
</head> </head>
@ -138,95 +156,101 @@
<body class="lang_<%=luci.i18n.context.lang%> <%- if node then %><%= striptags( node.title ) %><%- end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %>"> <body class="lang_<%=luci.i18n.context.lang%> <%- if node then %><%= striptags( node.title ) %><%- end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %>">
<header> <header>
<div class="container"> <div class="container">
<span class="showSide"></span> <span class="showSide"></span>
<a class="brand" href="#"><%=boardinfo.hostname or "?"%></a> <a class="brand" href="#"><%=boardinfo.hostname or "?"%></a>
<div class="pull-right"> <div class="pull-right">
<% <%
-- calculate the number of unsaved changes -- calculate the number of unsaved changes
if tree.nodes[category] and tree.nodes[category].ucidata then if tree.nodes[category] and tree.nodes[category].ucidata then
local ucichanges = 0 local ucichanges = 0
for i, j in pairs(require("luci.model.uci").cursor():changes()) do for i, j in pairs(require("luci.model.uci").cursor():changes()) do
for k, l in pairs(j) do for k, l in pairs(j) do
for m, n in pairs(l) do for m, n in pairs(l) do
ucichanges = ucichanges + 1; ucichanges = ucichanges + 1;
end end
end end
end end
%> %>
<% if ucichanges > 0 then %> <% if ucichanges > 0 then %>
<a class="label notice" href="<%=controller%>/<%=category%>/uci/changes?redir=<%=http.urlencode(http.formvalue("redir") or REQUEST_URI)%>"><span class="mobile-hide"><%:Unsaved Changes%>: </span><%=ucichanges%></a> <a class="label notice"
<% end %> href="<%=controller%>/<%=category%>/uci/changes?redir=<%=http.urlencode(http.formvalue(" redir") or
REQUEST_URI)%>"><span class="mobile-hide"><%:Unsaved Changes%>: </span><%=ucichanges%></a>
<% end %>
<span id="xhr_poll_status" style="display:none" onclick="XHR.running() ? XHR.halt() : XHR.run()"> <span id="xhr_poll_status" style="display:none" onclick="XHR.running() ? XHR.halt() : XHR.run()">
<span class="label success" id="xhr_poll_status_on"><span class="mobile-hide"><%:Auto Refresh%> </span><%:on%></span> <span class="label success" id="xhr_poll_status_on"><span class="mobile-hide"><%:Auto Refresh%> </span><%:on%></span>
<span class="label" id="xhr_poll_status_off" style="display:none"><span class="mobile-hide"><%:Auto Refresh%> </span><%:off%></span> <span class="label" id="xhr_poll_status_off" style="display:none"><span class="mobile-hide"><%:Auto Refresh%> </span><%:off%></span>
</span> </span>
<% end %> <% end %>
</div> </div>
</div> </div>
</header> </header>
<div class="main"> <div class="main">
<div style="" class="loading"><span><div class="loading-img"></div>Loading...</span></div> <div style="" class="loading"><span><div class="loading-img"></div>Loading...</span></div>
<div class="main-left"> <div class="main-left">
<ul class="nav"> <ul class="nav">
<%- <%-
local function submenu(prefix, node) local function submenu(prefix, node)
local childs = disp.node_childs(node) local childs = disp.node_childs(node)
if #childs > 0 then if #childs > 0 then
%> %>
<ul class="slide-menu"> <ul class="slide-menu">
<%- <%-
for i, r in ipairs(childs) do for i, r in ipairs(childs) do
local nnode = node.nodes[r] local nnode = node.nodes[r]
local href = controller .. prefix .. r .. local href = controller .. prefix .. r ..
(nnode.query and http.build_querystring(nnode.query) or "") (nnode.query and http.build_querystring(nnode.query) or "")
%> %>
<li><a data-title="<%=pcdata(striptags(nnode.title))%>" href="<%=pcdata(href)%>"><%=pcdata(striptags(translate(nnode.title)))%></a></li> <li><a data-title="<%=pcdata(striptags(nnode.title))%>" href="<%=pcdata(href)%>"><%=pcdata(striptags(translate(nnode.title)))%></a>
<%- </li>
end <%-
%> end
</ul> %>
<%- </ul>
end <%-
end end
end
childs = disp.node_childs(cattree) childs = disp.node_childs(cattree)
if #childs > 0 then if #childs > 0 then
for i, r in ipairs(childs) do for i, r in ipairs(childs) do
local nnode = cattree.nodes[r] local nnode = cattree.nodes[r]
local href = controller .. "/" .. category .. "/" .. r .. local href = controller .. "/" .. category .. "/" .. r ..
(nnode.query and http.build_querystring(k.query) or "") (nnode.query and http.build_querystring(k.query) or "")
local grandchildren = disp.node_childs(nnode) local grandchildren = disp.node_childs(nnode)
if #grandchildren > 0 then if #grandchildren > 0 then
%> %>
<li class="slide"> <li class="slide">
<a class="menu" data-title="<%=pcdata(striptags(nnode.title))%>" href="#"><%=pcdata(striptags(translate(nnode.title)))%></a> <a class="menu" data-title="<%=pcdata(striptags(nnode.title))%>" href="#"><%=pcdata(striptags(translate(nnode.title)))%></a>
<%- submenu("/" .. category .. "/" .. r .. "/", nnode) %> <%- submenu("/" .. category .. "/" .. r .. "/", nnode) %>
</li> </li>
<% else %> <% else %>
<li> <li>
<a data-title="<%=pcdata(striptags(nnode.title))%>" href="<%=pcdata(href)%>"><%=pcdata(striptags(translate(nnode.title)))%></a> <a data-title="<%=pcdata(striptags(nnode.title))%>" href="<%=pcdata(href)%>"><%=pcdata(striptags(translate(nnode.title)))%></a>
</li> </li>
<% <%
end end
end end
end end
%> %>
</ul> </ul>
</div> </div>
<div class="main-right"> <div class="main-right">
<div class="darkMask"></div> <div class="darkMask"></div>
<div id="maincontent"> <div id="maincontent">
<div class="container"> <div class="container">
<%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%> <%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not
<div class="alert-message warning"> luci.sys.user.getpasswd("root") then -%>
<h4><%:No password set!%></h4> <div class="alert-message warning">
<%:There is no password set on this router. Please configure a root password to protect the web interface and enable SSH.%><br> <h4><%:No password set!%></h4>
<a href="<%=pcdata(luci.dispatcher.build_url("admin/system/admin"))%>"><%:Go to password configuration...%></a> <%:There is no password set on this router. Please configure a root password to protect the web
</div> interface and enable SSH.%><br>
<%- end -%> <a href="<%=pcdata(luci.dispatcher.build_url(" admin/system/admin"))%>"><%:Go to password
<% if category then subtree("/" .. category .. "/", cattree) end %> configuration...%></a>
</div>
<%- end -%>
<% if category then subtree("/" .. category .. "/", cattree) end %>