luci-theme-material: do not infer login state from url (#520)
[project/luci.git] / themes / luci-theme-material / luasrc / view / themes / material / header.htm
index 0fcf76f..153be10 100755 (executable)
@@ -1,21 +1,25 @@
 <%#
-       luci-theme-material is based on MUI and luci-theme-bootstrap.
+       Material is a clean HTML5 theme for LuCI. It is based on luci-theme-bootstrap and MUI
+
+       luci-theme-material
+       Copyright 2015 Lutty Yang <lutty@wcan.in>
+
+       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 <steven@midlink.org>
-               Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
-               Copyright 2012 David Menting <david@nut-bolt.nl>
+       Copyright 2008 Steven Barth <steven@midlink.org>
+       Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
+       Copyright 2012 David Menting <david@nut-bolt.nl>
 
        MUI:
-               https://github.com/muicss/mui
-
-       luci-theme-material
-               Copyright 2015 Lutty Yang <lutty@wcan.in>
+       https://github.com/muicss/mui
 
        Licensed to the public under the Apache License 2.0
 -%>
 
 <%
+       local ver = require "luci.version"
        local sys  = require "luci.sys"
        local util = require "luci.util"
        local http = require "luci.http"
 <head>
     <meta charset="utf-8">
     <title><%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI</title>
-    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
+    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
     <meta name="format-detection" content="telephone=no, email=no"/>
     <meta name="apple-mobile-web-app-capable" content="yes">
     <meta name="mobile-web-app-capable" content="yes">
     <meta name="msapplication-tap-highlight" content="no">
     <meta name="msapplication-TileColor" content="#0099CC">
     <meta name="msapplication-TileImage" content="<%=media%>/logo.png"/>
-    <link rel="stylesheet" href="<%=media%>/css/style.css">
+    <link rel="stylesheet" href="<%=media%>/css/style.css?<%= ver.luciversion %>">
     <link rel="shortcut icon" href="<%=media%>/favicon.ico">
     <% if node and node.css then %>
         <link rel="stylesheet" href="<%=resource%>/<%=node.css%>">
     <script src="<%=resource%>/xhr.js"></script>
 </head>
 
-<body class="lang_<%=luci.i18n.context.lang%> <%- if node then %><%= striptags( node.title ) %><%- end %>">
+<body class="lang_<%=luci.i18n.context.lang%> <%- if node then %><%= striptags( node.title ) %><%- end %> <% if luci.dispatcher.context.authsession then %>logged-in<% end %>">
 
 <header>
        <div class="container">
                        end
                        %>
                        <% if ucichanges > 0 then %>
-                       <a class="label notice" href="<%=controller%>/<%=category%>/uci/changes"><%:Unsaved Changes%>: <%=ucichanges%></a>
+                       <a class="label notice" href="<%=controller%>/<%=category%>/uci/changes?redir=<%=http.urlencode(http.formvalue("redir") or REQUEST_URI)%>"><span class="mobile-hide"><%:Unsaved Changes%>: </span><%=ucichanges%></a>
                        <% end %>
                        <span id="xhr_poll_status" style="display:none" onclick="XHR.running() ? XHR.halt() : XHR.run()">
-                               <span class="label success" id="xhr_poll_status_on"><%:Auto Refresh%> <%:on%></span>
-                               <span class="label" id="xhr_poll_status_off" style="display:none"><%:Auto Refresh%> <%:off%></span>
+                               <span class="label success" id="xhr_poll_status_on"><span class="mobile-hide"><%:Auto Refresh%> </span><%:on%></span>
+                               <span class="label" id="xhr_poll_status_off" style="display:none"><span class="mobile-hide"><%:Auto Refresh%> </span><%:off%></span>
                        </span>
                <% end %>
                </div>
 </header>
 
  <div class="main">
+        <div style="" class="loading"><span><div class="loading-img"></div>Loading...</span></div>
         <div class="main-left">
                 <ul class="nav">
                         <%-