luci-theme-material: fix location of template files
authorJo-Philipp Wich <[email protected]>
Thu, 27 Oct 2022 08:26:06 +0000 (10:26 +0200)
committerJo-Philipp Wich <[email protected]>
Thu, 27 Oct 2022 09:14:52 +0000 (11:14 +0200)
Fixes: #6060
Fixes: e496014760 ("luci-theme-material: convert Lua templates to ucode")
Signed-off-by: Jo-Philipp Wich <[email protected]>
themes/luci-theme-material/ucode/template/themes/material/footer.ut [new file with mode: 0644]
themes/luci-theme-material/ucode/template/themes/material/header.ut [new file with mode: 0644]
themes/luci-theme-material/ucode/templates/material/footer.ut [deleted file]
themes/luci-theme-material/ucode/templates/material/header.ut [deleted file]

diff --git a/themes/luci-theme-material/ucode/template/themes/material/footer.ut b/themes/luci-theme-material/ucode/template/themes/material/footer.ut
new file mode 100644 (file)
index 0000000..9249427
--- /dev/null
@@ -0,0 +1,32 @@
+{#
+       Material is a clean HTML5 theme for LuCI. It is based on luci-theme-bootstrap and MUI
+
+       luci-theme-material
+       Copyright 2015 Lutty Yang <[email protected]>
+
+       Have a bug? Please create an issue here on GitHub!
+       https://github.com/LuttyYang/luci-theme-material/issues
+
+       luci-theme-bootstrap:
+       Copyright 2008 Steven Barth <[email protected]>
+       Copyright 2008 Jo-Philipp Wich <[email protected]>
+       Copyright 2012 David Menting <[email protected]>
+
+       MUI:
+       https://github.com/muicss/mui
+
+       Licensed to the public under the Apache License 2.0
+-#}
+
+                       </div>
+                       <footer class="mobile-hide">
+                               <a href="https://github.com/openwrt/luci">Powered by {{ version.luciname }} ({{ version.luciversion }})</a> /
+                               {{ version.distname }} {{ version.distversion }} ({{ version.distrevision }})
+                       </footer>
+               </div>
+       </div>
+
+       <script type="text/javascript">L.require('menu-material')</script>
+
+</body>
+</html>
diff --git a/themes/luci-theme-material/ucode/template/themes/material/header.ut b/themes/luci-theme-material/ucode/template/themes/material/header.ut
new file mode 100644 (file)
index 0000000..24b2c73
--- /dev/null
@@ -0,0 +1,96 @@
+{#
+       Material is a clean HTML5 theme for LuCI. It is based on luci-theme-bootstrap and MUI
+
+       luci-theme-material
+       Copyright 2015-2017 Lutty Yang <[email protected]>
+
+       Have a bug? Please create an issue here on GitHub!
+       https://github.com/LuttyYang/luci-theme-material/issues
+
+       luci-theme-bootstrap:
+       Copyright 2008 Steven Barth <[email protected]>
+       Copyright 2008-2016 Jo-Philipp Wich <[email protected]>
+       Copyright 2012 David Menting <[email protected]>
+
+       MUI:
+       https://github.com/muicss/mui
+
+       Licensed to the public under the Apache License 2.0
+-#}
+
+{%
+       import { getuid, getspnam } from 'luci.core';
+
+       const boardinfo = ubus.call('system', 'board');
+       const hostname = striptags(boardinfo?.hostname ?? '?');
+
+       http.prepare_content('text/html; charset=UTF-8');
+-%}
+
+<!DOCTYPE html>
+<html lang="{{ dispatcher.lang }}">
+<head>
+<meta charset="utf-8">
+<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/>
+<meta name="apple-mobile-web-app-capable" content="yes">
+<meta name="mobile-web-app-capable" content="yes">
+<meta name="theme-color" content="#09c">
+<meta name="msapplication-tap-highlight" content="no">
+<meta name="msapplication-TileColor" content="#09c">
+<meta name="application-name" content="{{ hostname }} - LuCI">
+<meta name="apple-mobile-web-app-title" content="{{ hostname }} - LuCI">
+<link rel="stylesheet" href="{{ media }}/cascade.css">
+<link rel="shortcut icon" href="{{ media }}/favicon.ico">
+{% if (node?.css): %}
+<link rel="stylesheet" href="{{ resource }}/{{ node.css }}">
+{% endif %}
+<script src="{{ dispatcher.build_url('admin/translations', dispatcher.lang) }}"></script>
+<script src="{{ resource }}/cbi.js"></script>
+<title>{{ hostname }}{{ node?.title ? ` - ${striptags(node.title)}` : '' }} - LuCI</title>
+{% if (css): %}
+<style title="text/css">{{ css }}</style>
+{% endif %}
+</head>
+<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) }}">
+<header>
+       <div class="fill">
+               <div class="container">
+                       <span class="showSide"></span>
+                       <a id="logo" href="{{ ctx.authsession ? dispatcher.build_url('admin/status/overview') : '#' }}"><img src="{{ media }}/brand.png" alt="OpenWrt"></a>
+                       <a class="brand" href="#">{{ hostname }}</a>
+                       <span class="status" id="indicators"></span>
+               </div>
+       </div>
+</header>
+<div class="main">
+       <div style="" class="loading"><span><div class="loading-img"></div>{{ _('Collecting data...') }}</span></div>
+       <div class="main-left" id="mainmenu" style="display:none"></div>
+       <div class="main-right">
+               <div class="modemenu-buttons" style="display:none">
+                       <ul id="modemenu"></ul>
+               </div>
+               <div class="darkMask"></div>
+               <div id="maincontent">
+                       <div class="container">
+                               {% if (getuid() == 0 && getspnam('root')?.pwdp === ''): %}
+                                       <!-- no password set -->
+                               {% endif %}
+
+                               {% if (boardinfo?.rootfs_type == "initramfs"): %}
+                                       <div class="alert-message warning">
+                                               <h4>{{ _('System running in recovery (initramfs) mode.') }}</h4>
+                                               <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>
+                                               {% if (dispatcher.lookup("admin/system/flash")): %}
+                                                 <div class="right"><a class="btn" href="{{ dispatcher.build_url("admin/system/flash") }}">{{ _('Go to firmware upgrade...') }}</a></div>
+                                               {% endif %}
+                                       </div>
+                               {% endif %}
+
+                               <noscript>
+                                       <div class="alert-message warning">
+                                               <h4>{{ _('JavaScript required!') }}</h4>
+                                               <p>{{ _('You must enable JavaScript in your browser or LuCI will not work properly.') }}</p>
+                                       </div>
+                               </noscript>
+
+                               <div id="tabmenu" style="display:none"></div>
diff --git a/themes/luci-theme-material/ucode/templates/material/footer.ut b/themes/luci-theme-material/ucode/templates/material/footer.ut
deleted file mode 100644 (file)
index 9249427..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-{#
-       Material is a clean HTML5 theme for LuCI. It is based on luci-theme-bootstrap and MUI
-
-       luci-theme-material
-       Copyright 2015 Lutty Yang <[email protected]>
-
-       Have a bug? Please create an issue here on GitHub!
-       https://github.com/LuttyYang/luci-theme-material/issues
-
-       luci-theme-bootstrap:
-       Copyright 2008 Steven Barth <[email protected]>
-       Copyright 2008 Jo-Philipp Wich <[email protected]>
-       Copyright 2012 David Menting <[email protected]>
-
-       MUI:
-       https://github.com/muicss/mui
-
-       Licensed to the public under the Apache License 2.0
--#}
-
-                       </div>
-                       <footer class="mobile-hide">
-                               <a href="https://github.com/openwrt/luci">Powered by {{ version.luciname }} ({{ version.luciversion }})</a> /
-                               {{ version.distname }} {{ version.distversion }} ({{ version.distrevision }})
-                       </footer>
-               </div>
-       </div>
-
-       <script type="text/javascript">L.require('menu-material')</script>
-
-</body>
-</html>
diff --git a/themes/luci-theme-material/ucode/templates/material/header.ut b/themes/luci-theme-material/ucode/templates/material/header.ut
deleted file mode 100644 (file)
index 24b2c73..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-{#
-       Material is a clean HTML5 theme for LuCI. It is based on luci-theme-bootstrap and MUI
-
-       luci-theme-material
-       Copyright 2015-2017 Lutty Yang <[email protected]>
-
-       Have a bug? Please create an issue here on GitHub!
-       https://github.com/LuttyYang/luci-theme-material/issues
-
-       luci-theme-bootstrap:
-       Copyright 2008 Steven Barth <[email protected]>
-       Copyright 2008-2016 Jo-Philipp Wich <[email protected]>
-       Copyright 2012 David Menting <[email protected]>
-
-       MUI:
-       https://github.com/muicss/mui
-
-       Licensed to the public under the Apache License 2.0
--#}
-
-{%
-       import { getuid, getspnam } from 'luci.core';
-
-       const boardinfo = ubus.call('system', 'board');
-       const hostname = striptags(boardinfo?.hostname ?? '?');
-
-       http.prepare_content('text/html; charset=UTF-8');
--%}
-
-<!DOCTYPE html>
-<html lang="{{ dispatcher.lang }}">
-<head>
-<meta charset="utf-8">
-<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/>
-<meta name="apple-mobile-web-app-capable" content="yes">
-<meta name="mobile-web-app-capable" content="yes">
-<meta name="theme-color" content="#09c">
-<meta name="msapplication-tap-highlight" content="no">
-<meta name="msapplication-TileColor" content="#09c">
-<meta name="application-name" content="{{ hostname }} - LuCI">
-<meta name="apple-mobile-web-app-title" content="{{ hostname }} - LuCI">
-<link rel="stylesheet" href="{{ media }}/cascade.css">
-<link rel="shortcut icon" href="{{ media }}/favicon.ico">
-{% if (node?.css): %}
-<link rel="stylesheet" href="{{ resource }}/{{ node.css }}">
-{% endif %}
-<script src="{{ dispatcher.build_url('admin/translations', dispatcher.lang) }}"></script>
-<script src="{{ resource }}/cbi.js"></script>
-<title>{{ hostname }}{{ node?.title ? ` - ${striptags(node.title)}` : '' }} - LuCI</title>
-{% if (css): %}
-<style title="text/css">{{ css }}</style>
-{% endif %}
-</head>
-<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) }}">
-<header>
-       <div class="fill">
-               <div class="container">
-                       <span class="showSide"></span>
-                       <a id="logo" href="{{ ctx.authsession ? dispatcher.build_url('admin/status/overview') : '#' }}"><img src="{{ media }}/brand.png" alt="OpenWrt"></a>
-                       <a class="brand" href="#">{{ hostname }}</a>
-                       <span class="status" id="indicators"></span>
-               </div>
-       </div>
-</header>
-<div class="main">
-       <div style="" class="loading"><span><div class="loading-img"></div>{{ _('Collecting data...') }}</span></div>
-       <div class="main-left" id="mainmenu" style="display:none"></div>
-       <div class="main-right">
-               <div class="modemenu-buttons" style="display:none">
-                       <ul id="modemenu"></ul>
-               </div>
-               <div class="darkMask"></div>
-               <div id="maincontent">
-                       <div class="container">
-                               {% if (getuid() == 0 && getspnam('root')?.pwdp === ''): %}
-                                       <!-- no password set -->
-                               {% endif %}
-
-                               {% if (boardinfo?.rootfs_type == "initramfs"): %}
-                                       <div class="alert-message warning">
-                                               <h4>{{ _('System running in recovery (initramfs) mode.') }}</h4>
-                                               <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>
-                                               {% if (dispatcher.lookup("admin/system/flash")): %}
-                                                 <div class="right"><a class="btn" href="{{ dispatcher.build_url("admin/system/flash") }}">{{ _('Go to firmware upgrade...') }}</a></div>
-                                               {% endif %}
-                                       </div>
-                               {% endif %}
-
-                               <noscript>
-                                       <div class="alert-message warning">
-                                               <h4>{{ _('JavaScript required!') }}</h4>
-                                               <p>{{ _('You must enable JavaScript in your browser or LuCI will not work properly.') }}</p>
-                                       </div>
-                               </noscript>
-
-                               <div id="tabmenu" style="display:none"></div>