Commit d0433e44 authored by Emmanuel Raviart's avatar Emmanuel Raviart

Replace opensource logos with text.

parent 59106dfa
module Cards.Helpers exposing (..)
import Dict exposing (Dict)
import I18n
import Types exposing (..)
isOpenSource : I18n.Language -> Dict String TypedValue -> Card -> Bool
isOpenSource language values card =
let
repo =
(case I18n.getOneString language repoKeys card values of
Just value ->
String.length value > 8
Nothing ->
False
)
sourceCode =
(case I18n.getOneString language sourceCodeKeys card values of
Just value ->
String.length value > 8
Nothing ->
False
)
openSource =
(case I18n.getOneString language openSourceKeys card values of
Just value ->
let
lowerValue =
String.toLower value
in
(lowerValue == "yes") || (lowerValue == "oui")
Nothing ->
False
)
license =
(case I18n.getOneString language licenseKeys card values of
Just value ->
String.toLower value
Nothing ->
""
)
openLicense =
((String.length license > 1)
&& not (String.contains license "proprieta")
&& not (String.contains license "non-free")
)
in
repo || sourceCode || openSource || openLicense
This diff is collapsed.
module Cards.ViewsParts exposing (..)
import Dict exposing (Dict)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Attributes.Aria exposing (..)
......@@ -13,66 +12,6 @@ import Types exposing (..)
import Urls
isOpenSource : I18n.Language -> Dict String TypedValue -> Card -> Bool
isOpenSource language values card =
let
repo =
(case I18n.getOneString language repoKeys card values of
Just value ->
String.length value > 8
Nothing ->
False
)
sourceCode =
(case I18n.getOneString language sourceCodeKeys card values of
Just value ->
String.length value > 8
Nothing ->
False
)
openSource =
(case I18n.getOneString language openSourceKeys card values of
Just value ->
let
lowerValue =
String.toLower value
in
(lowerValue == "yes") || (lowerValue == "oui")
Nothing ->
False
)
license =
(case I18n.getOneString language licenseKeys card values of
Just value ->
String.toLower value
Nothing ->
""
)
openLicense =
((String.length license > 1)
&& not (String.contains license "proprieta")
&& not (String.contains license "non-free")
)
in
repo || sourceCode || openSource || openLicense
viewCardOpenSourceStatus : I18n.Language -> Dict String TypedValue -> Card -> Html msg
viewCardOpenSourceStatus language values card =
if isOpenSource language values card then
img [ src "/img/open.png", title (I18n.translate language I18n.OpenSource) ] []
else
img [ src "/img/closed.png", title (I18n.translate language I18n.Proprietary) ] []
viewCardThumbnail :
I18n.Language
-> (String -> msg)
......@@ -113,15 +52,7 @@ viewCardThumbnail language navigate onRemoveCard extraClass data card =
in
element
([ class ("thumbnail " ++ extraClass) ] ++ elementAttributes)
[ (case cardType of
ToolCard ->
div [ class "opensource-home" ]
[ viewCardOpenSourceStatus language data.values card ]
_ ->
Html.text ""
)
, div [ class "visual" ]
[ div [ class "visual" ]
[ case Urls.imageFullUrl language "500" card data.values of
Just url ->
img [ alt "logo", src url ] []
......
......@@ -416,6 +416,11 @@ cardTypesForOrganization =
[ "organization" ]
cardTypesForSoftware : List String
cardTypesForSoftware =
[ "software" ]
cardTypesForTool : List String
cardTypesForTool =
[ "software", "platform" ]
......
......@@ -10,7 +10,6 @@ import Http exposing (Error(..))
import Http.Error
import I18n
import String
import Cards.ViewsParts exposing (..)
import Tags.ViewsParts exposing (..)
import Types exposing (..)
import Urls
......@@ -111,14 +110,6 @@ viewCardListItem navigate language values card =
)
]
]
, (case cardType of
ToolCard ->
div [ class "opensource" ]
[ viewCardOpenSourceStatus language values card ]
_ ->
Html.text ""
)
, div [ class "caption" ]
[ h4 []
[ aForPath
......
......@@ -921,37 +921,6 @@ h4.zone-label {
}
}
&.tool .opensource, &.orga .opensource {
img {
position: relative;
width: 35px;
height: 35px;
right: 38px;
top: 3px;
}
}
&.tool .opensource-home, &.orga .opensource-home {
img {
position: absolute;
width: 35px;
height: 35px;
right: 5px;
top: 5px;
z-index: 10;
}
}
&.tool .opensource-card, &.orga .opensource-card {
img {
position: absolute;
width: 35px;
height: 35px;
left: 5px;
top: 5px;
}
}
&.tool {
background: white;
box-shadow: none;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment