1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2025-07-27 02:59:47 +02:00
This commit is contained in:
Xuan Sang LE
2018-02-23 19:52:10 +01:00
parent 6d6f2bdbac
commit e88b5470cc
20 changed files with 908 additions and 219 deletions

7
blog/view/bot.html Normal file
View File

@ -0,0 +1,7 @@
</div>
</div>
<div id = "bottom">
Powered by antd server, (c) 2017 - 2018 Xuan Sang LE
</div>
</body>
</html>

68
blog/view/detail.ls Normal file
View File

@ -0,0 +1,68 @@
<?lua
local data = _G.dbmodel
if not #data then
?>
<div class = "notfound">
<p>No entry found</p>
<blockquote>
“In many ways my life has been rather like a record of the lost and found. Perhaps all lives are like that.”
<span>― Lucy Foley, The Book of Lost and Found</span>
</blockquote >
</div>
<?lua
return
end
?>
<div class = "card">
<div class = "side">
<span class = "date"><?=data.ctimestr:gsub("%s+.*$","")?></span>
<span class = "tags">
<?lua
local atags = {}
local i = 1
for tag in data.tags:gmatch(",*([^,]+)") do
tag = std.trim(tag, " ")
local b64tag = std.b64encode(tag)
atags[i] = '<a href = "./bytag:'..b64tag:gsub("=","")..':'..MAX_ENTRY..'">'..tag.."</a>"
i = i+ 1
end
echo(table.concat(atags, ", "))
?>
</span>
</div>
<div class = "blogentry">
<div class = "shortcontent">
<?lua
local content = bytes.__tostring(std.b64decode(data.rendered)):gsub("%%","%%%%")
local r, s = content:find("<hr/?>")
if r then
echo(content:sub(0,r-1))
echo(content:sub(s+1))
else
echo(content)
end
?>
</div>
<h1 class = "commentsec">Comments</h1>
<div class = "commentform">
<div class = "inputbox">
<div class = "label">Name:</div>
<input data-class = "data" type = "text" name = "name" />
</div>
<div class = "inputbox">
<div class = "label">Email:</div>
<input data-class = "data" type = "text" name = "email" />
</div>
<textarea data-class = "data" name = "content"></textarea>
<div class = "inputboxbt">
<div data-id="status"></div>
<button data-id = "send" >Comment</button>
</div>
</div>
</div>
</div>

58
blog/view/entries.ls Normal file
View File

@ -0,0 +1,58 @@
<?lua
local model = _G.dbmodel
if #model.order == 0 then
?>
<div class = "notfound">
<p>No entry found</p>
<blockquote>
“In many ways my life has been rather like a record of the lost and found. Perhaps all lives are like that.”
<span>― Lucy Foley, The Book of Lost and Found</span>
</blockquote >
</div>
<?lua
return
end
for idx,v in pairs(model.order) do
local data = model.data[v]
?>
<div class = "card">
<div class = "side">
<span class = "date"><?=data.ctimestr:gsub("%s+.*$","")?></span>
<span class = "tags">
<?lua
local atags = {}
local i = 1
for tag in data.tags:gmatch(",*([^,]+)") do
tag = std.trim(tag, " ")
local b64tag = std.b64encode(tag)
atags[i] = '<a href = "./bytag:'..b64tag:gsub("=","")..':'..MAX_ENTRY..'">'..tag.."</a>"
i = i+ 1
end
echo(table.concat(atags, ", "))
?>
</span>
</div>
<div class = "blogentry">
<div class = "shortcontent">
<?lua
local content = bytes.__tostring(std.b64decode(data.rendered)):gsub("%%","%%%%")
local r, s = content:find("(<hr/?>)")
if r then
content = content:sub(0,r-1)
end
echo(content)
?>
</div>
<div class = "detail">
<span></span>
<?='<a href="./id:'..data.id..'" ></a>'?>
<span></span>
</div>
</div>
</div>
<?lua
end
?>

40
blog/view/top.html Normal file
View File

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Hi, I'm Xuan Sang LE</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="rst/ubuntu-regular.css" />
<link rel="stylesheet" type="text/css" href="rst/font-awesome.css" />
<link rel="stylesheet" type="text/css" href="rst/hljs/github.css" />
<link rel="stylesheet" type="text/css" href="assets/style.css" />
<script src="rst/gscripts/jquery-3.2.1.min.js"> </script>
<script src="rst/hljs/highlight.pack.js"> </script>
<script src="rst/hljs/highlightjs-line-numbers.min.js"> </script>
<script>
$(document).ready(function() {
$('pre code').each(function(i, block) {
hljs.highlightBlock(block);
hljs.lineNumbersBlock(block);
});
});
</script>
</head>
<body>
<div id = "top">
<div id = "navbar">
<div class = "logo"><a href = "https://lxsang.me"></a></div>
<ul>
<li><i class = "fa fa-home"></i><a href="./">Home</a></li>
<li ><i class = "fa fa-address-card"></i><a href="https://info.lxsang.me" >Porfolio</a></li>
<li><i class = "fa fa-paper-plane"></i><a href="#" onclick="" >Contact</a></li>
<li > <i class = "fa fa-globe"></i><a href = "https://lxsang.me" target="_blank">#Me</a></li>
</ul>
<input type = "text" class = "search-box"></input>
<div class= "search-icon"></div>
</div>
</div>
<div id = "center">
<div id = "container">