Mercurial Hosting > disearch
view src/lib/Shared.luan @ 5:aa1920665f98
discord login
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 23 Oct 2023 00:43:41 -0600 |
parents | 8896ffd7b152 |
children | d59ae3e468f1 |
line wrap: on
line source
local Luan = require "luan:Luan.luan" local error = Luan.error local Time = require "luan:Time.luan" local Http = require "luan:http/Http.luan" local Shared = {} local started = Time.now() local function get_user() return Http.request.cookies.user end Shared.get_user = get_user function Shared.head() %> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> @import "/site.css?s=<%=started%>"; </style> <script src="/site.js?s=<%=started%>"></script> <% end function Shared.header() %> <div header> <h1><a href="/">Disearch</a></h1> <% if get_user() == nil then %> <a href="login1.red">login</a> <% else %> <a href="javascript:logout()">logout</a> <% end %> </div> <hr> <% end function Shared.footer() %> <hr> <div footer> something or other in the footer </div> <% end return Shared