Use the real apps.json format

Re #2
This commit is contained in:
3wc 2021-04-25 15:25:25 +02:00
parent dd00190dc3
commit 804829f6f3
4 changed files with 162 additions and 1808 deletions

File diff suppressed because it is too large Load Diff

View File

@ -4,16 +4,16 @@
"category": "",
"repository": "https://git.autonomic.zone/coop-cloud/workadventure.git",
"default_branch": "main",
"description": "A collaborative web application (virtual office) presented as a 16-bit RPG video game • https://github.com/thecodingmachine/workadventure",
"website": "",
"description": "A collaborative web application (virtual office) presented as a 16-bit RPG video game",
"website": "https://github.com/thecodingmachine/workadventure",
"features": {},
"versions": {},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/216-026252fa27a35dd45297be91be3608a7"
},
"renovate-bot": {
"name": "Renovate Bot",
"category": "Development",
"repository": "",
"repository": "https://git.autonomic.zone/coop-cloud/renovate-bot.git",
"default_branch": "",
"description": "",
"website": "",
@ -48,7 +48,7 @@
"repository": "https://git.autonomic.zone/coop-cloud/drone.git",
"default_branch": "master",
"description": "Self-service Continuous Delivery platform",
"website": "",
"website": "https://github.com/drone/drone",
"features": {
"category": "Development",
"status": "?",
@ -72,15 +72,15 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/79-afe617425a579f946049e1537b6e55ea"
},
"kutt": {
"name": "Kutt",
"category": "Apps",
"repository": "https://git.autonomic.zone/coop-cloud/kutt.git",
"default_branch": "main",
"description": "Free Modern URL Shortener • https://github.com/thedevs-network/kutt",
"website": "",
"description": "Free Modern URL Shortener",
"website": "https://github.com/thedevs-network/kutt",
"features": {
"category": "Apps",
"status": "❸🍎",
@ -114,15 +114,15 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/164-4659ecee09385b430bc0b9f5f178e9d6"
},
"pelican": {
"name": "Pelican",
"category": "Apps",
"repository": "https://git.autonomic.zone/coop-cloud/pelican.git",
"default_branch": "main",
"description": " Static site generator • https://github.com/getpelican/pelican/",
"website": "",
"description": " Static site generator",
"website": "https://github.com/getpelican/pelican/",
"features": {
"category": "Apps",
"status": "❷💛",
@ -151,15 +151,15 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/142-741e890256209ea86a4540c170e6f7e7"
},
"phpservermon": {
"name": "PHPServerMon",
"category": "Graveyard",
"repository": "https://git.autonomic.zone/coop-cloud/phpservermon.git",
"default_branch": "main",
"description": "Server monitor • https://github.com/phpservermon/phpservermon",
"website": "",
"description": "Server monitor",
"website": "https://github.com/phpservermon/phpservermon",
"features": {
"category": "Graveyard",
"status": "❹💣",
@ -195,8 +195,8 @@
"category": "App",
"repository": "https://git.autonomic.zone/coop-cloud/osticket.git",
"default_branch": "main",
"description": "",
"website": "",
"description": "Open source ticketing system",
"website": "https://github.com/osTicket/osTicket",
"features": {
"category": "App",
"status": "❹💣",
@ -212,15 +212,15 @@
"tests": ""
},
"versions": {},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/209-c4305ac069e3834fa1b45128c4087485"
},
"adapt_authoring": {
"name": "Adapt Authoring Tool",
"category": "Apps",
"repository": "https://git.autonomic.zone/coop-cloud/adapt_authoring.git",
"default_branch": "main",
"description": "User interface for authoring eLearning courses using the Adapt framework • https://github.com/adaptlearning/adapt_authoring",
"website": "",
"description": "User interface for authoring eLearning courses using the Adapt framework",
"website": "https://github.com/adaptlearning/adapt_authoring",
"features": {
"category": "Apps",
"status": "❸🍎",
@ -261,15 +261,15 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/131-d4307a953c8e5c84f59286d6ba82eda7"
},
"selfoss": {
"name": "Selfoss",
"category": "Apps",
"repository": "https://git.autonomic.zone/coop-cloud/selfoss.git",
"default_branch": "main",
"description": "The multipurpose rss reader, live stream, mashup, aggregation web application • https://selfoss.aditu.de/",
"website": "",
"description": "The multipurpose rss reader, live stream, mashup, aggregation web application",
"website": "https://selfoss.aditu.de/",
"features": {
"category": "Apps",
"status": "❸🍎",
@ -298,7 +298,7 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/118-ba1aa91d110e9095652d68cd37b267c0"
},
"gitea": {
"name": "Gitea",
@ -381,6 +381,18 @@
"tag": "10.5",
"digest": "9c681cef"
}
},
"ls": {
"app": {
"image": "gitea/gitea",
"tag": "1.14.1-rootless",
"digest": "6244e9fc"
},
"db": {
"image": "mariadb",
"tag": "10.5",
"digest": "36288c67"
}
}
},
"icon": "https://git.autonomic.zone/repo-avatars/75-2b3abe26c149aeace0b8834c09345d91"
@ -391,7 +403,7 @@
"repository": "https://git.autonomic.zone/coop-cloud/mediawiki.git",
"default_branch": "main",
"description": "The collaborative editing software that runs Wikipedia",
"website": "",
"website": "https://gerrit.wikimedia.org/g/mediawiki/core",
"features": {
"category": "Apps",
"status": "❸🍎",
@ -452,15 +464,15 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/106-edbae2382ae756c2d3e4bed2bee8a0a4"
},
"swarmpit": {
"name": "Swarmpit",
"category": "Utilities",
"repository": "https://git.autonomic.zone/coop-cloud/swarmpit.git",
"default_branch": "main",
"description": "Lightweight mobile-friendly Docker Swarm management UI • https://swarmpit.io",
"website": "",
"description": "Lightweight mobile-friendly Docker Swarm management UI",
"website": "https://swarmpit.io",
"features": {
"category": "Utilities",
"status": "❷💛",
@ -499,15 +511,15 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/110-0e3fc70194d15a6016a9bd47f3d22fdb"
},
"rocketchat": {
"name": "Rocket.chat",
"category": "Apps",
"repository": "https://git.autonomic.zone/coop-cloud/rocketchat.git",
"default_branch": "main",
"description": "The ultimate Free Open Source Solution for team communications • https://github.com/RocketChat/Rocket.Chat",
"website": "",
"description": "The ultimate Free Open Source Solution for team communications",
"website": "https://github.com/RocketChat/Rocket.Chat",
"features": {
"category": "Apps",
"status": "❷💛",
@ -575,7 +587,7 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/122-8b5e6496337dc3d6ac55cab7eb82c862"
},
"matrix-synapse": {
"name": "Matrix (Synapse)",
@ -583,7 +595,7 @@
"repository": "https://git.autonomic.zone/coop-cloud/matrix-synapse.git",
"default_branch": "main",
"description": "Open, interoperable, decentralised real-time communication reference Matrix homeserver",
"website": "",
"website": "https://github.com/matrix-org/synapse/",
"features": {
"category": "Apps",
"status": "❹💣",
@ -607,15 +619,15 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/109-71d1b483b01101c87e48bf1ea5ee24d5"
},
"traefik": {
"name": "Traefik",
"category": "Utilities",
"repository": "https://git.autonomic.zone/coop-cloud/traefik.git",
"default_branch": "master",
"description": "Edge router that makes publishing your services a fun and easy experience • https://github.com/traefik/traefik",
"website": "",
"description": "Edge router that makes publishing your services a fun and easy experience",
"website": "https://github.com/traefik/traefik",
"features": {
"category": "Utilities",
"status": "?",
@ -639,15 +651,15 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/76-2677dfde60e1666d8665d2a045918d2e"
},
"strapi": {
"name": "Strapi",
"category": "Development",
"repository": "https://git.autonomic.zone/coop-cloud/strapi.git",
"default_branch": "main",
"description": "Open source Node.js Headless CMS to easily build customisable APIs • https://github.com/strapi/strapi",
"website": "",
"description": "Open source Node.js Headless CMS to easily build customisable APIs",
"website": "https://github.com/strapi/strapi",
"features": {
"category": "Development",
"status": "❸🍎",
@ -676,15 +688,15 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/130-f4cdbe10a84d2fa9025f800c3467bf3e"
},
"statuspal": {
"name": "Statuspal",
"category": "Graveyard",
"repository": "https://git.autonomic.zone/coop-cloud/statuspal.git",
"default_branch": "main",
"description": "Statuspal lets you communicate your web apps/services status • https://github.com/statuspal/statuspal/",
"website": "",
"description": "Statuspal lets you communicate your web apps/services status",
"website": "https://github.com/statuspal/statuspal/",
"features": {
"category": "Graveyard",
"status": "❹💣",
@ -713,7 +725,7 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/162-533dee894ac13daf7f3df11286d4f250"
},
"invoiceninja": {
"name": "Invoiceninja",
@ -721,7 +733,7 @@
"repository": "https://git.autonomic.zone/coop-cloud/invoiceninja.git",
"default_branch": "master",
"description": "Free open-source invoicing",
"website": "",
"website": "https://github.com/invoiceninja/invoiceninja",
"features": {
"category": "Apps",
"status": "❹💣",
@ -789,15 +801,15 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/78-29c99f17dcab6ccc3adeba8c20275505"
},
"statping": {
"name": "Statping",
"category": "Apps",
"repository": "https://git.autonomic.zone/coop-cloud/statping.git",
"default_branch": "main",
"description": "Status Page for monitoring your websites and applications with beautiful graphs, analytics, and plugins • https://github.com/statping/statping",
"website": "",
"description": "Status Page for monitoring your websites and applications with beautiful graphs, analytics, and plugins",
"website": "https://github.com/statping/statping",
"features": {
"category": "Apps",
"status": "❸🍎",
@ -821,15 +833,15 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/179-3614ed95881f3698505020229a242aa5"
},
"kimai": {
"name": "Kimai",
"category": "Apps",
"repository": "https://git.autonomic.zone/coop-cloud/kimai.git",
"default_branch": "main",
"description": "Web-based multiuser time-tracking application • https://github.com/kevinpapst/kimai2",
"website": "",
"description": "Web-based multiuser time-tracking application",
"website": "https://github.com/kevinpapst/kimai2",
"features": {
"category": "Apps",
"status": "?",
@ -858,7 +870,7 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/121-63207e715b9e6f90d292ab20867b4f5b"
},
"keycloak": {
"name": "keycloak",
@ -866,7 +878,7 @@
"repository": "https://git.autonomic.zone/coop-cloud/keycloak.git",
"default_branch": "master",
"description": "Open source identity and access management",
"website": "",
"website": "https://github.com/keycloak/keycloak",
"features": {
"category": "Apps",
"status": "❷💛",
@ -895,7 +907,7 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/81-7f1c73644f4a243e234a38be4b02a87b"
},
"h5ai": {
"name": "H5ai",
@ -926,8 +938,8 @@
"category": "Apps",
"repository": "https://git.autonomic.zone/coop-cloud/wallabag.git",
"default_branch": "main",
"description": "Self hostable application for saving web pages • https://github.com/wallabag/wallabag",
"website": "",
"description": "Self hostable application for saving web pages",
"website": "https://github.com/wallabag/wallabag",
"features": {
"category": "Apps",
"status": "❸🍎",
@ -961,15 +973,15 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/136-0e3f598ecf62e71b4884fe9e823f7df8"
},
"radicale": {
"name": "Radicale",
"category": "Apps",
"repository": "https://git.autonomic.zone/coop-cloud/radicale.git",
"default_branch": "main",
"description": "A simple CalDAV (calendar) and CardDAV (contact) server • https://github.com/Kozea/Radicale",
"website": "",
"description": "A simple CalDAV (calendar) and CardDAV (contact) server",
"website": "https://github.com/Kozea/Radicale",
"features": {
"category": "Apps",
"status": "❹💣",
@ -993,26 +1005,26 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/208-a1ecce2144ee538446c04499b36cd2aa"
},
"penpot": {
"name": "",
"category": "",
"repository": "https://git.autonomic.zone/coop-cloud/penpot.git",
"default_branch": "main",
"description": "The Open-Source design & prototyping platform • https://github.com/penpot/penpot",
"website": "",
"description": "The Open-Source design & prototyping platform",
"website": "https://github.com/penpot/penpot",
"features": {},
"versions": {},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/235-2d649ef2cac767f666190ee583a35de5"
},
"keyoxide": {
"name": "Keyoxide",
"category": "Apps",
"repository": "https://git.autonomic.zone/coop-cloud/keyoxide.git",
"default_branch": "main",
"description": "A modern, secure and privacy-friendly platform to establish your decentralized online identity • https://codeberg.org/keyoxide/web",
"website": "",
"description": "A modern, secure and privacy-friendly platform to establish your decentralized online identity",
"website": "https://codeberg.org/keyoxide/web",
"features": {
"category": "Apps",
"status": "❷💛",
@ -1043,15 +1055,15 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/186-86a30915fd46fce2d7e35709d9373da4"
},
"filerun": {
"name": "Filerun",
"category": "Graveyard",
"repository": "",
"default_branch": "",
"description": "",
"website": "",
"repository": "https://git.autonomic.zone/coop-cloud/filerun.git",
"default_branch": "main",
"description": "Self-hosted Google Drive/Photos/Music alternative",
"website": "https://github.com/filerun/docker",
"features": {
"category": "Graveyard",
"status": "❹💣",
@ -1067,15 +1079,15 @@
"tests": "No"
},
"versions": {},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/203-15089f83295d915f00099a0c8d9a45a6"
},
"projectsend": {
"name": "Projectsend",
"category": "Graveyard",
"repository": "https://git.autonomic.zone/coop-cloud/projectsend.git",
"default_branch": "main",
"description": "Share files with your clients, focused on ease of use and privacy • https://github.com/projectsend/projectsend",
"website": "",
"description": "Share files with your clients, focused on ease of use and privacy",
"website": "https://github.com/projectsend/projectsend",
"features": {
"category": "Graveyard",
"status": "❹💣",
@ -1104,15 +1116,15 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/201-d8447785c1cbbc599c395d14732591a8"
},
"znc": {
"name": "ZNC",
"category": "Apps",
"repository": "https://git.autonomic.zone/coop-cloud/znc.git",
"default_branch": "main",
"description": "IRC bouncer • https://github.com/znc/znc",
"website": "",
"description": "IRC bouncer",
"website": "https://github.com/znc/znc",
"features": {
"category": "Apps",
"status": "❹💣",
@ -1136,7 +1148,7 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/214-b6089b954d6c6e4672ecfa101bda547b"
},
"traefik-forward-auth": {
"name": "traefik-forward-auth",
@ -1208,7 +1220,7 @@
"repository": "https://git.autonomic.zone/coop-cloud/civicrm-backdrop.git",
"default_branch": "main",
"description": "CiviCRM with Backdrop CMS",
"website": "",
"website": "https://civicrm.org/backdrop",
"features": {},
"versions": {
"1.19.2": {
@ -1219,7 +1231,7 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/165-dae3948b12efa0ac5dac6670fcc84f7e"
},
"distribution": {
"name": "distribution",
@ -1293,8 +1305,8 @@
"category": "Apps",
"repository": "https://git.autonomic.zone/coop-cloud/codimd.git",
"default_branch": "main",
"description": "Realtime collaborative markdown notes on all platforms • https://github.com/hackmdio/codimd",
"website": "",
"description": "Realtime collaborative markdown notes on all platforms",
"website": "https://github.com/hackmdio/codimd",
"features": {
"category": "Apps",
"status": "❷💛",
@ -1394,8 +1406,8 @@
"category": "Apps",
"repository": "https://git.autonomic.zone/coop-cloud/matomo.git",
"default_branch": "main",
"description": "Liberating Web Analytics • https://github.com/matomo-org/matomo",
"website": "",
"description": "Liberating Web Analytics",
"website": "https://github.com/matomo-org/matomo",
"features": {
"category": "Apps",
"status": "❸🍎",
@ -1424,15 +1436,15 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/119-67650a157731e1d3c13f73612360c6f6"
},
"wordpress": {
"name": "Wordpress",
"category": "Apps",
"repository": "https://git.autonomic.zone/coop-cloud/wordpress.git",
"default_branch": "master",
"description": "Open source software you can use to create a beautiful website, blog, or app • https://github.com/wordpress/wordpress",
"website": "",
"description": "Open source software you can use to create a beautiful website, blog, or app",
"website": "https://github.com/wordpress/wordpress",
"features": {
"category": "Apps",
"status": "❶💚",
@ -1473,7 +1485,7 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/56-c42ad450f8d08fb7e5ab945e4147dc5c"
},
"portainer": {
"name": "portainer",
@ -1481,7 +1493,7 @@
"repository": "https://git.autonomic.zone/coop-cloud/portainer.git",
"default_branch": "master",
"description": "Making Docker management easy",
"website": "",
"website": "https://github.com/portainer/portainer",
"features": {
"category": "Utilities",
"status": "?",
@ -1510,15 +1522,15 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/52-80027578bf816e79303ccc652e1b0a9f"
},
"mailu": {
"name": "Mailu",
"category": "Apps",
"repository": "https://git.autonomic.zone/coop-cloud/mailu.git",
"default_branch": "main",
"description": "Insular email distribution - mail server as Docker images • https://github.com/Mailu/Mailu",
"website": "",
"description": "Insular email distribution - mail server as Docker images",
"website": "https://github.com/Mailu/Mailu",
"features": {
"category": "Apps",
"status": "❸🍎",
@ -1534,7 +1546,7 @@
"tests": "No"
},
"versions": {},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/133-c56b07895555d12e73f3c0a7bdc4ecdc"
},
"nextcloud": {
"name": "Nextcloud",
@ -1542,7 +1554,7 @@
"repository": "https://git.autonomic.zone/coop-cloud/nextcloud.git",
"default_branch": "main",
"description": "Nextcloud Server, a safe home for all your data ",
"website": "",
"website": "https://github.com/nextcloud/server",
"features": {
"category": "Apps",
"status": "❷💛",
@ -1571,7 +1583,7 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/108-ca8b5ae4e3d07df9f3254d66483c2fcb"
},
"go-neb": {
"name": "go-neb",
@ -1602,8 +1614,8 @@
"category": "Apps",
"repository": "https://git.autonomic.zone/coop-cloud/filestash.git",
"default_branch": "main",
"description": "A modern web client for SFTP, S3, FTP, WebDAV, Git, Minio, LDAP, CalDAV, CardDAV, Mysql, Backblaze • https://github.com/mickael-kerjean/filestash",
"website": "",
"description": "A modern web client for SFTP, S3, FTP, WebDAV, Git, Minio, LDAP, CalDAV, CardDAV, Mysql, Backblaze",
"website": "https://github.com/mickael-kerjean/filestash",
"features": {
"category": "Apps",
"status": "❹💣",
@ -1627,6 +1639,6 @@
}
}
},
"icon": ""
"icon": "https://git.autonomic.zone/repo-avatars/202-f9d552bccf48bda03295d64863f35a3b"
}
}

View File

@ -42,7 +42,6 @@ type alias App =
, website : Maybe String
}
type alias Model =
{ url : Url Params
, status : Status
@ -94,8 +93,12 @@ update msg model =
Just item ->
( { model | status = Success (item) }, loadREADME item)
Err _ ->
( { model | status = Failure }, Cmd.none )
Err err ->
let
_ =
Debug.log "Something failed" err
in
( { model | status = Failure } , Cmd.none )
GotText result ->
case result of
@ -109,8 +112,12 @@ update msg model =
in
( { model | readme = Regex.replace regex (\_ -> "") content }, Cmd.none )
Err _ ->
( { model | status = Failure }, Cmd.none )
Err err ->
let
_ =
Debug.log "Something failed" err
in
( { model | status = Failure } , Cmd.none )
@ -241,10 +248,8 @@ viewApp app readme =
loadApp : Cmd Msg
loadApp =
-- fetch app JSON and README in parallel
Http.get
-- FIXME: change to absolute URL, if this works?
{ url = "/abra-apps-list.json"
{ url = "/abra-apps.json"
, expect = Http.expectJson GotApps appListDecoder }
@ -260,12 +265,13 @@ loadREADME app =
Nothing ->
text ""
in
Http.get
-- FIXME use live Gitea link
{ url = "https://cors-container.herokuapp.com/https://git.autonomic.zone/coop-cloud/" ++ app.slug ++ "/raw/branch/" ++ app.default_branch ++ "/README.md"
, expect = Http.expectString GotText }
Http.get
-- FIXME use live Gitea link
{ url = "https://cors-container.herokuapp.com/https://git.autonomic.zone/coop-cloud/" ++ app.slug ++ "/raw/branch/" ++ app.default_branch ++ "/README.md"
, expect = Http.expectString GotText }
featuresDecoder : Decode.Decoder String
featuresDecoder =
-- get features.status if it's there
(Decode.oneOf
@ -284,11 +290,17 @@ appDecoder =
|> andMap (Decode.succeed Nothing)
|> andMap (Decode.maybe (Decode.field "icon" Decode.string))
|> andMap (Decode.at [ "features" ] featuresDecoder)
|> andMap (Decode.field "slug" Decode.string)
|> andMap (Decode.succeed "")
|> andMap (Decode.field "default_branch" Decode.string)
|> andMap (Decode.maybe (Decode.field "website" Decode.string))
appListDecoder : Decode.Decoder (List App)
appListDecoder =
Decode.list appDecoder
Decode.keyValuePairs appDecoder
|> Decode.map buildApp
buildApp : List (String, App) -> (List App)
buildApp apps =
List.map (\(slug, app) -> { app | slug = slug}) apps

View File

@ -108,7 +108,7 @@ appScore app =
2
"3" ->
3
"4" ->
"4" ->
4
_ ->
5
@ -124,18 +124,18 @@ viewStatusBadge app =
"badge-info"
"3" ->
"badge-warning"
"4" ->
"4" ->
"badge-danger"
_ ->
"badge-dark"
status_score =
status_score =
case app.status of
"" ->
"?"
score ->
score
in
span [ class ("card-link badge " ++ status_class) ]
span [ class ("card-link badge " ++ status_class) ]
[ text ("Score: " ++ status_score) ]
viewApp : App -> Html Msg
@ -149,40 +149,40 @@ viewApp app =
i
Nothing ->
default_image
repository_link =
repository_link =
case app.repository of
Just link ->
a [ class "card-link", href link ]
[
i [ class "fab fa-git-alt" ] []
, text "code"
a [ class "card-link", href link ]
[
i [ class "fab fa-git-alt" ] []
, text "code"
]
Nothing ->
text ""
website_link =
website_link =
case app.website of
Just link ->
case link of
"" ->
text ""
_ ->
a [ class "card-link", href link ]
[ i [ class "fas fa-home" ] []
a [ class "card-link", href link ]
[ i [ class "fas fa-home" ] []
, text "homepage" ]
Nothing ->
text ""
app_href = Route.toString <| Route.App_String { app = app.slug }
in
div [ class "col-md-4 mb-3 col-sm-12" ]
div [ class "col-md-4 mb-3 col-sm-12" ]
[ div [ class "card" ]
[ img [ class "card-img-top", src icon_url, alt ("icon for " ++ app.name) ] []
, div [ class "card-body" ]
[ h5 [ class "card-title" ]
[ a [ href app_href ] [ text app.name ] ]
[ h5 [ class "card-title" ]
[ a [ href app_href ] [ text app.name ] ]
, repository_link
, website_link
, a [ class "card-link", href app_href ]
[ i [ class "fas fa-book" ] []
, a [ class "card-link", href app_href ]
[ i [ class "fas fa-book" ] []
, text "docs" ]
]
, div [ class "card-footer" ]
@ -210,8 +210,8 @@ viewApps model =
Success apps ->
div []
[ div [ class "row" ]
(List.map viewApp (apps |> List.sortWith
(by appScore ASC
(List.map viewApp (apps |> List.sortWith
(by appScore ASC
|> andThen .name ASC))
)
]
@ -222,7 +222,7 @@ viewApps model =
loadApps : Cmd Msg
loadApps =
Http.get
{ url = "/abra-apps-list.json"
{ url = "/abra-apps.json"
, expect = Http.expectJson GotApps appListDecoder
}
@ -244,9 +244,16 @@ appDecoder =
(Decode.succeed Nothing)
(Decode.maybe (Decode.field "icon" Decode.string))
(Decode.at [ "features" ] featuresDecoder)
(Decode.field "slug" Decode.string)
(Decode.succeed "")
(Decode.maybe (Decode.field "website" Decode.string))
appListDecoder : Decode.Decoder (List App)
appListDecoder =
Decode.list appDecoder
Decode.keyValuePairs appDecoder
|> Decode.map buildApp
buildApp : List (String, App) -> (List App)
buildApp apps =
List.map (\(slug, app) -> { app | slug = slug}) apps