Skip to content
Browse files

Fix creating and viewing Persons

  • Loading branch information...
1 parent 9d48d84 commit ed06cb7865bbba0d3ba9c7a5b1cd61b5c4e6d88f Oliver Charles committed Jun 6, 2012
Showing with 13 additions and 9 deletions.
  1. +3 −3 bookbrainz-data/src/BookBrainz/Schema.hs
  2. +10 −6 bookbrainz-server/src/BookBrainz/Web/View/Person.hs
View
6 bookbrainz-data/src/BookBrainz/Schema.hs
@@ -166,11 +166,11 @@ instance ToField (Ref (Branch Edition)) where
--------------------------------------------------------------------------------
instance FromRow (LoadedCoreEntity Person) where
fromRow = do
- bbid' <- field
- revId <- field
- treeId <- field
conceptId <- field
+ bbid' <- field
name <- field
+ treeId <- field
+ revId <- field
return CoreEntity { bbid = bbid'
, coreEntityRevision = revId
, coreEntityTree = treeId
View
16 bookbrainz-server/src/BookBrainz/Web/View/Person.hs
@@ -7,14 +7,15 @@ module BookBrainz.Web.View.Person
, addPerson
) where
-import Data.Copointed
-import Text.Blaze.Html5 (toHtml, (!), toValue, Html)
-import qualified Text.Blaze.Html5.Attributes as A
+import Data.Copointed
+import Text.Blaze.Html5 (toHtml, (!), toValue, Html)
import qualified Text.Blaze.Html5 as H
+import qualified Text.Blaze.Html5.Attributes as A
+import Text.Digestive.Blaze.Html5
import qualified Text.Digestive.View as Form
-import BookBrainz.Types
-import BookBrainz.Web.View (pageLayout, View)
+import BookBrainz.Types
+import BookBrainz.Web.View (pageLayout, View)
--------------------------------------------------------------------------------
-- | Display a single 'Person'.
@@ -32,5 +33,8 @@ addPerson :: Form.View Html -- ^ The form 'Html' and the encoding of it.
addPerson v =
pageLayout Nothing $ do
H.h1 "Add Person"
- H.form ! A.method "POST" ! A.enctype (toValue $ Form.viewEncType v) $
+ H.form ! A.method "POST" ! A.enctype (toValue $ Form.viewEncType v) $ do
+ H.p $ do
+ label "name" v "Name:"
+ inputText "name" v
H.p $ H.input ! A.type_ "submit" ! A.value "Add Person"

0 comments on commit ed06cb7

Please sign in to comment.
Something went wrong with that request. Please try again.