Commit 8ac97866 authored by Emmanuel Raviart's avatar Emmanuel Raviart

Add OGP tab to navigate between OGP categories.

parent 8bd01030
......@@ -213,7 +213,9 @@ type TranslationId
| NewValueDescription
| Number
| NumberPlaceholder
| OGPsummitLink
| Ogp
| OgpDescription
| OgpTitle
| OpenGovernmentPartnership
| OpenGovernmentPartnershipLogo
| OpenGovParagraph
......@@ -6663,16 +6665,43 @@ getTranslationSet translationId =
, swedish = todo
}
OGPsummitLink ->
Ogp ->
{ bulgarian = todo
, croatian = todo
, czech = todo
, danish = todo
, dutch = s "https://nl.ogpsummit.org/osem/conference/ogp-summit"
, english = s "https://en.ogpsummit.org/osem/conference/ogp-summit"
, dutch = todo
, english = s "OGP"
, estonian = todo
, finnish = todo
, french = s "PGO"
, german = todo
, greek = todo
, hungarian = todo
, irish = todo
, italian = todo
, latvian = todo
, lithuanian = todo
, maltese = todo
, polish = todo
, portuguese = todo
, romanian = todo
, slovak = todo
, slovenian = todo
, spanish = todo
, swedish = todo
}
OgpDescription ->
{ bulgarian = todo
, croatian = todo
, czech = todo
, danish = todo
, dutch = todo
, english = s "Digital solutions to improve open governments"
, estonian = todo
, finnish = todo
, french = s "https://fr.ogpsummit.org/osem/conference/ogp-summit"
, french = s "Solutions numériques pour gouvernements ouverts"
, german = todo
, greek = todo
, hungarian = todo
......@@ -6686,7 +6715,34 @@ getTranslationSet translationId =
, romanian = todo
, slovak = todo
, slovenian = todo
, spanish = s "https://es.ogpsummit.org/osem/conference/ogp-summit"
, spanish = todo
, swedish = todo
}
OgpTitle ->
{ bulgarian = todo
, croatian = todo
, czech = todo
, danish = todo
, dutch = todo
, english = s "OGP Toolbox (OGP version)"
, estonian = todo
, finnish = todo
, french = s "OGP Toolbox (version OGP)"
, german = todo
, greek = todo
, hungarian = todo
, irish = todo
, italian = todo
, latvian = todo
, lithuanian = todo
, maltese = todo
, polish = todo
, portuguese = todo
, romanian = todo
, slovak = todo
, slovenian = todo
, spanish = todo
, swedish = todo
}
......
......@@ -237,14 +237,20 @@ getObjectProperties authentication objectId keyId =
}
getTagsPopularity : Maybe Authentication -> List String -> Http.Request PopularTagsData
getTagsPopularity authentication tagIds =
getTagsPopularity : Maybe Authentication -> Bool -> List String -> Http.Request PopularTagsData
getTagsPopularity authentication ogpMode tagIds =
Http.request
{ method = "GET"
, headers = authenticationHeaders authentication
, url =
apiUrl
++ "cards/tags-popularity?type=use-case&"
++ "cards/tags-popularity"
++ (if ogpMode then
"-ogp"
else
""
)
++ "?type=use-case&"
++ (tagIds
|> List.filter (\s -> not (String.isEmpty s))
|> List.map (\tagId -> "tag=" ++ tagId)
......
......@@ -338,7 +338,7 @@ urlUpdate location model =
case parseLocation location of
Just ((I18nRouteWithLanguage language localizedRoute) as route) ->
let
indexRoute titleSymbol descriptionSymbol =
indexRoute titleSymbol descriptionSymbol ogpMode =
let
getLocalizedString value =
case value.value of
......@@ -373,7 +373,10 @@ urlUpdate location model =
model.searchModel
newSearchModel =
{ searchModel | selectedTags = selectedTags }
{ searchModel
| ogpMode = ogpMode
, selectedTags = selectedTags
}
( newSearchModel2, searchCmd ) =
Search.State.update
......@@ -486,7 +489,7 @@ urlUpdate location model =
)
HomeRoute ->
indexRoute I18n.HomeTitle I18n.HomeDescription
indexRoute I18n.HomeTitle I18n.HomeDescription False
NotFoundRoute _ ->
( model
......@@ -497,6 +500,9 @@ urlUpdate location model =
}
)
OgpRoute ->
indexRoute I18n.OgpTitle I18n.OgpDescription True
OrganizationsRoute childRoute ->
case childRoute of
OrganizationRoute cardId ->
......@@ -513,7 +519,10 @@ urlUpdate location model =
)
OrganizationsIndexRoute ->
indexRoute (I18n.Organization I18n.Plural) I18n.OrganizationsDescription
indexRoute
(I18n.Organization I18n.Plural)
I18n.OrganizationsDescription
False
NewOrganizationRoute ->
let
......@@ -567,7 +576,7 @@ urlUpdate location model =
)
ToolsIndexRoute ->
indexRoute (I18n.Tool I18n.Plural) I18n.ToolsDescription
indexRoute (I18n.Tool I18n.Plural) I18n.ToolsDescription False
NewToolRoute ->
let
......@@ -610,7 +619,7 @@ urlUpdate location model =
)
UseCasesIndexRoute ->
indexRoute (I18n.UseCase I18n.Plural) I18n.UseCasesDescription
indexRoute (I18n.UseCase I18n.Plural) I18n.UseCasesDescription False
NewUseCaseRoute ->
let
......
......@@ -111,6 +111,11 @@ view model =
]
|> standardLayout language
OgpRoute ->
Home.view model.searchModel language model.location
|> Html.map translateSearchMsg
|> standardLayout language
OrganizationsRoute childRoute ->
case childRoute of
OrganizationRoute _ ->
......@@ -753,6 +758,14 @@ viewHeader model language containerClass =
[]
[ text (I18n.translate language (I18n.Collection I18n.Plural)) ]
]
, li []
[ aForPath
Navigate
language
"/ogp"
[ title (I18n.translate language I18n.OpenGovernmentPartnership) ]
[ text (I18n.translate language I18n.Ogp) ]
]
, aboutDropdown
]
, Html.form
......
......@@ -19,6 +19,7 @@ type LocalizedRoute
| FaqRoute
| HomeRoute
| NotFoundRoute (List String)
| OgpRoute
| OrganizationsRoute OrganizationsRoute
| PressRoute
| ToolsRoute ToolsRoute
......@@ -71,6 +72,7 @@ localizedRouteParser =
, map AboutRoute (s "about")
, map CollectionsRoute (s "collections" </> collectionsRouteParser)
, map FaqRoute (s "faq")
, map OgpRoute (s "ogp")
, map OrganizationsRoute (s "organizations" </> organizationsRouteParser)
, map PressRoute (s "press")
, map UserProfileRoute (s "profile")
......
......@@ -35,6 +35,7 @@ remove x xs =
init : Model
init =
{ collections = NotAsked
, ogpMode = False
, organizations = NotAsked
, popularTagsData = NotAsked
, selectedTags = []
......@@ -374,7 +375,7 @@ update msg model authentication language location =
selectedTagIds
cardTypesForUseCase
|> Http.send (ForSelf << GotUseCases)
, Requests.getTagsPopularity authentication selectedTagIds
, Requests.getTagsPopularity authentication model.ogpMode selectedTagIds
|> Http.send (ForSelf << GotTagsPopularity)
]
in
......
......@@ -8,6 +8,7 @@ import WebData exposing (..)
type alias Model =
{ collections : WebData DataIdsBody
, ogpMode : Bool
, organizations : WebData DataIdsBody
, popularTagsData : WebData PopularTagsData
, selectedTags : List Ports.D3BubblesPopularTag
......
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