website/frontend/src/Pages/Blog/Seedoils.elm

115 lines
2.2 KiB
Elm
Raw Normal View History

2024-12-16 00:12:23 -06:00
module Pages.Blog.Seedoils exposing (Model, Msg, page)
2024-12-09 19:53:09 -06:00
import Config.Data.Identity exposing (pageNames)
2024-12-18 20:11:04 -06:00
import Config.Helpers.Articles.Article exposing (articleMaker)
2024-12-18 20:11:04 -06:00
import Config.Helpers.Headers.Header exposing (headerMaker)
import Config.Helpers.Headers.Types exposing (Header)
2024-12-11 03:48:49 -06:00
import Config.Helpers.Response
2024-12-09 19:53:09 -06:00
exposing
2024-12-09 20:30:04 -06:00
( pageList
2024-12-09 19:53:09 -06:00
, topLevelContainer
)
import Config.Helpers.Viewport exposing (resetViewport)
2024-12-16 00:12:23 -06:00
import Config.Pages.Blog.Records.SeedOils exposing (articleSeedOils)
import Effect exposing (Effect)
2024-12-09 19:53:09 -06:00
import Element as E exposing (..)
import Layouts
import Page exposing (Page)
import Route exposing (Route)
import Shared exposing (..)
import View exposing (View)
2024-12-08 21:35:48 -06:00
page : Shared.Model -> Route () -> Page Model Msg
page shared route =
Page.new
{ init = init
, update = update
, subscriptions = subscriptions
2024-12-08 21:35:48 -06:00
, view = view shared
}
2024-12-01 02:56:13 -06:00
|> Page.withLayout toLayout
toLayout : Model -> Layouts.Layout Msg
toLayout model =
2024-12-06 22:03:24 -06:00
Layouts.Navbar {}
-- INIT
type alias Model =
{}
init : () -> ( Model, Effect Msg )
init () =
( {}
2024-12-18 20:11:04 -06:00
, Effect.map
(\_ -> NoOp)
(Effect.sendCmd resetViewport)
)
-- UPDATE
type Msg
= NoOp
update : Msg -> Model -> ( Model, Effect Msg )
update msg model =
case msg of
NoOp ->
( model
, Effect.none
)
-- SUBSCRIPTIONS
subscriptions : Model -> Sub Msg
subscriptions model =
Sub.none
-- VIEW
2024-12-08 21:35:48 -06:00
view : Shared.Model -> Model -> View Msg
view shared model =
2024-12-17 02:17:06 -06:00
{ title = pageNames.pageHyperBlog ++ " (seedOils)"
2024-12-01 02:56:13 -06:00
, attributes = []
2024-12-16 00:12:23 -06:00
, element = articleContainer shared.device
2024-12-01 02:56:13 -06:00
}
2024-12-08 21:35:48 -06:00
2024-12-16 00:12:23 -06:00
articleContainer : Device -> Element msg
articleContainer device =
topLevelContainer (articleList device)
2024-12-08 21:35:48 -06:00
2024-12-16 00:12:23 -06:00
articleList : Device -> Element msg
articleList device =
2024-12-17 02:17:06 -06:00
column
(case ( device.class, device.orientation ) of
_ ->
pageList
)
<|
2024-12-08 21:35:48 -06:00
List.concat
2024-12-17 02:17:06 -06:00
[ (case ( device.class, device.orientation ) of
2024-12-08 21:35:48 -06:00
_ ->
List.map (articleMaker device)
2024-12-17 02:17:06 -06:00
)
[ articleSeedOils ]
]