Get ready to have file details in CatalogGrid
- update posts type (new fields not yet used)
This commit is contained in:
parent
75024b1fd0
commit
0a75e96f27
|
@ -1 +1 @@
|
|||
Subproject commit a5d90ea96195ed6a5a7e3196d5b0e32b65af5058
|
||||
Subproject commit 9e9d7babe6352b2fdf19d4ab43a557c71ca2e2ff
|
|
@ -13,15 +13,15 @@ import Data.List (intercalate)
|
|||
import Data.Maybe (maybeToList)
|
||||
import Data.JSString (append)
|
||||
import Miso
|
||||
( View , div_ , class_ , img_ , href_ , a_
|
||||
, src_ , alt_ , title_ , strong_ , span_
|
||||
, p_ , br_ , id_ , Effect , noEff
|
||||
, text, rawHtml
|
||||
( View, div_ , class_ , img_ , href_ , a_
|
||||
, src_ , title_ , strong_ , span_
|
||||
, p_ , br_ , id_ , Effect , noEff, width_
|
||||
, height_, text, rawHtml
|
||||
)
|
||||
import Miso.String (toMisoString, MisoString)
|
||||
|
||||
import Network.CatalogPostType (CatalogPost)
|
||||
import qualified Network.CatalogPostType as CatalogPost
|
||||
import Miso.String (toMisoString, MisoString)
|
||||
|
||||
data Model = Model
|
||||
{ displayItems :: [ CatalogPost ]
|
||||
|
@ -43,7 +43,7 @@ update
|
|||
-> Model
|
||||
-> Effect a Model
|
||||
update _ (DisplayItems xs) m = noEff (m { displayItems = xs })
|
||||
update _ _ m = noEff m
|
||||
-- update _ _ m = noEff m
|
||||
|
||||
view :: Interface a -> Model -> View a
|
||||
view iface model =
|
||||
|
@ -68,7 +68,6 @@ gridItem post =
|
|||
[ img_
|
||||
[ class_ "thread-image"
|
||||
, src_ "/a/thumb/1111111111111.png"
|
||||
, alt_ "Opening post image"
|
||||
, title_ ( toMisoString $ show $ CatalogPost.bump_time post )
|
||||
]
|
||||
]
|
||||
|
@ -79,7 +78,8 @@ gridItem post =
|
|||
, p_
|
||||
[ class_ "intro" ]
|
||||
[ span_
|
||||
[ class_ "subject" ]subject
|
||||
[ class_ "subject" ]
|
||||
subject
|
||||
]
|
||||
] ++ body
|
||||
)
|
||||
|
|
|
@ -10,21 +10,27 @@ import Data.Aeson (FromJSON, ToJSON)
|
|||
import Data.Time.Clock (UTCTime) -- Required for timestamp with time zone
|
||||
import Data.Int (Int64)
|
||||
import Data.Text (Text)
|
||||
-- import Common.AttachmentType (Dimension)
|
||||
|
||||
data CatalogPost = CatalogPost
|
||||
{ post_id :: Maybe Int64
|
||||
, board_post_id :: Int64
|
||||
, board_thread_id :: Int64
|
||||
, creation_time :: UTCTime
|
||||
, bump_time :: UTCTime
|
||||
, body :: Maybe Text
|
||||
, name :: Maybe Text
|
||||
, subject :: Maybe Text
|
||||
, email :: Maybe Text
|
||||
, thread_id :: Int
|
||||
-- , post_count :: Int
|
||||
{ post_id :: Maybe Int64
|
||||
, board_post_id :: Int64
|
||||
, board_thread_id :: Int64
|
||||
, creation_time :: UTCTime
|
||||
, bump_time :: UTCTime
|
||||
, body :: Maybe Text
|
||||
, name :: Maybe Text
|
||||
, subject :: Maybe Text
|
||||
, email :: Maybe Text
|
||||
, thread_id :: Int
|
||||
-- , post_count :: Int
|
||||
, estimated_post_count :: Int
|
||||
, site_name :: String
|
||||
, pathpart :: String
|
||||
--, site_id :: Int
|
||||
, site_name :: String
|
||||
, pathpart :: String
|
||||
-- , site_id :: Int
|
||||
, file_mimetype :: Maybe Text
|
||||
, file_illegal :: Maybe Bool
|
||||
-- , file_resolution :: Maybe Dimension
|
||||
, file_sha256_hash :: Maybe Text
|
||||
, file_extension :: Maybe Text
|
||||
} deriving (Show, Generic, FromJSON, ToJSON, Eq)
|
||||
|
|
|
@ -30,6 +30,8 @@ import GHCJS.DOM.Types (XMLHttpRequest, JSString)
|
|||
import Data.JSString.Text (textToJSString)
|
||||
import GHCJS.DOM.EventM (onAsync)
|
||||
import GHCJS.DOM.XMLHttpRequestEventTarget (load, abortEvent, error)
|
||||
import GHCJS.DOM.Types (toJSString)
|
||||
import Miso (consoleLog)
|
||||
|
||||
data HttpMethod = GET | PUT | POST | DELETE | PATCH
|
||||
deriving Show
|
||||
|
@ -68,7 +70,9 @@ mkResult xhr = do
|
|||
Just bs -> do
|
||||
let parse_result = eitherDecodeStrict bs
|
||||
case parse_result of
|
||||
Left _ -> return Error
|
||||
Left err -> do
|
||||
consoleLog $ toJSString $ show err
|
||||
return Error
|
||||
Right x -> return HttpResponse
|
||||
{ status_code = status_code_int
|
||||
, status_text = st
|
||||
|
|
|
@ -30,6 +30,7 @@ html, body {
|
|||
.post-image{
|
||||
max-width: 94%!important;
|
||||
}
|
||||
|
||||
select{
|
||||
float:right;
|
||||
}
|
||||
|
@ -47,7 +48,6 @@ div.boardlist.bottom {
|
|||
}
|
||||
|
||||
img.banner, img.board_image {
|
||||
|
||||
max-width: 100vw;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue