website/frontend/src/Pages/Debate.elm

113 lines
2 KiB
Elm
Raw Normal View History

2024-11-12 19:23:16 -06:00
module Pages.Debate exposing (Model, Msg, page)
import Config.Colour as T exposing (..)
import Config.Format as O exposing (..)
import Config.Identity as I exposing (..)
2024-11-15 23:28:32 -06:00
import Debate.Arguments.Ethics.EthicalSlurs exposing (..)
import Debate.Helpers exposing (..)
2024-11-12 19:23:16 -06:00
import Effect exposing (Effect)
import Element exposing (..)
import Element.Border as D exposing (..)
import Element.Font as F
import Html
import Html.Attributes as H exposing (style, title, wrap)
import Layouts
import Page exposing (Page)
import Route exposing (Route)
import Shared
import View exposing (View)
page : Shared.Model -> Route () -> Page Model Msg
page shared route =
Page.new
{ init = init
, update = update
, subscriptions = subscriptions
, view = view
}
|> Page.withLayout toLayout
toLayout : Model -> Layouts.Layout Msg
toLayout model =
Layouts.Navbar {}
-- INIT
type alias Model =
{}
init : () -> ( Model, Effect Msg )
init () =
( {}
, Effect.none
)
-- 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 : Model -> View Msg
view model =
{ title = debateName
, attributes = []
, element = debateContainer
}
debateContainer : Element msg
debateContainer =
topLevelContainer debateList
debateList : Element msg
debateList =
column
pageList
2024-11-15 23:28:32 -06:00
<|
List.map
(\category ->
column [ spacing 20 ]
[ el (nonHighlightedTitleFormat ++ [ centerX ]) (text category.categoryName)
, column [] (List.map argumentMaker category.arguments)
]
)
[ { categoryName = "Ethics"
, arguments =
2024-11-16 16:35:08 -06:00
[ argumentEthicalSlurs
2024-11-12 19:23:16 -06:00
]
2024-11-15 23:28:32 -06:00
}
2024-11-12 19:23:16 -06:00
]