diff --git a/IHP/IDE/CodeGen/ViewGenerator.hs b/IHP/IDE/CodeGen/ViewGenerator.hs index 7630fef06..9e6267f6c 100644 --- a/IHP/IDE/CodeGen/ViewGenerator.hs +++ b/IHP/IDE/CodeGen/ViewGenerator.hs @@ -204,9 +204,9 @@ buildPlan' schema config = render${singularName} ${singularVariableName} = [hsx| {${singularVariableName}} - Show - Edit - Delete + Show + Edit + Delete ${qqClose} |] diff --git a/Test/IDE/CodeGeneration/ControllerGenerator.hs b/Test/IDE/CodeGeneration/ControllerGenerator.hs index 9302d1ab3..81289dc97 100644 --- a/Test/IDE/CodeGeneration/ControllerGenerator.hs +++ b/Test/IDE/CodeGeneration/ControllerGenerator.hs @@ -47,7 +47,7 @@ tests = do , AppendToMarker {marker = "-- Controller Imports", filePath = "Web/FrontController.hs", fileContent = "import Web.Controller.Pages"} , AppendToMarker {marker = "-- Generator Marker", filePath = "Web/FrontController.hs", fileContent = " , parseRoute @PagesController"} , EnsureDirectory {directory = "Web/View/Pages"} - , CreateFile {filePath = "Web/View/Pages/Index.hs", fileContent = "module Web.View.Pages.Index where\nimport Web.View.Prelude\n\ndata IndexView = IndexView { pages :: [Page] }\n\ninstance View IndexView where\n html IndexView { .. } = [hsx|\n {breadcrumb}\n\n

Index+ New

