Skip to content
Snippets Groups Projects
Unverified Commit c3e4ceed authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

gluon-web: split out model support into a separate package

parent 83a6847f
Branches
Tags
No related merge requests found
......@@ -142,7 +142,7 @@ You may obtain a copy of the License at
<%
ok, err = pcall(renderer.render, content, env, pkg)
if not ok then
renderer.render('error500', {message = err}, 'gluon-web')
renderer.render('error/500', {message = err}, 'gluon-web')
end
%>
......
......@@ -3,7 +3,6 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-web
PKG_VERSION:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include ../gluon.mk
......
......@@ -16,18 +16,6 @@ msgstr "Interner Serverfehler"
msgid "Not Found"
msgstr "Nicht Gefunden"
msgid "One or more fields contain invalid values!"
msgstr "Ein oder mehrere Felder enthalten ungültige Werte!"
msgid "One or more required fields have no value!"
msgstr "Ein oder mehr benötigte Felder sind nicht ausgefüllt!"
msgid "Reset"
msgstr "Zurücksetzen"
msgid "Save"
msgstr "Speichern"
msgid "Sorry, the object you requested was not found."
msgstr "Entschuldigung, das anfgeforderte Objekt wurde nicht gefunden."
......
......@@ -16,18 +16,6 @@ msgstr "Erreur Serveur Interne"
msgid "Not Found"
msgstr "Pas trouvé"
msgid "One or more fields contain invalid values!"
msgstr "Un ou plusieurs champs contiennent des valeurs incorrectes !"
msgid "One or more required fields have no value!"
msgstr "Un ou plusieurs champs n'ont pas de valeur !"
msgid "Reset"
msgstr "Remise à zéro"
msgid "Save"
msgstr "Soumettre"
msgid "Sorry, the object you requested was not found."
msgstr "Désolé, l'objet que vous avez demandé n'as pas été trouvé."
......
......@@ -7,18 +7,6 @@ msgstr ""
msgid "Not Found"
msgstr ""
msgid "One or more fields contain invalid values!"
msgstr ""
msgid "One or more required fields have no value!"
msgstr ""
msgid "Reset"
msgstr ""
msgid "Save"
msgstr ""
msgid "Sorry, the object you requested was not found."
msgstr ""
......
......@@ -146,26 +146,7 @@ local function dispatch(config, http, request)
model = function(name)
local pkg = _pkg
return function()
local hidenav = false
local model = require "gluon.web.model"
local maps = model.load(config, name, renderer, pkg)
for _, map in ipairs(maps) do
map:parse(http)
end
for _, map in ipairs(maps) do
map:handle()
hidenav = hidenav or map.hidenav
end
renderer.render("layout", {
content = "model/wrapper",
env = {
maps = maps,
},
hidenav = hidenav,
})
require('gluon.web.model')(config, http, renderer, name, pkg)
end
end,
......@@ -198,7 +179,7 @@ local function dispatch(config, http, request)
if not node or not node.target then
http:status(404, "Not Found")
renderer.render("layout", {
content = "error404",
content = "error/404",
env = {
message =
"No page is registered at '/" .. table.concat(request, "/") .. "'.\n" ..
......@@ -215,7 +196,7 @@ local function dispatch(config, http, request)
if not ok then
http:status(500, "Internal Server Error")
renderer.render("layout", {
content = "error500",
content = "error/500",
env = {
message =
"Failed to execute dispatcher target for entry '/" .. table.concat(request, "/") .. "'.\n" ..
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment