luci-theme-openwrt-2020: honor CSS definitions passed by views
[project/luci.git] / themes / luci-theme-openwrt-2020 / luasrc / view / themes / openwrt2020 / header.htm
1 <%#
2 Copyright 2020 Jo-Philipp Wich <jo@mein.io>
3 Licensed to the public under the Apache License 2.0.
4 -%>
5
6 <%
7 local sys = require "luci.sys"
8 local util = require "luci.util"
9 local http = require "luci.http"
10 local disp = require "luci.dispatcher"
11 local ver = require "luci.version"
12
13 local boardinfo = util.ubus("system", "board") or { }
14
15 local node = disp.context.dispatched
16 local path = table.concat(disp.context.path, "-")
17
18 http.prepare_content("text/html; charset=UTF-8")
19 -%>
20 <!DOCTYPE html>
21 <html lang="<%=luci.i18n.context.lang%>">
22 <head>
23 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
24 <meta http-equiv="Content-Script-Type" content="text/javascript" />
25 <meta name="viewport" content="width=device-width, initial-scale=1" />
26 <link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/cascade.css" />
27 <link rel="icon" href="<%=media%>/favicon.png" type="image/svg+xml" />
28 <script type="text/javascript" src="<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script>
29 <script type="text/javascript" src="<%=resource%>/cbi.js"></script>
30 <title><%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI</title>
31 <% if css then %><style title="text/css">
32 <%= css %>
33 </style>
34 <% end -%>
35 </head>
36 <body class="lang_<%=luci.i18n.context.lang%>" data-page="<%= pcdata(path) %>">
37
38 <p class="skiplink">
39 <span id="skiplink1"><a href="#navigation"><%:Skip to navigation%></a></span>
40 <span id="skiplink2"><a href="#content"><%:Skip to content%></a></span>
41 </p>
42
43 <div id="menubar">
44 <h2 class="navigation"><a id="navigation" name="navigation"><%:Navigation%></a></h2>
45
46 <span class="hostname"><a href="/"><%=(boardinfo.hostname or "?")%></a></span>
47 <span class="distversion"><%=ver.distversion%></span>
48 <span id="indicators"></span>
49 </div>
50
51 <div id="modemenu" style="display:none"></div>
52
53 <div id="maincontainer">
54 <div id="mainmenu"></div>
55
56 <div id="maincontent">
57 <%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") and path ~= "admin-system-admin-password" then -%>
58 <div class="alert-message warning">
59 <h4><%:No password set!%></h4>
60 <p><%:There is no password set on this router. Please configure a root password to protect the web interface.%></p>
61 <% if disp.lookup("admin/system/admin") then %>
62 <div class="right"><a class="btn" href="<%=url("admin/system/admin")%>"><%:Go to password configuration...%></a></div>
63 <% end %>
64 </div>
65 <%- end -%>
66
67 <div id="tabmenu" style="display:none"></div>