\n
\n \n \n \n \n \n \n \n \n \n {forEach pages renderPage}\n
Page
\n \n
\n |]\n where\n breadcrumb = renderBreadcrumb\n [ breadcrumbLink \"Pages\" PagesAction\n ]\n\nrenderPage :: Page -> Html\nrenderPage page = [hsx|\n \n {page}\n Show\n Edit\n Delete\n \n|]"} + , CreateFile {filePath = "Web/View/Pages/Index.hs", fileContent = "module Web.View.Pages.Index where\nimport Web.View.Prelude\n\ndata IndexView = IndexView { pages :: [Page] }\n\ninstance View IndexView where\n html IndexView { .. } = [hsx|\n {breadcrumb}\n\n

Index+ New

\n
\n \n \n \n \n \n \n \n \n \n {forEach pages renderPage}\n
Page
\n \n
\n |]\n where\n breadcrumb = renderBreadcrumb\n [ breadcrumbLink \"Pages\" PagesAction\n ]\n\nrenderPage :: Page -> Html\nrenderPage page = [hsx|\n \n {page}\n Show\n Edit\n Delete\n \n|]"} , AddImport {filePath = "Web/Controller/Pages.hs", fileContent = "import Web.View.Pages.Index"} , EnsureDirectory {directory = "Web/View/Pages"} , CreateFile {filePath = "Web/View/Pages/New.hs", fileContent = "module Web.View.Pages.New where\nimport Web.View.Prelude\n\ndata NewView = NewView { page :: Page }\n\ninstance View NewView where\n html NewView { .. } = [hsx|\n {breadcrumb}\n

New Page

\n {renderForm page}\n |]\n where\n breadcrumb = renderBreadcrumb\n [ breadcrumbLink \"Pages\" PagesAction\n , breadcrumbText \"New Page\"\n ]\n\nrenderForm :: Page -> Html\nrenderForm page = formFor page [hsx|\n \n {submitButton}\n\n|]"} @@ -78,7 +78,7 @@ tests = do , AppendToMarker {marker = "-- Controller Imports", filePath = "Web/FrontController.hs", fileContent = "import Web.Controller.Page"} , AppendToMarker {marker = "-- Generator Marker", filePath = "Web/FrontController.hs", fileContent = " , parseRoute @PageController"} , EnsureDirectory {directory = "Web/View/Page"} - , CreateFile {filePath = "Web/View/Page/Index.hs", fileContent = "module Web.View.Page.Index where\nimport Web.View.Prelude\n\ndata IndexView = IndexView { page :: [Page] }\n\ninstance View IndexView where\n html IndexView { .. } = [hsx|\n {breadcrumb}\n\n

Index+ New

\n
\n \n \n \n \n \n \n \n \n \n {forEach page renderPage}\n
Page
\n \n
\n |]\n where\n breadcrumb = renderBreadcrumb\n [ breadcrumbLink \"Pages\" PagesAction\n ]\n\nrenderPage :: Page -> Html\nrenderPage page = [hsx|\n \n {page}\n Show\n Edit\n Delete\n \n|]"} + , CreateFile {filePath = "Web/View/Page/Index.hs", fileContent = "module Web.View.Page.Index where\nimport Web.View.Prelude\n\ndata IndexView = IndexView { page :: [Page] }\n\ninstance View IndexView where\n html IndexView { .. } = [hsx|\n {breadcrumb}\n\n

Index+ New

\n
\n \n \n \n \n \n \n \n \n \n {forEach page renderPage}\n
Page
\n \n
\n |]\n where\n breadcrumb = renderBreadcrumb\n [ breadcrumbLink \"Pages\" PagesAction\n ]\n\nrenderPage :: Page -> Html\nrenderPage page = [hsx|\n \n {page}\n Show\n Edit\n Delete\n \n|]"} , AddImport {filePath = "Web/Controller/Page.hs", fileContent = "import Web.View.Page.Index"} , EnsureDirectory {directory = "Web/View/Page"} , CreateFile {filePath = "Web/View/Page/New.hs", fileContent = "module Web.View.Page.New where\nimport Web.View.Prelude\n\ndata NewView = NewView { page :: Page }\n\ninstance View NewView where\n html NewView { .. } = [hsx|\n {breadcrumb}\n

New Page

\n {renderForm page}\n |]\n where\n breadcrumb = renderBreadcrumb\n [ breadcrumbLink \"Pages\" PagesAction\n , breadcrumbText \"New Page\"\n ]\n\nrenderForm :: Page -> Html\nrenderForm page = formFor page [hsx|\n \n {submitButton}\n\n|]"} @@ -107,7 +107,7 @@ tests = do , AppendToMarker {marker = "-- Controller Imports", filePath = "Web/FrontController.hs", fileContent = "import Web.Controller.PageComment"} , AppendToMarker {marker = "-- Generator Marker", filePath = "Web/FrontController.hs", fileContent = " , parseRoute @PageCommentController"} , EnsureDirectory {directory = "Web/View/PageComment"} - , CreateFile {filePath = "Web/View/PageComment/Index.hs", fileContent = "module Web.View.PageComment.Index where\nimport Web.View.Prelude\n\ndata IndexView = IndexView { pageComment :: [PageComment] }\n\ninstance View IndexView where\n html IndexView { .. } = [hsx|\n {breadcrumb}\n\n

Index+ New

\n
\n \n \n \n \n \n \n \n \n \n {forEach pageComment renderPageComment}\n
PageComment
\n \n
\n |]\n where\n breadcrumb = renderBreadcrumb\n [ breadcrumbLink \"PageComments\" PageCommentsAction\n ]\n\nrenderPageComment :: PageComment -> Html\nrenderPageComment pageComment = [hsx|\n \n {pageComment}\n Show\n Edit\n Delete\n \n|]"} + , CreateFile {filePath = "Web/View/PageComment/Index.hs", fileContent = "module Web.View.PageComment.Index where\nimport Web.View.Prelude\n\ndata IndexView = IndexView { pageComment :: [PageComment] }\n\ninstance View IndexView where\n html IndexView { .. } = [hsx|\n {breadcrumb}\n\n

Index+ New

\n
\n \n \n \n \n \n \n \n \n \n {forEach pageComment renderPageComment}\n
PageComment
\n \n
\n |]\n where\n breadcrumb = renderBreadcrumb\n [ breadcrumbLink \"PageComments\" PageCommentsAction\n ]\n\nrenderPageComment :: PageComment -> Html\nrenderPageComment pageComment = [hsx|\n \n {pageComment}\n Show\n Edit\n Delete\n \n|]"} , AddImport {filePath = "Web/Controller/PageComment.hs", fileContent = "import Web.View.PageComment.Index"} , EnsureDirectory {directory = "Web/View/PageComment"} , CreateFile {filePath = "Web/View/PageComment/New.hs", fileContent = "module Web.View.PageComment.New where\nimport Web.View.Prelude\n\ndata NewView = NewView { pageComment :: PageComment }\n\ninstance View NewView where\n html NewView { .. } = [hsx|\n {breadcrumb}\n

New PageComment

\n {renderForm pageComment}\n |]\n where\n breadcrumb = renderBreadcrumb\n [ breadcrumbLink \"PageComments\" PageCommentsAction\n , breadcrumbText \"New PageComment\"\n ]\n\nrenderForm :: PageComment -> Html\nrenderForm pageComment = formFor pageComment [hsx|\n \n {submitButton}\n\n|]"} @@ -137,7 +137,7 @@ tests = do , AppendToMarker {marker = "-- Controller Imports", filePath = "Web/FrontController.hs", fileContent = "import Web.Controller.PageComment"} , AppendToMarker {marker = "-- Generator Marker", filePath = "Web/FrontController.hs", fileContent = " , parseRoute @PageCommentController"} , EnsureDirectory {directory = "Web/View/PageComment"} - , CreateFile {filePath = "Web/View/PageComment/Index.hs", fileContent = "module Web.View.PageComment.Index where\nimport Web.View.Prelude\n\ndata IndexView = IndexView { pageComment :: [PageComment] }\n\ninstance View IndexView where\n html IndexView { .. } = [hsx|\n {breadcrumb}\n\n

Index+ New

\n
\n \n \n \n \n \n \n \n \n \n {forEach pageComment renderPageComment}\n
PageComment
\n \n
\n |]\n where\n breadcrumb = renderBreadcrumb\n [ breadcrumbLink \"PageComments\" PageCommentsAction\n ]\n\nrenderPageComment :: PageComment -> Html\nrenderPageComment pageComment = [hsx|\n \n {pageComment}\n Show\n Edit\n Delete\n \n|]"} + , CreateFile {filePath = "Web/View/PageComment/Index.hs", fileContent = "module Web.View.PageComment.Index where\nimport Web.View.Prelude\n\ndata IndexView = IndexView { pageComment :: [PageComment] }\n\ninstance View IndexView where\n html IndexView { .. } = [hsx|\n {breadcrumb}\n\n

Index+ New

\n
\n \n \n \n \n \n \n \n \n \n {forEach pageComment renderPageComment}\n
PageComment
\n \n
\n |]\n where\n breadcrumb = renderBreadcrumb\n [ breadcrumbLink \"PageComments\" PageCommentsAction\n ]\n\nrenderPageComment :: PageComment -> Html\nrenderPageComment pageComment = [hsx|\n \n {pageComment}\n Show\n Edit\n Delete\n \n|]"} , AddImport {filePath = "Web/Controller/PageComment.hs", fileContent = "import Web.View.PageComment.Index"} , EnsureDirectory {directory = "Web/View/PageComment"} , CreateFile {filePath = "Web/View/PageComment/New.hs", fileContent = "module Web.View.PageComment.New where\nimport Web.View.Prelude\n\ndata NewView = NewView { pageComment :: PageComment }\n\ninstance View NewView where\n html NewView { .. } = [hsx|\n {breadcrumb}\n

New PageComment

\n {renderForm pageComment}\n |]\n where\n breadcrumb = renderBreadcrumb\n [ breadcrumbLink \"PageComments\" PageCommentsAction\n , breadcrumbText \"New PageComment\"\n ]\n\nrenderForm :: PageComment -> Html\nrenderForm pageComment = formFor pageComment [hsx|\n \n {submitButton}\n\n|]"} @@ -168,7 +168,7 @@ tests = do , AppendToMarker {marker = "-- Controller Imports", filePath = "Web/FrontController.hs", fileContent = "import Web.Controller.People"} , AppendToMarker {marker = "-- Generator Marker", filePath = "Web/FrontController.hs", fileContent = " , parseRoute @PeopleController"} , EnsureDirectory {directory = "Web/View/People"} - , CreateFile {filePath = "Web/View/People/Index.hs", fileContent = "module Web.View.People.Index where\nimport Web.View.Prelude\n\ndata IndexView = IndexView { people :: [Person] }\n\ninstance View IndexView where\n html IndexView { .. } = [hsx|\n {breadcrumb}\n\n

Index+ New

\n
\n \n \n \n \n \n \n \n \n \n {forEach people renderPerson}\n
Person
\n \n
\n |]\n where\n breadcrumb = renderBreadcrumb\n [ breadcrumbLink \"People\" PeopleAction\n ]\n\nrenderPerson :: Person -> Html\nrenderPerson person = [hsx|\n \n {person}\n Show\n Edit\n Delete\n \n|]"} + , CreateFile {filePath = "Web/View/People/Index.hs", fileContent = "module Web.View.People.Index where\nimport Web.View.Prelude\n\ndata IndexView = IndexView { people :: [Person] }\n\ninstance View IndexView where\n html IndexView { .. } = [hsx|\n {breadcrumb}\n\n

Index+ New

\n
\n \n \n \n \n \n \n \n \n \n {forEach people renderPerson}\n
Person
\n \n
\n |]\n where\n breadcrumb = renderBreadcrumb\n [ breadcrumbLink \"People\" PeopleAction\n ]\n\nrenderPerson :: Person -> Html\nrenderPerson person = [hsx|\n \n {person}\n Show\n Edit\n Delete\n \n|]"} , AddImport {filePath = "Web/Controller/People.hs", fileContent = "import Web.View.People.Index"} , EnsureDirectory {directory = "Web/View/People"} , CreateFile {filePath = "Web/View/People/New.hs", fileContent = "module Web.View.People.New where\nimport Web.View.Prelude\n\ndata NewView = NewView { person :: Person }\n\ninstance View NewView where\n html NewView { .. } = [hsx|\n {breadcrumb}\n

New Person

\n {renderForm person}\n |]\n where\n breadcrumb = renderBreadcrumb\n [ breadcrumbLink \"People\" PeopleAction\n , breadcrumbText \"New Person\"\n ]\n\nrenderForm :: Person -> Html\nrenderForm person = formFor person [hsx|\n \n {submitButton}\n\n|]"}