Move static information to HTML template
This commit is contained in:
@ -1,14 +1,4 @@
|
||||
module Data exposing (Provider(..), Url, hostname, pathSeparator, repository, servicename, toUrl)
|
||||
|
||||
|
||||
repository : String
|
||||
repository =
|
||||
"https://git.vbrandl.net/vbrandl/gitache"
|
||||
|
||||
|
||||
servicename : String
|
||||
servicename =
|
||||
"GitCDN"
|
||||
module Data exposing (Provider(..), Url, hostname, pathSeparator, toUrl)
|
||||
|
||||
|
||||
hostname : String
|
||||
|
@ -8,24 +8,9 @@ module Main exposing
|
||||
)
|
||||
|
||||
import Browser
|
||||
import Data exposing (Url, hostname, repository, servicename, toUrl)
|
||||
import Html
|
||||
exposing
|
||||
( Html
|
||||
, a
|
||||
, article
|
||||
, h1
|
||||
, h2
|
||||
, input
|
||||
, li
|
||||
, nav
|
||||
, p
|
||||
, section
|
||||
, small
|
||||
, text
|
||||
, ul
|
||||
)
|
||||
import Html.Attributes exposing (href, placeholder, readonly, style, value)
|
||||
import Data exposing (Url, hostname, toUrl)
|
||||
import Html exposing (Html, div, input)
|
||||
import Html.Attributes exposing (placeholder, readonly, style, value)
|
||||
import Html.Events exposing (onInput)
|
||||
import Parse exposing (parseUrl)
|
||||
|
||||
@ -73,80 +58,13 @@ myStyle2 =
|
||||
|
||||
view : Model -> Html Msg
|
||||
view state =
|
||||
section myStyle
|
||||
[ header
|
||||
, body state
|
||||
, footer
|
||||
]
|
||||
|
||||
|
||||
header : Html msg
|
||||
header =
|
||||
Html.header []
|
||||
[ h1 myStyle [ text servicename ]
|
||||
]
|
||||
|
||||
|
||||
footer : Html msg
|
||||
footer =
|
||||
Html.footer myStyle
|
||||
[ nav []
|
||||
[ ul []
|
||||
[ li []
|
||||
[ small []
|
||||
[ text "Created by "
|
||||
, a [ href "https://www.vbrandl.net/" ]
|
||||
[ text "Valentin Brandl" ]
|
||||
, text "."
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
, nav []
|
||||
[ ul []
|
||||
[ li []
|
||||
[ small []
|
||||
[ a [ href repository ]
|
||||
[ text "Repository" ]
|
||||
]
|
||||
]
|
||||
, li []
|
||||
[ small []
|
||||
[ a [ href "https://opensource.org/licenses/MIT" ]
|
||||
[ text "MIT License" ]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
body : Model -> Html Msg
|
||||
body state =
|
||||
article myStyle
|
||||
div myStyle
|
||||
[ input (myStyle2 [ placeholder "GitHub/GitLab/Bitbucket URL", value state.url, onInput UrlChange ])
|
||||
[]
|
||||
, input (myStyle2 [ readonly True, value (displayMUrl state.parsed) ]) []
|
||||
, h2 myStyle
|
||||
[ text "Caching" ]
|
||||
, p myStyle
|
||||
[ text "Files are cached in the CDN for about one year." ]
|
||||
, p myStyle
|
||||
[ text "Redirects for tags and branches are cached for 5 minutes." ]
|
||||
, h2 myStyle
|
||||
[ text "Invalidating the Cache" ]
|
||||
, p myStyle
|
||||
[ text "To delete a file from the cache, just request the file via HTTP "
|
||||
, code "DELETE"
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
code : String -> Html msg
|
||||
code msg =
|
||||
Html.code [] [ text msg ]
|
||||
|
||||
|
||||
main : Program () Model Msg
|
||||
main =
|
||||
Browser.sandbox
|
||||
|
Reference in New Issue
Block a user