2024-12-17 19:50:50 -06:00
|
|
|
module Pages.Blog.Everettvegans exposing (Model, Msg, page)
|
|
|
|
|
|
|
|
import Config.Data.Identity exposing (pageNames)
|
2024-12-21 23:23:59 -06:00
|
|
|
import Config.Helpers.Articles.Article exposing (contentList)
|
2024-12-27 01:30:21 -06:00
|
|
|
import Config.Helpers.Cards.Outer.Helpers exposing (cardMaker)
|
|
|
|
import Config.Helpers.Cards.Outer.Types as C
|
2024-12-18 20:11:04 -06:00
|
|
|
import Config.Helpers.Headers.Types exposing (Header)
|
2024-12-17 19:50:50 -06:00
|
|
|
import Config.Helpers.Response
|
|
|
|
exposing
|
|
|
|
( pageList
|
|
|
|
, topLevelContainer
|
|
|
|
)
|
|
|
|
import Config.Helpers.Viewport exposing (resetViewport)
|
|
|
|
import Config.Pages.Blog.Records.EverettVegans exposing (articleEverettVegans)
|
|
|
|
import Effect exposing (Effect)
|
|
|
|
import Element as E exposing (..)
|
|
|
|
import Layouts
|
|
|
|
import Page exposing (Page)
|
|
|
|
import Route exposing (Route)
|
|
|
|
import Shared exposing (..)
|
|
|
|
import View exposing (View)
|
|
|
|
|
|
|
|
|
|
|
|
page : Shared.Model -> Route () -> Page Model Msg
|
|
|
|
page shared route =
|
|
|
|
Page.new
|
|
|
|
{ init = init
|
|
|
|
, update = update
|
|
|
|
, subscriptions = subscriptions
|
|
|
|
, view = view shared
|
|
|
|
}
|
|
|
|
|> Page.withLayout toLayout
|
|
|
|
|
|
|
|
|
|
|
|
toLayout : Model -> Layouts.Layout Msg
|
|
|
|
toLayout model =
|
|
|
|
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)
|
2024-12-17 19:50:50 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
-- 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
|
|
|
|
|
|
|
|
|
|
|
|
view : Shared.Model -> Model -> View Msg
|
|
|
|
view shared model =
|
2024-12-18 02:04:31 -06:00
|
|
|
{ title = pageNames.pageHyperBlog ++ " (everettVegans)"
|
2024-12-17 19:50:50 -06:00
|
|
|
, attributes = []
|
|
|
|
, element = articleContainer shared.device
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
articleContainer : Device -> Element msg
|
|
|
|
articleContainer device =
|
|
|
|
topLevelContainer (articleList device)
|
|
|
|
|
|
|
|
|
|
|
|
articleList : Device -> Element msg
|
|
|
|
articleList device =
|
|
|
|
column
|
|
|
|
(case ( device.class, device.orientation ) of
|
|
|
|
_ ->
|
2024-12-22 19:42:23 -06:00
|
|
|
pageList device
|
2024-12-17 19:50:50 -06:00
|
|
|
)
|
|
|
|
<|
|
|
|
|
List.concat
|
2024-12-21 23:23:59 -06:00
|
|
|
[ -- List.map (headerMaker device)
|
|
|
|
-- [
|
|
|
|
-- servicesHeader
|
|
|
|
-- ]
|
|
|
|
-- ,
|
|
|
|
List.map
|
|
|
|
(\article ->
|
2024-12-28 18:42:47 -06:00
|
|
|
cardMaker device (C.BlogArticle article) (contentList article [])
|
2024-12-21 23:23:59 -06:00
|
|
|
)
|
2024-12-17 19:50:50 -06:00
|
|
|
[ articleEverettVegans ]
|
|
|
|
]
|