themes: generalize indicator markup and styling
[project/luci.git] / themes / luci-theme-bootstrap / luasrc / view / themes / bootstrap / header.htm
1 <%#
2 Copyright 2008 Steven Barth <steven@midlink.org>
3 Copyright 2008-2016 Jo-Philipp Wich <jow@openwrt.org>
4 Copyright 2012 David Menting <david@nut-bolt.nl>
5 Licensed to the public under the Apache License 2.0.
6 -%>
7
8 <%
9 local sys = require "luci.sys"
10 local util = require "luci.util"
11 local http = require "luci.http"
12 local disp = require "luci.dispatcher"
13
14 local boardinfo = util.ubus("system", "board")
15
16 local node = disp.context.dispatched
17
18 -- send as HTML5
19 http.prepare_content("text/html")
20 -%>
21 <!DOCTYPE html>
22 <html lang="<%=luci.i18n.context.lang%>">
23 <head>
24 <meta charset="utf-8">
25 <title><%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI</title>
26 <meta name="viewport" content="initial-scale=1.0">
27 <link rel="stylesheet" href="<%=media%>/cascade.css">
28 <link rel="stylesheet" media="only screen and (max-device-width: 854px)" href="<%=media%>/mobile.css" type="text/css" />
29 <link rel="shortcut icon" href="<%=media%>/favicon.png">
30 <% if node and node.css then %>
31 <link rel="stylesheet" href="<%=resource%>/<%=node.css%>">
32 <% end -%>
33 <% if css then %>
34 <style title="text/css"><%= css %></style>
35 <% end -%>
36 <script src="<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script>
37 <script src="<%=resource%>/cbi.js"></script>
38 <script src="<%=resource%>/xhr.js"></script>
39
40 <% include("themes/bootstrap/json-menu") %>
41 </head>
42
43 <body class="lang_<%=luci.i18n.context.lang%> <% if node then %><%= striptags( node.title ) %><%- end %>" data-page="<%= pcdata(table.concat(disp.context.requestpath, "-")) %>">
44 <header>
45 <div class="fill">
46 <div class="container">
47 <a class="brand" href="#"><%=boardinfo.hostname or "?"%></a>
48 <ul class="nav" id="topmenu" style="display:none"></ul>
49 <div id="indicators" class="pull-right">
50 <span id="xhr_poll_status" style="display:none" onclick="XHR.running() ? XHR.halt() : XHR.run()">
51 <span class="label success" id="xhr_poll_status_on"><%:Auto Refresh%> <%:on%></span>
52 <span class="label" id="xhr_poll_status_off" style="display:none"><%:Auto Refresh%> <%:off%></span>
53 </span>
54 </div>
55 </div>
56 </div>
57 </header>
58
59 <div id="maincontent" class="container">
60 <%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
61 <div class="alert-message warning">
62 <h4><%:No password set!%></h4>
63 <p><%:There is no password set on this router. Please configure a root password to protect the web interface and enable SSH.%></p>
64 <% if disp.lookup("admin/system/admin") then %>
65 <div class="right"><a class="btn" href="<%=url("admin/system/admin")%>"><%:Go to password configuration...%></a></div>
66 <% end %>
67 </div>
68 <%- end -%>
69
70 <noscript>
71 <div class="alert-message warning">
72 <h4><%:JavaScript required!%></h4>
73 <p><%:You must enable JavaScript in your browser or LuCI will not work properly.%></p>
74 </div>
75 </noscript>
76
77 <div id="tabmenu" style="display:none"></div>