1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2024-11-19 18:08:21 +01:00

support multi-user in info

This commit is contained in:
lxsang 2020-06-07 19:46:59 +02:00
parent 66bcfa83b0
commit d15ab7dfec
5 changed files with 17 additions and 14 deletions

View File

@ -4,8 +4,8 @@
@font-face {
font-family: 'Ubuntu';
src: url('resources/themes/antos/fonts//ubuntu-regular-webfont.woff2') format('woff2'),
url('resources/themes/antos/fonts//ubuntu-regular-webfont.woff') format('woff');
src: url('resources/themes/system/fonts//ubuntu-regular-webfont.woff2') format('woff2'),
url('resources/themes/system/fonts//ubuntu-regular-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
@ -13,8 +13,8 @@
@font-face {
font-family: 'Ubuntu';
src: url('resources/themes/antos/fonts//ubuntu-bold-webfont.woff2') format('woff2'),
url('resources/themes/antos/fonts//ubuntu-bold-webfont.woff') format('woff');
src: url('resources/themes/system/fonts//ubuntu-bold-webfont.woff2') format('woff2'),
url('resources/themes/system/fonts//ubuntu-bold-webfont.woff') format('woff');
font-weight: bold;
font-style: normal;
@ -22,8 +22,8 @@
@font-face {
font-family: 'Ubuntu';
src: url('resources/themes/antos/fonts//ubuntu-bolditalic-webfont.woff2') format('woff2'),
url('resources/themes/antos/fonts//ubuntu-bolditalic-webfont.woff') format('woff');
src: url('resources/themes/system/fonts//ubuntu-bolditalic-webfont.woff2') format('woff2'),
url('resources/themes/system/fonts//ubuntu-bolditalic-webfont.woff') format('woff');
font-weight: bold;
font-style: italic;
@ -31,8 +31,8 @@
@font-face {
font-family: 'Ubuntu';
src: url('resources/themes/antos/fonts//ubuntu-italic-webfont.woff2') format('woff2'),
url('resources/themes/antos/fonts//ubuntu-italic-webfont.woff') format('woff');
src: url('resources/themes/system/fonts//ubuntu-italic-webfont.woff2') format('woff2'),
url('resources/themes/system/fonts//ubuntu-italic-webfont.woff') format('woff');
font-weight: normal;
font-style: italic;

View File

@ -52,8 +52,8 @@ function IndexController:actionnotfound(...)
end
function IndexController:pdf(...)
local tmp_file = WWW_ROOT.."/lxsang_cv.pdf"
local cmd = "wkhtmltopdf "..HTTP_ROOT.."/index/notoc "..tmp_file
local tmp_file = WWW_ROOT.."/cv_exported.pdf"
local cmd = "wkhtmltopdf "..HTTP_ROOT.."/"..self.registry.user.."/notoc "..tmp_file
local r = os.execute(cmd)
if r then
local mime = std.mimeOf(tmp_file)

View File

@ -11,6 +11,7 @@ function UserController:index(...)
if not data or not data[1] then
self:error("Cannot fetch user info")
end
data[1].user = self.registry.user
self.template:set("data", data[1])
return true
end

View File

@ -26,7 +26,8 @@ require(BASE_FRW.."silk.api")
local REGISTRY = {}
-- set logging level
REGISTRY.logger = Logger:new{ levels = {INFO = false, ERROR = true, DEBUG = false}}
REGISTRY.db = DBHelper:new{db="mrsang"}
REGISTRY.user = "mrsang"
REGISTRY.db = DBHelper:new{db=REGISTRY.user}
REGISTRY.layout = 'default'
REGISTRY.fileaccess = true
@ -60,9 +61,10 @@ BaseController:subclass("NotfoundController",{ registry = {}, models = {} })
function NotfoundController:index(...)
local args = {...}
local user = args[1]:gsub("Controller", ""):lower();
REQUEST.r = "index"
REQUEST.r = "index/"..std.trim(REQUEST.r:gsub(user, ""), "/")
if REGISTRY.db then REGISTRY.db:close() end
REGISTRY.db = DBHelper:new{db = user}
REGISTRY.user = user
REGISTRY.db = DBHelper:new{db=REGISTRY.user}
REGISTRY.db:open()
router:delegate()
end

View File

@ -15,7 +15,7 @@
if not preview then
?>
<span class="fa fa-file-pdf-o"></span>
<span class="text"><a href ="<?=HTTP_ROOT?>/index/pdf" target="_blank">Download</a></span>
<span class="text"><a href ="<?=HTTP_ROOT?>/<?=data.user?>/pdf" target="_blank">Download</a></span>
<?lua
end
?>