Commit 23e62de8 authored by Michael Hanus 's avatar Michael Hanus
Browse files

Adapted to new version of html package

parent 987e4bc1
......@@ -4,7 +4,7 @@ module System.Authorization
( AccessType(..), AccessResult(..), checkAuthorization )
where
import HTML
import HTML.Base
import System.Spicey(Controller,displayError)
import System.SessionInfo
......
......@@ -4,7 +4,7 @@
module Main where
import HTML
import HTML.Base
import WUI
import Config.ControllerMapping
......
......@@ -12,7 +12,7 @@ import Config.UserProcesses
import AllSolutions
import Global
import HTML
import HTML.Base
import Maybe
import ReadShowTerm
......
......@@ -7,7 +7,7 @@ module System.Routes
( getControllerReference, getRouteMenu )
where
import HTML
import HTML.Base
import Config.RoutesData
--generated in RoutesData
......
......@@ -13,7 +13,7 @@ module System.Session (
getSessionData, putSessionData, removeSessionData
) where
import HTML
import HTML.Base
import Time
import Global
import List
......
......@@ -5,7 +5,7 @@
module System.Spicey (
module System,
module HTML,
module HTML.Base,
module ReadNumeric,
Controller, applyControllerOn,
nextController, nextControllerForData, confirmNextController,
......@@ -26,13 +26,13 @@ module System.Spicey (
import Char (isSpace,isDigit)
import Global
import HTML
import Database.KeyDatabaseSQLite
import ReadNumeric
import ReadShowTerm(readsQTerm)
import System
import Time
import HTML.Base
import HTML.Styles.Bootstrap3
import WUI
......
......@@ -5,8 +5,8 @@
"synopsis": "Web application 'XXXPKGNAMEXXX' generated by Spicey",
"category": [ "Web" ],
"dependencies": {
"html": ">= 1.0.0",
"wui" : ">= 1.0.0"
"html": ">= 2.0.0",
"wui" : ">= 2.0.0"
},
"compilerCompatibility": {
"pakcs": ">= 2.0.0",
......
......@@ -27,7 +27,7 @@ generateControllersForEntity erdname allEntities
simpleCurryProg
(controllerModuleName ename)
-- imports:
[ spiceyModule, "Database.KeyDatabaseSQLite", "HTML", "Time"
[ spiceyModule, "Database.KeyDatabaseSQLite", "HTML.Base", "Time"
, erdname, viewModuleName ename
, "Maybe", sessionInfoModule, authorizationModule, enauthModName
, "Config.UserProcesses",
......@@ -368,9 +368,9 @@ deleteController erdname (Entity entityName _) _ _ =
CLambda [CPVar (0,"_")] $
applyF (spiceyModule,"confirmController")
[list2ac
[applyF ("HTML","h3")
[applyF (html "h3")
[list2ac
[applyF ("HTML","htxt")
[applyF (html "htxt")
[applyF (pre "concat")
[list2ac [string2ac "Really delete entity \"",
applyF (entitiesToHtmlModule erdname,
......
......@@ -11,7 +11,7 @@ import Spicey.GenerationHelper
generateToHtml :: String -> [Entity] -> [Relationship] -> CurryProg
generateToHtml erdname allEntities relationships = simpleCurryProg
(entitiesToHtmlModule erdname)
["WUI", "HTML", "Time", spiceyModule, erdname] -- imports
["WUI", "HTML.Base", "Time", spiceyModule, erdname] -- imports
[] -- typedecls
-- functions
(
......@@ -42,7 +42,7 @@ toListView erdname (Entity entityName attrlist) _ _ =
"This view is used in a row of a table of all entities.")
(thisModuleName erdname, (lowerFirst entityName)++"ToListView") 2 Public
(baseType (erdname, entityName)
~> listType (listType (baseType ("HTML", "HtmlExp"))))
~> listType (listType (baseType (html "HtmlExp"))))
[simpleRule [CPVar (1, lowerFirst entityName)]
(list2ac (
(map (\a -> list2ac [
......@@ -100,7 +100,7 @@ toDetailsView erdname (Entity entityName attrlist) relationships allEntities =
2
Public
-- function type
(foldr CFuncType (listType (baseType ("HTML", "HtmlExp")))
(foldr CFuncType (listType (baseType (html "HtmlExp")))
([baseType (erdname, entityName)] ++
(map ctvar manyToOneEntities) ++ -- defaults for n:1
(map (\name -> listType (ctvar name)) manyToManyEntities)
......@@ -137,14 +137,14 @@ toDetailsView erdname (Entity entityName attrlist) relationships allEntities =
[CVar evar]]])
attrlist ++
map (\ (name,varId) ->
list2ac [applyF ("HTML","htxt")
list2ac [applyF (html "htxt")
[applyF (thisModuleName erdname,
lowerFirst name ++ "ToShortView")
[CVar (varId,"related"++name)]]])
(zip manyToOneEntities [2..]) ++
map (\ (name,varId) ->
list2ac
[applyF ("HTML","htxt")
[applyF (html "htxt")
[applyF (pre "unwords")
[applyF (pre "map")
[applyF (thisModuleName erdname,
......@@ -167,17 +167,17 @@ labelList erdname (Entity entityName attrlist) relationships allEntities =
("The labels of a "++entityName++" entity, as used in HTML tables.")
(thisModuleName erdname, (lowerFirst entityName)++"LabelList") 2 Public
(
listType (listType (baseType ("HTML", "HtmlExp")))
listType (listType (baseType (html "HtmlExp")))
)
[simpleRule []
(list2ac (
(map (\ (Attribute name domain _ _) ->
list2ac [applyF ("HTML", "textstyle")
list2ac [applyF (html "textstyle")
[string2ac ("spicey_label spicey_label_for_type_"++
domainToString domain),
string2ac name]])
attrlist) ++
(map (\s -> list2ac [applyF ("HTML", "textstyle")
(map (\s -> list2ac [applyF (html "textstyle")
[string2ac "spicey_label spicey_label_for_type_relation",
string2ac s]])
(manyToOneEntities++manyToManyEntities))
......
......@@ -23,6 +23,10 @@ upperFirst [] = [] -- this case should not occur, but one never knows...
db :: String -> QName
db f = ("Database.KeyDatabaseSQLite", f)
--- Converts a string into a qualified name of the module "HTML.Base".
html :: String -> QName
html f = ("HTML.Base", f)
--- Converts a string into a qualified name of the module "WUI".
wui :: String -> QName
wui f = ("WUI", f)
......@@ -165,7 +169,7 @@ viewFunctionName entityName viewFunction =
(viewModuleName entityName, viewFunction ++ entityName ++ "View")
viewBlockType :: CTypeExpr
viewBlockType = listType (baseType ("HTML","HtmlExp"))
viewBlockType = listType (baseType (html "HtmlExp"))
attrType :: Attribute -> CTypeExpr
......@@ -292,7 +296,7 @@ widgetFor domain null =
BoolDom _ -> addMaybe (constF (wui "wBoolean"))
DateDom _ -> addMaybe (constF (spiceyModule, "wDateType"))
UserDefined _ _ -> addMaybe (applyF (wui "wCheckBool")
[applyF ("HTML","htxt") [string2ac ""]])
[applyF (html "htxt") [string2ac ""]])
KeyDom _ -> addMaybe (constF (wui "wInt"))
_ -> error "widgetFor: unknown domain for attribute"
where
......
......@@ -16,7 +16,7 @@ import Spicey.Scaffolding
systemBanner :: String
systemBanner =
let bannerText = "Spicey Web Framework (Version " ++ packageVersion ++
" of 30/05/17)"
" of 06/10/17)"
bannerLine = take (length bannerText) (repeat '-')
in bannerLine ++ "\n" ++ bannerText ++ "\n" ++ bannerLine
......
......@@ -16,7 +16,7 @@ generateViewsForEntity erdname allEntities
noPKeyAttrs = filter notPKey attrlist
in simpleCurryProg
(viewModuleName ename)
[ "WUI", "HTML", "Time", "Sort", bootstrapModule
[ "WUI", "HTML.Base", "Time", "Sort", bootstrapModule
, spiceyModule, sessionInfoModule
, erdname, entitiesToHtmlModule erdname] -- imports
[] -- typedecls
......@@ -75,7 +75,7 @@ wuiSpec erdname (Entity entityName attrlist) relationships allEntities =
applyF (wui "wMultiCheckSelect")
[CLambda [CPVar (1, lowerFirst e)]
(list2ac [
applyF ("HTML", "htxt") [
applyF (html "htxt") [
applyF (erdname, lowerFirst e++"ToShortView")
[CVar (1, lowerFirst e)]
]]),
......@@ -454,7 +454,7 @@ showView erdname (Entity entityName attrlist) relationships allEntities =
),
list2ac [applyF hrefButtonName
[string2ac ("?"++entityName++"/list"),
list2ac [applyF ("HTML","htxt")
list2ac [applyF (html"htxt")
[string2ac ("back to "++entityName++" list")]]]]
]
)]
......@@ -480,8 +480,8 @@ listView erdname (Entity entityName attrlist) _ _ =
[CPVar infovar, CPVar entsvar]
(CSimpleRhs
(applyF (pre ":") [
applyF ("HTML", "h1")
[list2ac [applyF ("HTML", "htxt")
applyF (html "h1")
[list2ac [applyF (html "htxt")
[string2ac $ entityName ++ " list"]]],
list2ac [
applyF (spiceyModule, "spTable") [
......@@ -524,17 +524,17 @@ listView erdname (Entity entityName attrlist) _ _ =
[applyF hrefButtonName
[applyF (pre "++")
[string2ac ("?"++entityName++"/show/"),showkey],
list2ac [applyF ("HTML","htxt") [string2ac "show"]]]],
list2ac [applyF (html "htxt") [string2ac "show"]]]],
list2ac
[applyF hrefButtonName
[applyF (pre "++")
[string2ac ("?"++entityName++"/edit/"),showkey],
list2ac [applyF ("HTML","htxt") [string2ac "edit"]]]],
list2ac [applyF (html "htxt") [string2ac "edit"]]]],
list2ac
[applyF hrefButtonName
[applyF (pre "++")
[string2ac ("?"++entityName++"/delete/"),showkey],
list2ac [applyF ("HTML","htxt") [string2ac "delete"]]]]
list2ac [applyF (html "htxt") [string2ac "delete"]]]]
]]
]
)])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment