Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
curry-packages
spicey
Commits
23e62de8
Commit
23e62de8
authored
Oct 06, 2017
by
Michael Hanus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapted to new version of html package
parent
987e4bc1
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
35 additions
and
31 deletions
+35
-31
resource_files/Authorization.curry
resource_files/Authorization.curry
+1
-1
resource_files/Main.curry
resource_files/Main.curry
+1
-1
resource_files/Processes.curry
resource_files/Processes.curry
+1
-1
resource_files/Routes.curry
resource_files/Routes.curry
+1
-1
resource_files/Session.curry
resource_files/Session.curry
+1
-1
resource_files/Spicey.curry
resource_files/Spicey.curry
+2
-2
resource_files/package.json
resource_files/package.json
+2
-2
src/Spicey/ControllerGeneration.curry
src/Spicey/ControllerGeneration.curry
+3
-3
src/Spicey/EntitiesToHtmlGeneration.curry
src/Spicey/EntitiesToHtmlGeneration.curry
+8
-8
src/Spicey/GenerationHelper.curry
src/Spicey/GenerationHelper.curry
+6
-2
src/Spicey/SpiceUp.curry
src/Spicey/SpiceUp.curry
+1
-1
src/Spicey/ViewGeneration.curry
src/Spicey/ViewGeneration.curry
+8
-8
No files found.
resource_files/Authorization.curry
View file @
23e62de8
...
...
@@ -4,7 +4,7 @@ module System.Authorization
( AccessType(..), AccessResult(..), checkAuthorization )
where
import HTML
import HTML
.Base
import System.Spicey(Controller,displayError)
import System.SessionInfo
...
...
resource_files/Main.curry
View file @
23e62de8
...
...
@@ -4,7 +4,7 @@
module Main where
import HTML
import HTML
.Base
import WUI
import Config.ControllerMapping
...
...
resource_files/Processes.curry
View file @
23e62de8
...
...
@@ -12,7 +12,7 @@ import Config.UserProcesses
import AllSolutions
import Global
import HTML
import HTML
.Base
import Maybe
import ReadShowTerm
...
...
resource_files/Routes.curry
View file @
23e62de8
...
...
@@ -7,7 +7,7 @@ module System.Routes
( getControllerReference, getRouteMenu )
where
import HTML
import HTML
.Base
import Config.RoutesData
--generated in RoutesData
...
...
resource_files/Session.curry
View file @
23e62de8
...
...
@@ -13,7 +13,7 @@ module System.Session (
getSessionData, putSessionData, removeSessionData
) where
import HTML
import HTML
.Base
import Time
import Global
import List
...
...
resource_files/Spicey.curry
View file @
23e62de8
...
...
@@ -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
...
...
resource_files/package.json
View file @
23e62de8
...
...
@@ -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"
,
...
...
src/Spicey/ControllerGeneration.curry
View file @
23e62de8
...
...
@@ -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,
...
...
src/Spicey/EntitiesToHtmlGeneration.curry
View file @
23e62de8
...
...
@@ -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))
...
...
src/Spicey/GenerationHelper.curry
View file @
23e62de8
...
...
@@ -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
...
...
src/Spicey/SpiceUp.curry
View file @
23e62de8
...
...
@@ -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
...
...
src/Spicey/ViewGeneration.curry
View file @
23e62de8
...
...
@@ -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"]]]]
]]
]
)])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment