diff --git a/info/controllers/IndexController.lua b/info/controllers/IndexController.lua index ff57fa0..17dd810 100644 --- a/info/controllers/IndexController.lua +++ b/info/controllers/IndexController.lua @@ -53,7 +53,8 @@ end function IndexController:pdf(...) local tmp_file = WWW_ROOT.."/cv_exported.pdf" - local cmd = "wkhtmltopdf "..HTTP_ROOT.."/"..self.registry.user.."/notoc "..tmp_file + local cmd = "wkhtmltopdf "..HTTP_ROOT.."/"..self.registry.user.."/index/notoc "..tmp_file + print(cmd) local r = os.execute(cmd) if r then local mime = std.mimeOf(tmp_file) diff --git a/info/controllers/UserController.lua b/info/controllers/UserController.lua index 82febaf..fa52a4c 100644 --- a/info/controllers/UserController.lua +++ b/info/controllers/UserController.lua @@ -15,3 +15,25 @@ function UserController:index(...) self.template:set("data", data[1]) return true end + + +function UserController:photo(...) + local data = self.user:findAll() + if not data or not data[1] then + self:error("Cannot fetch user info") + end + if(not data[1] or data[1].photo == "") then + self:error("User photo is not available") + end + local prefix = data[1].photo:match("%a+://") + local suffix = data[1].photo:gsub(prefix,"") + local path = string.format("/home/%s/", self.registry.user)..suffix + print(path) + if ulib.exists(path) then + local mime = std.mimeOf(path) + std.sendFile(path) + else + self:error("Asset file not found or access forbidden: "..path) + end + return false +end \ No newline at end of file diff --git a/info/router.lua b/info/router.lua index af67739..17de4fa 100644 --- a/info/router.lua +++ b/info/router.lua @@ -67,7 +67,7 @@ function NotfoundController:index(...) self:error("404: Controller "..args[1].." not found : "..args[2]) return end - REQUEST.r = "index/"..std.trim(REQUEST.r:gsub(user, ""), "/") + REQUEST.r = std.trim(REQUEST.r:gsub(user, ""), "/") if REGISTRY.db then REGISTRY.db:close() end REGISTRY.user = user REGISTRY.db = DBHelper:new{db=REGISTRY.user} diff --git a/info/style.css b/info/style.css index 3e6226e..26ed5ea 100644 --- a/info/style.css +++ b/info/style.css @@ -31,7 +31,7 @@ } .layout div.container{ - display: none; + display: block; } .layout div.container_active{ display: block; @@ -169,4 +169,16 @@ hr{ border-top: 1px solid #878887; padding: 0; } -img {max-width:100%} \ No newline at end of file +img {max-width:100%} + +.header_container { + display: block; + width: 100%; +} +.header_container img { + float: left; + max-width: 150px; + margin-right: 10px; + margin-bottom: 20px; + display: block; +} diff --git a/info/views/default/toc/index.ls b/info/views/default/toc/index.ls index f2f64d2..034da59 100644 --- a/info/views/default/toc/index.ls +++ b/info/views/default/toc/index.ls @@ -8,7 +8,8 @@ local active = "toc_active" for k, v in pairs(data) do ?> -
  • onclick='switchTab("toc", this)' >
  • + +
  • >
  • - - Curriculum Vitae - -

    -

    -

    - - - - - - - - - Download - -

    -

    - - - -

    \ No newline at end of file +
    + + + +

    + + Curriculum Vitae +

    +

    +

    +

    + + + + +
    + + + + + Download + +

    +

    + + + +

    +
    \ No newline at end of file