summaryrefslogtreecommitdiffhomepage
path: root/themes/luci-theme-bootstrap/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-09-09 20:08:57 +0200
committerJo-Philipp Wich <jo@mein.io>2022-10-25 01:03:37 +0200
commit2e3282e624836c9e7cd425dee6eec708038b3a26 (patch)
treeb32fb0dead66fd39eb5236f0c2821fac21358fba /themes/luci-theme-bootstrap/luasrc
parentf478fe6c4351749520730f65550f29b57eb107fb (diff)
luci-theme-bootstrap: translate Lua templates to ucode equivalents
Add ucode template equivalents for the Lua templates used by the theme. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'themes/luci-theme-bootstrap/luasrc')
l---------themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap-dark1
l---------themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap-light1
-rw-r--r--themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/footer.htm21
-rw-r--r--themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm95
-rw-r--r--themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/sysauth.htm53
5 files changed, 0 insertions, 171 deletions
diff --git a/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap-dark b/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap-dark
deleted file mode 120000
index ac7bcbbf37..0000000000
--- a/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap-dark
+++ /dev/null
@@ -1 +0,0 @@
-bootstrap \ No newline at end of file
diff --git a/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap-light b/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap-light
deleted file mode 120000
index ac7bcbbf37..0000000000
--- a/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap-light
+++ /dev/null
@@ -1 +0,0 @@
-bootstrap \ No newline at end of file
diff --git a/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/footer.htm b/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/footer.htm
deleted file mode 100644
index 48d9b98b92..0000000000
--- a/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/footer.htm
+++ /dev/null
@@ -1,21 +0,0 @@
-<%#
- Copyright 2008 Steven Barth <steven@midlink.org>
- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
- Copyright 2012 David Menting <david@nut-bolt.nl>
- Licensed to the public under the Apache License 2.0.
--%>
-
- <% if not blank_page then %>
- <% local ver = require "luci.version" %>
- </div>
- <footer>
- <span>
- <a href="https://github.com/openwrt/luci">Powered by <%= ver.luciname %> (<%= ver.luciversion %>)</a> / <%= ver.distversion %>
- </span>
- <ul class="breadcrumb pull-right" id="modemenu" style="display:none"></ul>
- </footer>
- <script type="text/javascript">L.require('menu-bootstrap')</script>
- <% end %>
- </body>
-</html>
-
diff --git a/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm b/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm
deleted file mode 100644
index 37d18a2f07..0000000000
--- a/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm
+++ /dev/null
@@ -1,95 +0,0 @@
-<%#
- Copyright 2008 Steven Barth <steven@midlink.org>
- Copyright 2008-2016 Jo-Philipp Wich <jow@openwrt.org>
- Copyright 2012 David Menting <david@nut-bolt.nl>
- Licensed to the public under the Apache License 2.0.
--%>
-
-<%
- local sys = require "luci.sys"
- local util = require "luci.util"
- local http = require "luci.http"
- local disp = require "luci.dispatcher"
-
- local boardinfo = util.ubus("system", "board")
-
- local node = disp.context.dispatched
-
- local darkpref
-
- if theme == "bootstrap-dark" then
- darkpref = "true"
- elseif theme == "bootstrap-light" then
- darkpref = "false"
- end
-
- -- send as HTML5
- http.prepare_content("text/html")
--%>
-<!DOCTYPE html>
-<html lang="<%=luci.i18n.context.lang%>"<%= ifattr(darkpref ~= nil, "data-darkmode", darkpref) %>>
- <head>
- <meta charset="utf-8">
- <title><%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI</title>
- <% if darkpref == nil then %>
- <script type="text/javascript">
- var mediaQuery = window.matchMedia('(prefers-color-scheme: dark)'),
- rootElement = document.querySelector(':root'),
- setDarkMode = function(match) { rootElement.setAttribute('data-darkmode', match.matches) };
-
- mediaQuery.addEventListener('change', setDarkMode);
- setDarkMode(mediaQuery);
- </script>
- <% end %>
- <meta name="viewport" content="initial-scale=1.0">
- <link rel="stylesheet" href="<%=media%>/cascade.css">
- <link rel="stylesheet" media="only screen and (max-device-width: 854px)" href="<%=media%>/mobile.css" type="text/css" />
- <link rel="shortcut icon" href="<%=media%>/favicon.png">
- <% if node and node.css then %>
- <link rel="stylesheet" href="<%=resource%>/<%=node.css%>">
- <% end -%>
- <% if css then %>
- <style title="text/css"><%= css %></style>
- <% end -%>
- <script src="<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script>
- <script src="<%=resource%>/cbi.js"></script>
- </head>
-
- <body class="lang_<%=luci.i18n.context.lang%> <% if node then %><%= striptags( node.title ) %><%- end %>" data-page="<%= pcdata(table.concat(disp.context.requestpath, "-")) %>">
- <% if not blank_page then %>
- <header>
- <a class="brand" href="/"><%=striptags(boardinfo.hostname or "?")%></a>
- <ul class="nav" id="topmenu" style="display:none"></ul>
- <div id="indicators" class="pull-right"></div>
- </header>
-
- <div id="maincontent" class="container">
- <%- if luci.sys.process.info("uid") == 0 and luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
- <div class="alert-message warning">
- <h4><%:No password set!%></h4>
- <p><%:There is no password set on this router. Please configure a root password to protect the web interface.%></p>
- <% if disp.lookup("admin/system/admin") then %>
- <div class="right"><a class="btn" href="<%=url("admin/system/admin")%>"><%:Go to password configuration...%></a></div>
- <% end %>
- </div>
- <%- end -%>
-
- <%- if boardinfo.rootfs_type == "initramfs" then -%>
- <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 disp.lookup("admin/system/flash") then %>
- <div class="right"><a class="btn" href="<%=url("admin/system/flash")%>"><%:Go to firmware upgrade...%></a></div>
- <% end %>
- </div>
- <%- end -%>
-
- <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>
- <% end %>
diff --git a/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/sysauth.htm b/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/sysauth.htm
deleted file mode 100644
index 72b04783bb..0000000000
--- a/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/sysauth.htm
+++ /dev/null
@@ -1,53 +0,0 @@
-<%#
- Copyright 2021 Jo-Philipp Wich <jo@mein.io>
- Licensed to the public under the Apache License 2.0.
--%>
-
-<%
- -- tell bootstrap's templates to not render header and footer
- blank_page = true
-%>
-
-<%+header%>
-
-<section hidden>
- <form method="post" class="cbi-map">
- <div class="cbi-section">
- <div class="cbi-section-node">
- <div class="cbi-value">
- <label class="cbi-value-title" for="luci_username"><%:Username%></label>
- <div class="cbi-value-field">
- <input name="luci_username" id="luci_username" type="text" autocomplete="username" <%=attr("value", duser)%>>
- </div>
- </div>
- <div class="cbi-value">
- <label class="cbi-value-title" for="luci_password"><%:Password%></label>
- <div class="cbi-value-field">
- <input name="luci_password" id="luci_password" type="password" autocomplete="current-password">
- </div>
- </div>
- </div>
- </div>
- </form>
-
- <hr>
-
- <% if fuser then %>
- <div class="alert-message error">
- <%:Invalid username and/or password! Please try again.%>
- </div>
- <% end %>
-
- <button class="btn cbi-button-positive important"><%:Login%></button>
-</section>
-
-<div id="view">
- <div class="spinning"><%:Loading view…%></div>
- <script type="text/javascript">
- L.require('ui').then(function(ui) {
- ui.instantiateView('bootstrap.sysauth');
- });
- </script>
-</div>
-
-<%+footer%>