2024-11-16 18:34:05 -06:00
|
|
|
module Pages.Arguments exposing (Model, Msg, page)
|
2024-11-12 19:23:16 -06:00
|
|
|
|
|
|
|
import Config.Colour as T exposing (..)
|
|
|
|
import Config.Format as O exposing (..)
|
|
|
|
import Config.Identity as I exposing (..)
|
2024-11-22 15:10:32 -06:00
|
|
|
import Debate.Arguments.Abortion exposing (..)
|
|
|
|
import Debate.Arguments.Agnosticism exposing (..)
|
|
|
|
import Debate.Arguments.AgriculturalPredation exposing (..)
|
|
|
|
import Debate.Arguments.AnabolicKeto exposing (..)
|
|
|
|
import Debate.Arguments.AnimalRights exposing (..)
|
|
|
|
import Debate.Arguments.AntagonisticPleiotropy exposing (..)
|
|
|
|
import Debate.Arguments.AntiRewilding exposing (..)
|
|
|
|
import Debate.Arguments.AntiVandalism exposing (..)
|
|
|
|
import Debate.Arguments.ApoBCVD exposing (..)
|
|
|
|
import Debate.Arguments.BoobyTrapPagers exposing (..)
|
|
|
|
import Debate.Arguments.CarbsObesity exposing (..)
|
|
|
|
import Debate.Arguments.ColonizingNature exposing (..)
|
|
|
|
import Debate.Arguments.CropDeaths exposing (..)
|
|
|
|
import Debate.Arguments.DairyCowRape exposing (..)
|
|
|
|
import Debate.Arguments.DietaryCholesterol exposing (..)
|
|
|
|
import Debate.Arguments.EfilismPatrolSquad exposing (..)
|
|
|
|
import Debate.Arguments.EpidemiologyCausality exposing (..)
|
|
|
|
import Debate.Arguments.EthicalSlurs exposing (..)
|
|
|
|
import Debate.Arguments.FineTuning exposing (..)
|
|
|
|
import Debate.Arguments.FlatEarthDebunk exposing (..)
|
|
|
|
import Debate.Arguments.FructoseNAFLD exposing (..)
|
|
|
|
import Debate.Arguments.HealthPromotingFoods exposing (..)
|
|
|
|
import Debate.Arguments.HealthSeeker exposing (..)
|
|
|
|
import Debate.Arguments.HealthyChocolate exposing (..)
|
|
|
|
import Debate.Arguments.HealthyDairy exposing (..)
|
|
|
|
import Debate.Arguments.HealthyFattyFish exposing (..)
|
|
|
|
import Debate.Arguments.HealthyFibre exposing (..)
|
|
|
|
import Debate.Arguments.HealthyFood exposing (..)
|
|
|
|
import Debate.Arguments.HealthyPlantFoods exposing (..)
|
|
|
|
import Debate.Arguments.HealthySeedOils exposing (..)
|
|
|
|
import Debate.Arguments.HealthySoy exposing (..)
|
|
|
|
import Debate.Arguments.ImmortalityReductio exposing (..)
|
|
|
|
import Debate.Arguments.Malondialdehyde exposing (..)
|
|
|
|
import Debate.Arguments.OddOrderPredators exposing (..)
|
|
|
|
import Debate.Arguments.Omega3Omega6Ratio exposing (..)
|
|
|
|
import Debate.Arguments.Ostroveganism exposing (..)
|
|
|
|
import Debate.Arguments.PlantBasedCVDReversal exposing (..)
|
|
|
|
import Debate.Arguments.PollinationReductio exposing (..)
|
|
|
|
import Debate.Arguments.PolyphenolReductio exposing (..)
|
|
|
|
import Debate.Arguments.ScratcherPioneers exposing (..)
|
|
|
|
import Debate.Arguments.SodiumCVD exposing (..)
|
|
|
|
import Debate.Arguments.TMAOCausality exposing (..)
|
|
|
|
import Debate.Arguments.TransPeople exposing (..)
|
|
|
|
import Debate.Arguments.TruncatedMeta exposing (..)
|
|
|
|
import Debate.Arguments.UnhealthyCoconutOil exposing (..)
|
|
|
|
import Debate.Arguments.UnhealthyProcessedMeat exposing (..)
|
|
|
|
import Debate.Arguments.UnhealthyRedMeat exposing (..)
|
|
|
|
import Debate.Arguments.UnhealthySaturatedFat exposing (..)
|
|
|
|
import Debate.Arguments.VeganSocietyReductio exposing (..)
|
2024-11-19 13:17:57 -06:00
|
|
|
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
|
2024-11-23 02:28:14 -06:00
|
|
|
import List.Extra as L exposing (..)
|
2024-11-12 19:23:16 -06:00
|
|
|
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 =
|
2024-11-23 02:28:14 -06:00
|
|
|
{ areArgsExpanded : List Bool }
|
2024-11-12 19:23:16 -06:00
|
|
|
|
|
|
|
|
|
|
|
init : () -> ( Model, Effect Msg )
|
|
|
|
init () =
|
2024-11-23 02:28:14 -06:00
|
|
|
( { areArgsExpanded =
|
|
|
|
[ False
|
|
|
|
, False
|
|
|
|
]
|
|
|
|
}
|
2024-11-12 19:23:16 -06:00
|
|
|
, Effect.none
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- UPDATE
|
|
|
|
|
|
|
|
|
|
|
|
type Msg
|
2024-11-23 02:28:14 -06:00
|
|
|
= ToggleExpandArg Int
|
2024-11-12 19:23:16 -06:00
|
|
|
|
|
|
|
|
|
|
|
update : Msg -> Model -> ( Model, Effect Msg )
|
|
|
|
update msg model =
|
|
|
|
case msg of
|
2024-11-23 02:28:14 -06:00
|
|
|
ToggleExpandArg index ->
|
|
|
|
( case getAt index model.areArgsExpanded of
|
|
|
|
Nothing ->
|
|
|
|
model
|
|
|
|
|
|
|
|
Just isExpanded ->
|
|
|
|
{ model | areArgsExpanded = setAt index (not isExpanded) model.areArgsExpanded }
|
2024-11-12 19:23:16 -06:00
|
|
|
, Effect.none
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- SUBSCRIPTIONS
|
|
|
|
|
|
|
|
|
|
|
|
subscriptions : Model -> Sub Msg
|
|
|
|
subscriptions model =
|
|
|
|
Sub.none
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- VIEW
|
|
|
|
|
|
|
|
|
|
|
|
view : Model -> View Msg
|
|
|
|
view model =
|
|
|
|
{ title = debateName
|
|
|
|
, attributes = []
|
2024-11-23 02:28:14 -06:00
|
|
|
, element = debateContainer model
|
2024-11-12 19:23:16 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-11-23 02:28:14 -06:00
|
|
|
debateContainer : Model -> Element Msg
|
|
|
|
debateContainer model =
|
|
|
|
topLevelContainer <| debateList model
|
2024-11-12 19:23:16 -06:00
|
|
|
|
|
|
|
|
2024-11-23 02:28:14 -06:00
|
|
|
debateList : Model -> Element Msg
|
|
|
|
debateList model =
|
2024-11-12 19:23:16 -06:00
|
|
|
column
|
|
|
|
pageList
|
2024-11-15 23:28:32 -06:00
|
|
|
<|
|
2024-11-23 02:28:14 -06:00
|
|
|
List.map2 (argumentMaker ToggleExpandArg model.areArgsExpanded)
|
2024-11-22 15:10:32 -06:00
|
|
|
[ argumentApoBCVD
|
|
|
|
, argumentAnabolicKeto
|
2024-11-12 19:23:16 -06:00
|
|
|
]
|
2024-11-23 02:28:14 -06:00
|
|
|
<|
|
|
|
|
List.range 0 <|
|
|
|
|
List.length model.areArgsExpanded
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- , argumentAntagonisticPleiotropy
|
|
|
|
-- , argumentCarbsObesity
|
|
|
|
-- , argumentDietaryCholesterol
|
|
|
|
-- , argumentFructoseNAFLD
|
|
|
|
-- , argumentHealthPromotingFoods
|
|
|
|
-- , argumentHealthSeeker
|
|
|
|
-- , argumentHealthyChocolate
|
|
|
|
-- , argumentHealthyDairy
|
|
|
|
-- , argumentHealthyFattyFish
|
|
|
|
-- , argumentHealthyFibre
|
|
|
|
-- , argumentHealthyFood
|
|
|
|
-- , argumentHealthyPlantFoods
|
|
|
|
-- , argumentHealthySeedOils
|
|
|
|
-- , argumentHealthySoy
|
|
|
|
-- , argumentMalondialdehyde
|
|
|
|
-- , argumentOmega3Omega6Ratio
|
|
|
|
-- , argumentPlantBasedCVDReversal
|
|
|
|
-- , argumentPolyphenolReductio
|
|
|
|
-- , argumentSodiumCVD
|
|
|
|
-- , argumentTMAOCausality
|
|
|
|
-- , argumentUnhealthyCoconutOil
|
|
|
|
-- , argumentUnhealthyProcessedMeat
|
|
|
|
-- , argumentUnhealthyRedMeat
|
|
|
|
-- , argumentUnhealthySaturatedFat
|
|
|
|
-- , argumentAbortion
|
|
|
|
-- , argumentAgnosticism
|
|
|
|
-- , argumentAgriculturalPredation
|
|
|
|
-- , argumentAnimalRights
|
|
|
|
-- , argumentAntiRewilding
|
|
|
|
-- , argumentAntiVandalism
|
|
|
|
-- , argumentColonizingNature
|
|
|
|
-- , argumentCropDeaths
|
|
|
|
-- , argumentDairyCowRape
|
|
|
|
-- , argumentEfilismPatrolSquad
|
|
|
|
-- , argumentEthicalSlurs
|
|
|
|
-- , argumentFineTuning
|
|
|
|
-- , argumentImmortalityReductio
|
|
|
|
-- , argumentOddOrderPredators
|
|
|
|
-- , argumentOstroveganism
|
|
|
|
-- , argumentPollinationReductio
|
|
|
|
-- , argumentScratcherPioneers
|
|
|
|
-- , argumentTransPeople
|
|
|
|
-- , argumentVeganSocietyReductio
|
|
|
|
-- , argumentBoobyTrapPagers
|
|
|
|
-- , argumentEpidemiologyCausality
|
|
|
|
-- , argumentFlatEarthDebunk
|
|
|
|
-- , argumentTruncatedMeta
|