Tweak links
This commit is contained in:
parent
fee164d3e4
commit
be944ee96a
|
@ -11,7 +11,7 @@ body {
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
i.fa, i.fab {
|
i.fas, i.fab {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 0.3rem;
|
margin-right: 0.3rem;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module Pages.App_String exposing (Model, Msg, Params, page)
|
module Pages.App_String exposing (Model, Msg, Params, page)
|
||||||
|
|
||||||
import Regex
|
import Regex
|
||||||
import Html exposing (Html, button, div, h2, h5, img, text, ul, li, a, p, span)
|
import Html exposing (Html, button, div, h2, h5, img, text, ul, li, a, p, span, i)
|
||||||
import Html.Attributes exposing (src, style, class, alt, href)
|
import Html.Attributes exposing (src, style, class, alt, href)
|
||||||
import Html.Events exposing (onClick)
|
import Html.Events exposing (onClick)
|
||||||
import Http
|
import Http
|
||||||
|
@ -120,11 +120,22 @@ subscriptions model =
|
||||||
|
|
||||||
view : Model -> Document Msg
|
view : Model -> Document Msg
|
||||||
view model =
|
view model =
|
||||||
{ title = "abra app"
|
{ title = title model
|
||||||
, body = [ body model ]
|
, body = [ body model ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
title : Model -> String
|
||||||
|
title model =
|
||||||
|
case model.status of
|
||||||
|
Loading ->
|
||||||
|
"loading - abra apps"
|
||||||
|
Failure ->
|
||||||
|
"error - abra apps"
|
||||||
|
Success app ->
|
||||||
|
app.name ++ " - abra apps"
|
||||||
|
|
||||||
|
|
||||||
body : Model -> Html Msg
|
body : Model -> Html Msg
|
||||||
body model =
|
body model =
|
||||||
div [ class "pt-3" ]
|
div [ class "pt-3" ]
|
||||||
|
@ -177,8 +188,10 @@ viewApp app readme =
|
||||||
default_image
|
default_image
|
||||||
repository_link =
|
repository_link =
|
||||||
case app.repository of
|
case app.repository of
|
||||||
Just i ->
|
Just link ->
|
||||||
a [ class "card-link", href i ] [ text "code" ]
|
a [ class "card-link", href link ]
|
||||||
|
[ i [ class "fab fa-git-alt" ] []
|
||||||
|
, text "code" ]
|
||||||
Nothing ->
|
Nothing ->
|
||||||
text ""
|
text ""
|
||||||
in
|
in
|
||||||
|
@ -188,7 +201,9 @@ viewApp app readme =
|
||||||
[ span [ class "card-link badge badge-secondary" ] [ text app.category ]
|
[ span [ class "card-link badge badge-secondary" ] [ text app.category ]
|
||||||
, viewStatusBadge app
|
, viewStatusBadge app
|
||||||
, repository_link
|
, repository_link
|
||||||
, a [ class "card-link", href "http://example.com" ] [ text "homepage" ]
|
, a [ class "card-link", href "http://example.com" ]
|
||||||
|
[ i [ class "fas fa-home" ] []
|
||||||
|
, text "homepage" ]
|
||||||
-- FIXME: add actual homepage link to apps.json and render here
|
-- FIXME: add actual homepage link to apps.json and render here
|
||||||
]
|
]
|
||||||
, img [ class "card-img-top", src icon_url, alt ("icon for " ++ app.name) ] []
|
, img [ class "card-img-top", src icon_url, alt ("icon for " ++ app.name) ] []
|
||||||
|
|
|
@ -132,19 +132,26 @@ viewApp app =
|
||||||
a [ class "card-link", href link ]
|
a [ class "card-link", href link ]
|
||||||
[
|
[
|
||||||
i [ class "fab fa-git-alt" ] []
|
i [ class "fab fa-git-alt" ] []
|
||||||
, text "Code"
|
, text "code"
|
||||||
]
|
]
|
||||||
Nothing ->
|
Nothing ->
|
||||||
text ""
|
text ""
|
||||||
|
app_href = Route.toString <| Route.App_String { app = app.name }
|
||||||
in
|
in
|
||||||
div [ class "col-4 mb-3" ]
|
div [ class "col-4 mb-3" ]
|
||||||
[ div [ class "card" ]
|
[ div [ class "card" ]
|
||||||
[ img [ class "card-img-top", src icon_url, alt ("icon for " ++ app.name) ] []
|
[ img [ class "card-img-top", src icon_url, alt ("icon for " ++ app.name) ] []
|
||||||
, div [ class "card-body" ]
|
, div [ class "card-body" ]
|
||||||
[ h5 [ class "card-title" ]
|
[ h5 [ class "card-title" ]
|
||||||
[ a [ href (Route.toString <| Route.App_String { app = app.name } ) ] [ text app.name ] ]
|
[ a [ href app_href ] [ text app.name ] ]
|
||||||
, repository_link
|
, repository_link
|
||||||
]
|
, a [ class "card-link", href "http://example.com" ]
|
||||||
|
[ i [ class "fas fa-home" ] []
|
||||||
|
, text "homepage" ]
|
||||||
|
, a [ class "card-link", href app_href ]
|
||||||
|
[ i [ class "fas fa-book" ] []
|
||||||
|
, text "docs" ]
|
||||||
|
]
|
||||||
, div [ class "card-footer" ]
|
, div [ class "card-footer" ]
|
||||||
[ span [ class "card-link badge badge-secondary" ] [ text app.category ]
|
[ span [ class "card-link badge badge-secondary" ] [ text app.category ]
|
||||||
, viewStatusBadge app
|
, viewStatusBadge app
|
||||||
|
|
Loading…
Reference in New Issue