Luke Plant avatar Luke Plant committed d575fe1

Corrected more underscores in field names

Comments (0)

Files changed (7)

src/Blog/Comment.hs

 
 data Comment = Comment {
       uid :: Int
-    , post_id :: Int
+    , postId :: Int
     , timestamp :: Int
     , name :: LB.ByteString
     , email :: LB.ByteString

src/Blog/Forms.hs

 -- | An empty comment used for populating the default form.
 emptyComment = Cm.Comment {
                  uid = undefined
-               , post_id = undefined
+               , postId = undefined
                , timestamp = undefined
                , name = LB.empty
                , email = LB.empty
                      ("format", "Please choose a format from the list"))
                   , (name `elem` Settings.reserved_names && not (maybe False (==name) creds),
                      ("name", "That name is reserved."))
-                  , (not $ P.comments_open blogpost,
+                  , (not $ P.commentsOpen blogpost,
                      ("", "Post is closed for comments"))
                   , (length text > Settings.max_comment_message_size,
                      ("message", "Message too long"))
 
       return (Cm.Comment {
                       uid = 0 -- for sake of preview
-                    , post_id = P.uid blogpost
+                    , postId = P.uid blogpost
                     , timestamp = ts
                     , name = utf8 name
                     , email = utf8 email
                    , summaryFormatted = undefined
                    , format = RST
                    , timestamp = undefined
-                   , comments_open = True
+                   , commentsOpen = True
                    }
 
 -- | Extract a 'post', the 'post categories' and any errors
   let summaryRaw = getPOST req "summaryRaw" `captureOrDefault` ""
   let postRaw = getPOST req "postRaw" `captureOrDefault` ""
   let format = getPOST req "format" `captureOrDefault` Plaintext
-  let comments_open = hasPOST req "comments_open"
+  let commentsOpen = hasPOST req "commentsOpen"
   let tests = [ (null title,
                  ("title", "'Title' is a required field."))
               , (null summaryRaw,
                    , P.postRaw = utf8 postRaw
                    , P.postFormatted = utf8 $ getFormatter format $ postRaw
                    , P.format = format
-                   , P.comments_open = comments_open
+                   , P.commentsOpen = commentsOpen
                    }
          , categories
          , errors

src/Blog/Model.hs

                      , toSql $ P.summaryFormatted p
                      , toSql $ fromEnum $ P.format p
                      , toSql $ P.timestamp p
-                     , toSql $ P.comments_open p
+                     , toSql $ P.commentsOpen p
                      ]
 
 addPost cn p catIds = do
                      , "hidden"
                      , "response"
                      ]
-commentColumnValues cm = [ toSql $ Cm.post_id cm
+commentColumnValues cm = [ toSql $ Cm.postId cm
                          , toSql $ Cm.timestamp cm
                          , toSql $ Cm.name cm
                          , toSql $ Cm.email cm
            , P.summaryFormatted = fromSql (row !! 6)
            , P.format = toEnum $ fromSql (row !! 7)
            , P.timestamp = fromSql (row !! 8)
-           , P.comments_open = fromSql (row !! 9)
+           , P.commentsOpen = fromSql (row !! 9)
            }
 
 makeCategory row =
 
 makeComment row =
     Cm.Comment { Cm.uid = fromSql (row !! 0)
-               , Cm.post_id = fromSql (row !! 1)
+               , Cm.postId = fromSql (row !! 1)
                , Cm.timestamp = fromSql (row !! 2)
                , Cm.name = fromSql (row !! 3)
                , Cm.email = fromSql (row !! 4)
            , P.summaryFormatted = undefined
            , P.format = undefined
            , P.timestamp = undefined
-           , P.comments_open = undefined
+           , P.commentsOpen = undefined
            }
 
 
       summaryFormatted :: LB.ByteString,
       format :: Format,
       timestamp :: Int,
-      comments_open :: Bool
+      commentsOpen :: Bool
     } deriving (Show, Eq, Data, Typeable)

src/Blog/Templates.hs

                                   , ("summary", ToSElemD $ P.summaryFormatted p)
                                   , ("full", ToSElemD $ P.postFormatted p)
                                   , ("url", ToSElemD $ postUrl p)
-                                  , ("commentsOpen", ToSElemD $ P.comments_open p)
+                                  , ("commentsOpen", ToSElemD $ P.commentsOpen p)
                                   , ("adminUrl", ToSElemD $ adminEditPostUrl p)
                                   ]
 
                               , P.summaryFormatted = fixCodes $ row !! 4
                               , P.format = Formats.Rawhtml
                               , P.timestamp = read (row !! 2)
-                              , P.comments_open = True
+                              , P.commentsOpen = True
                               }
           addFullText p = do let dataFile = Settings.old_data_path ++ "posts/" ++ (show $ P.uid p)
                              f <- readFile dataFile
 readComments = makeItems "comments.txt" mkComment
                >>= return . sortBy (comparing Cm.timestamp)
     where mkComment row = Cm.Comment { Cm.uid = read (row !! 0)
-                                     , Cm.post_id = read (row !! 1)
+                                     , Cm.postId = read (row !! 1)
                                      , Cm.timestamp = read (row !! 2)
                                      , Cm.name = fixCodes $ row !! 3
                                      , Cm.email = LB.pack $ row !! 4
               map (\(p_id, c_id) -> (fromJust $ Map.lookup p_id p_id_map,
                                      fromJust $ Map.lookup c_id c_id_map)) pcs
           correctCommentPostIds cms p_id_map =
-              map (\cm -> cm { Cm.post_id = fromJust $ Map.lookup (Cm.post_id cm) p_id_map }) cms
+              map (\cm -> cm { Cm.postId = fromJust $ Map.lookup (Cm.postId cm) p_id_map }) cms

src/templates/admin_post.st

     </td>
   </tr>
   <tr>
-    <td><label for="id_comments_open">Open for comments:</label></td>
+    <td><label for="id_commentsOpen">Open for comments:</label></td>
     <td>
-      <input type="checkbox" name="comments_open" $if(post.comments_open)$checked="checked"$endif$ >
+      <input type="checkbox" name="commentsOpen" $if(post.commentsOpen)$checked="checked"$endif$ >
     </td>
   </tr>
 </table>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.