Add part7

This commit is contained in:
Richard Feldman
2018-05-05 04:54:47 -04:00
parent f6bef58e3d
commit 825dea437b
575 changed files with 79140 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
module Page.Errored exposing (PageLoadError, pageLoadError, view)
{-| The page that renders when there was an error trying to load another page,
for example a Page Not Found error.
It includes a photo I took of a painting on a building in San Francisco,
of a giant walrus exploding the golden gate bridge with laser beams. Pew pew!
-}
import Data.Session exposing (Session)
import Html exposing (Html, div, h1, img, main_, p, text)
import Html.Attributes exposing (alt, class, id, tabindex)
import Views.Page exposing (ActivePage)
-- MODEL --
type PageLoadError
= PageLoadError Model
type alias Model =
{ activePage : ActivePage
, errorMessage : String
}
pageLoadError : ActivePage -> String -> PageLoadError
pageLoadError activePage errorMessage =
PageLoadError { activePage = activePage, errorMessage = errorMessage }
-- VIEW --
view : Session -> PageLoadError -> Html msg
view session (PageLoadError model) =
main_ [ id "content", class "container", tabindex -1 ]
[ h1 [] [ text "Error Loading Page" ]
, div [ class "row" ]
[ p [] [ text model.errorMessage ] ]
]