4a7e4cb8f1c9af70da0ca156e3b0e27eb5aafc82
[project/luci.git] / themes / luci-theme-material / ucode / template / themes / material / header.ut
1 {#
2 Material is a clean HTML5 theme for LuCI. It is based on luci-theme-bootstrap and MUI
3
4 luci-theme-material
5 Copyright 2015-2017 Lutty Yang <lutty@wcan.in>
6
7 Have a bug? Please create an issue here on GitHub!
8 https://github.com/LuttyYang/luci-theme-material/issues
9
10 luci-theme-bootstrap:
11 Copyright 2008 Steven Barth <steven@midlink.org>
12 Copyright 2008-2016 Jo-Philipp Wich <jow@openwrt.org>
13 Copyright 2012 David Menting <david@nut-bolt.nl>
14
15 MUI:
16 https://github.com/muicss/mui
17
18 Licensed to the public under the Apache License 2.0
19 -#}
20
21 {%
22 import { getuid, getspnam } from 'luci.core';
23
24 const boardinfo = ubus.call('system', 'board');
25 const hostname = striptags(boardinfo?.hostname ?? '?');
26
27 http.prepare_content('text/html; charset=UTF-8');
28 -%}
29
30 <!DOCTYPE html>
31 <html lang="{{ dispatcher.lang }}">
32 <head>
33 <meta charset="utf-8">
34 <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/>
35 <meta name="apple-mobile-web-app-capable" content="yes">
36 <meta name="mobile-web-app-capable" content="yes">
37 <meta name="theme-color" content="#09c">
38 <meta name="msapplication-tap-highlight" content="no">
39 <meta name="msapplication-TileColor" content="#09c">
40 <meta name="application-name" content="{{ hostname }} - LuCI">
41 <meta name="apple-mobile-web-app-title" content="{{ hostname }} - LuCI">
42 <link rel="stylesheet" href="{{ media }}/cascade.css">
43 <link rel="icon" href="{{ media }}/logo_48.png" sizes="48x48">
44 <link rel="icon" href="{{ media }}/logo.svg" sizes="any">
45 {% if (node?.css): %}
46 <link rel="stylesheet" href="{{ resource }}/{{ node.css }}">
47 {% endif %}
48 <script src="{{ dispatcher.build_url('admin/translations', dispatcher.lang) }}"></script>
49 <script src="{{ resource }}/cbi.js"></script>
50 <title>{{ hostname }}{{ node?.title ? ` - ${striptags(node.title)}` : '' }} - LuCI</title>
51 {% if (css): %}
52 <style title="text/css">{{ css }}</style>
53 {% endif %}
54 </head>
55 <body class="lang_{{ dispatcher.lang }} {{ ctx.authsession ? 'logged-in' : '' }} {{ length(ctx.path) ? `node-${join('-', ctx.path)}` : 'node-main-login' }}" data-page="{{ entityencode(join('-', ctx.path), true) }}">
56 <header>
57 <div class="fill">
58 <div class="container">
59 <span class="showSide"></span>
60 <a id="logo" href="{{ ctx.authsession ? dispatcher.build_url('admin/status/overview') : '#' }}"><img src="{{ media }}/brand.png" alt="OpenWrt"></a>
61 <a class="brand" href="#">{{ hostname }}</a>
62 <span class="status" id="indicators"></span>
63 </div>
64 </div>
65 </header>
66 <div class="main">
67 <div style="" class="loading"><span><div class="loading-img"></div>{{ _('Collecting data...') }}</span></div>
68 <div class="main-left" id="mainmenu" style="display:none"></div>
69 <div class="main-right">
70 <div class="modemenu-buttons" style="display:none">
71 <ul id="modemenu"></ul>
72 </div>
73 <div class="darkMask"></div>
74 <div id="maincontent">
75 <div class="container">
76 {% if (getuid() == 0 && getspnam('root')?.pwdp === ''): %}
77 <div class="alert-message warning">
78 <h4>{{ _('No password set!') }}</h4>
79 <p>{{ _('There is no password set on this router. Please configure a root password to protect the web interface.') }}</p>
80 {% if (dispatcher.lookup("admin/system/admin")): %}
81 <div class="right"><a class="btn" href="{{ dispatcher.build_url("admin/system/admin") }}">{{ _('Go to password configuration...') }}</a></div>
82 {% endif %}
83 </div>
84 {% endif %}
85
86 {% if (boardinfo?.rootfs_type == "initramfs"): %}
87 <div class="alert-message warning">
88 <h4>{{ _('System running in recovery (initramfs) mode.') }}</h4>
89 <p>{{ _('No changes to settings will be stored and are lost after rebooting. This mode should only be used to install a firmware upgrade') }}</p>
90 {% if (dispatcher.lookup("admin/system/flash")): %}
91 <div class="right"><a class="btn" href="{{ dispatcher.build_url("admin/system/flash") }}">{{ _('Go to firmware upgrade...') }}</a></div>
92 {% endif %}
93 </div>
94 {% endif %}
95
96 <noscript>
97 <div class="alert-message warning">
98 <h4>{{ _('JavaScript required!') }}</h4>
99 <p>{{ _('You must enable JavaScript in your browser or LuCI will not work properly.') }}</p>
100 </div>
101 </noscript>
102
103 <div id="tabmenu" style="display:none"></div>