2017-07-17 09:25:57 +00:00
|
|
|
module Models exposing (..)
|
|
|
|
|
2017-07-23 00:51:39 +00:00
|
|
|
-- Core modules
|
|
|
|
|
2017-07-17 19:48:56 +00:00
|
|
|
import Date exposing (Date, now)
|
|
|
|
|
2017-07-17 09:25:57 +00:00
|
|
|
|
2017-07-23 00:51:39 +00:00
|
|
|
-- External modules
|
|
|
|
|
|
|
|
import Navigation exposing (Location)
|
|
|
|
|
|
|
|
|
2017-07-17 09:25:57 +00:00
|
|
|
type Route
|
|
|
|
= OverviewRoute
|
2017-07-23 00:51:39 +00:00
|
|
|
| OverviewFilteredRoute String
|
2017-07-17 19:48:56 +00:00
|
|
|
| DayRoute String
|
2017-07-17 14:05:38 +00:00
|
|
|
| EventRoute EventSlug
|
2017-07-17 09:25:57 +00:00
|
|
|
| NotFoundRoute
|
|
|
|
|
|
|
|
|
|
|
|
type alias Model =
|
|
|
|
{ days : List Day
|
2017-07-18 09:26:56 +00:00
|
|
|
, events : List Event
|
2017-07-17 09:25:57 +00:00
|
|
|
, eventInstances : List EventInstance
|
|
|
|
, eventLocations : List EventLocation
|
|
|
|
, eventTypes : List EventType
|
|
|
|
, flags : Flags
|
|
|
|
, filter : Filter
|
2017-07-23 00:51:39 +00:00
|
|
|
, location : Location
|
2017-07-17 09:25:57 +00:00
|
|
|
, route : Route
|
2017-07-23 16:30:27 +00:00
|
|
|
, dataLoaded : Bool
|
2017-07-17 09:25:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type alias Filter =
|
|
|
|
{ eventTypes : List EventType
|
|
|
|
, eventLocations : List EventLocation
|
2017-07-23 00:51:39 +00:00
|
|
|
, videoRecording : List { name : String, slug : String, filter : EventInstance -> Bool }
|
2017-07-17 09:25:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type alias Day =
|
|
|
|
{ day_name : String
|
2017-07-17 19:48:56 +00:00
|
|
|
, date : Date
|
2017-07-17 09:25:57 +00:00
|
|
|
, repr : String
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type alias Speaker =
|
|
|
|
{ name : String
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type alias EventSlug =
|
|
|
|
String
|
|
|
|
|
|
|
|
|
|
|
|
type alias EventInstanceSlug =
|
|
|
|
String
|
|
|
|
|
|
|
|
|
|
|
|
type alias EventInstance =
|
|
|
|
{ title : String
|
|
|
|
, slug : EventInstanceSlug
|
|
|
|
, id : Int
|
|
|
|
, url : String
|
|
|
|
, eventSlug : EventSlug
|
|
|
|
, eventType : String
|
|
|
|
, backgroundColor : String
|
|
|
|
, forgroundColor : String
|
2017-07-17 19:48:56 +00:00
|
|
|
, from : Date
|
|
|
|
, to : Date
|
2017-07-17 09:25:57 +00:00
|
|
|
, timeslots : Float
|
|
|
|
, location : String
|
|
|
|
, locationIcon : String
|
|
|
|
, videoRecording : Bool
|
|
|
|
, videoUrl : String
|
2017-07-27 21:21:16 +00:00
|
|
|
, isFavorited : Maybe Bool
|
2017-07-17 09:25:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type alias Event =
|
|
|
|
{ title : String
|
|
|
|
, slug : EventSlug
|
|
|
|
, abstract : String
|
|
|
|
, speakers : List Speaker
|
2017-07-18 11:35:17 +00:00
|
|
|
, videoRecording : Bool
|
|
|
|
, videoUrl : String
|
2017-07-27 21:21:16 +00:00
|
|
|
, eventType : String
|
2017-07-17 09:25:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type alias EventLocation =
|
|
|
|
{ name : String
|
|
|
|
, slug : String
|
|
|
|
, icon : String
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type alias EventType =
|
|
|
|
{ name : String
|
|
|
|
, slug : String
|
|
|
|
, color : String
|
|
|
|
, lightText : Bool
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type alias Flags =
|
|
|
|
{ schedule_timeslot_length_minutes : Int
|
|
|
|
, schedule_midnight_offset_hours : Int
|
|
|
|
, ics_button_href : String
|
|
|
|
, camp_slug : String
|
2017-07-20 09:18:14 +00:00
|
|
|
, websocket_server : String
|
2017-07-17 09:25:57 +00:00
|
|
|
}
|