Fix links, change sort, add Utils

This commit is contained in:
3wc
2021-04-24 15:36:56 +02:00
parent c5cb5ee8c2
commit d6d420ae87
3 changed files with 64 additions and 10 deletions

View File

@ -63,7 +63,7 @@ init url =
default_image : String
-- FIXME: change to absolute URL, if this works?
default_image = "http://localhost:8000/logo.png"
default_image = "/logo.png"
-- UPDATE
@ -146,9 +146,11 @@ body model =
div [ class "pt-3" ]
[ case model.status of
Failure ->
div [ ]
[ text "I could not load a random cat for some reason. "
, button [ onClick MorePlease ] [ text "Try Again!" ]
div []
[ div [ class "alert alert-danger" ]
[ p [] [ text "Unable to load app data" ]
, button [ class "btn btn-danger", onClick MorePlease ] [ text "Try Again!" ]
]
]
Loading ->
@ -242,7 +244,7 @@ loadApp =
-- fetch app JSON and README in parallel
Http.get
-- FIXME: change to absolute URL, if this works?
{ url = "http://localhost:8000/abra-apps-list.json"
{ url = "/abra-apps-list.json"
, expect = Http.expectJson GotApps appListDecoder }
@ -259,7 +261,7 @@ loadREADME app =
text ""
in
Http.get
-- FIXME add branch name to apps.json, load actual README
-- FIXME use live Gitea link
{ url = "http://localhost:1234/coop-cloud/" ++ app.slug ++ "/raw/branch/" ++ app.default_branch ++ "/README.md"
, expect = Http.expectString GotText }