mirror of
https://github.com/lxsang/antd-web-apps
synced 2024-11-20 02:18:20 +01:00
support multi-user in info
This commit is contained in:
parent
66bcfa83b0
commit
d15ab7dfec
@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Ubuntu';
|
font-family: 'Ubuntu';
|
||||||
src: url('resources/themes/antos/fonts//ubuntu-regular-webfont.woff2') format('woff2'),
|
src: url('resources/themes/system/fonts//ubuntu-regular-webfont.woff2') format('woff2'),
|
||||||
url('resources/themes/antos/fonts//ubuntu-regular-webfont.woff') format('woff');
|
url('resources/themes/system/fonts//ubuntu-regular-webfont.woff') format('woff');
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
|
|
||||||
@ -13,8 +13,8 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Ubuntu';
|
font-family: 'Ubuntu';
|
||||||
src: url('resources/themes/antos/fonts//ubuntu-bold-webfont.woff2') format('woff2'),
|
src: url('resources/themes/system/fonts//ubuntu-bold-webfont.woff2') format('woff2'),
|
||||||
url('resources/themes/antos/fonts//ubuntu-bold-webfont.woff') format('woff');
|
url('resources/themes/system/fonts//ubuntu-bold-webfont.woff') format('woff');
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
|
|
||||||
@ -22,8 +22,8 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Ubuntu';
|
font-family: 'Ubuntu';
|
||||||
src: url('resources/themes/antos/fonts//ubuntu-bolditalic-webfont.woff2') format('woff2'),
|
src: url('resources/themes/system/fonts//ubuntu-bolditalic-webfont.woff2') format('woff2'),
|
||||||
url('resources/themes/antos/fonts//ubuntu-bolditalic-webfont.woff') format('woff');
|
url('resources/themes/system/fonts//ubuntu-bolditalic-webfont.woff') format('woff');
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
|
|
||||||
@ -31,8 +31,8 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Ubuntu';
|
font-family: 'Ubuntu';
|
||||||
src: url('resources/themes/antos/fonts//ubuntu-italic-webfont.woff2') format('woff2'),
|
src: url('resources/themes/system/fonts//ubuntu-italic-webfont.woff2') format('woff2'),
|
||||||
url('resources/themes/antos/fonts//ubuntu-italic-webfont.woff') format('woff');
|
url('resources/themes/system/fonts//ubuntu-italic-webfont.woff') format('woff');
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
|
|
||||||
|
@ -52,8 +52,8 @@ function IndexController:actionnotfound(...)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function IndexController:pdf(...)
|
function IndexController:pdf(...)
|
||||||
local tmp_file = WWW_ROOT.."/lxsang_cv.pdf"
|
local tmp_file = WWW_ROOT.."/cv_exported.pdf"
|
||||||
local cmd = "wkhtmltopdf "..HTTP_ROOT.."/index/notoc "..tmp_file
|
local cmd = "wkhtmltopdf "..HTTP_ROOT.."/"..self.registry.user.."/notoc "..tmp_file
|
||||||
local r = os.execute(cmd)
|
local r = os.execute(cmd)
|
||||||
if r then
|
if r then
|
||||||
local mime = std.mimeOf(tmp_file)
|
local mime = std.mimeOf(tmp_file)
|
||||||
|
@ -11,6 +11,7 @@ function UserController:index(...)
|
|||||||
if not data or not data[1] then
|
if not data or not data[1] then
|
||||||
self:error("Cannot fetch user info")
|
self:error("Cannot fetch user info")
|
||||||
end
|
end
|
||||||
|
data[1].user = self.registry.user
|
||||||
self.template:set("data", data[1])
|
self.template:set("data", data[1])
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
@ -26,7 +26,8 @@ require(BASE_FRW.."silk.api")
|
|||||||
local REGISTRY = {}
|
local REGISTRY = {}
|
||||||
-- set logging level
|
-- set logging level
|
||||||
REGISTRY.logger = Logger:new{ levels = {INFO = false, ERROR = true, DEBUG = false}}
|
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.layout = 'default'
|
||||||
REGISTRY.fileaccess = true
|
REGISTRY.fileaccess = true
|
||||||
|
|
||||||
@ -60,9 +61,10 @@ BaseController:subclass("NotfoundController",{ registry = {}, models = {} })
|
|||||||
function NotfoundController:index(...)
|
function NotfoundController:index(...)
|
||||||
local args = {...}
|
local args = {...}
|
||||||
local user = args[1]:gsub("Controller", ""):lower();
|
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
|
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()
|
REGISTRY.db:open()
|
||||||
router:delegate()
|
router:delegate()
|
||||||
end
|
end
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
if not preview then
|
if not preview then
|
||||||
?>
|
?>
|
||||||
<span class="fa fa-file-pdf-o"></span>
|
<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
|
<?lua
|
||||||
end
|
end
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user