2018-08-20 19:07:54 +00:00
{{ define "main" }}
2018-10-01 19:38:37 +00:00
{{ $pages := .Pages }}
2019-02-05 16:33:23 +00:00
{{ with site.Params.language_alternatives }}
2018-10-01 19:38:37 +00:00
{{ range . }}
{{ with (where $.Translations ".Lang" . ) }}
{{ $p := index . 0 }}
{{ $pages = $pages | lang.Merge $p.Pages }}
{{ end }}
{{ end }}
{{ end }}
{{ $featured := (where $pages "Params.featured" true).ByWeight | first 4 }}
2018-08-20 19:07:54 +00:00
< section id = "mainContent" >
2019-10-27 11:43:24 +00:00
< div class = "main-section" >
2018-08-20 19:07:54 +00:00
< div class = "content" >
< div class = "case-studies" >
{{ range $featured }}
2018-10-01 19:38:37 +00:00
{{ template "case-study-featured-block" (dict "ctx" $ "page" .) }}
2018-08-20 19:07:54 +00:00
{{ end }}
< / div >
< / div >
2019-10-27 11:43:24 +00:00
< / div >
2018-08-20 19:07:54 +00:00
< / section >
{{ $featuredVideos := where .Pages ".Params.video" "!=" nil }}
{{ with $featuredVideos }}
{{ with index $featuredVideos 0 }}
2019-12-24 05:07:29 +00:00
{{ $altText := .LinkTitle }}
2018-08-20 19:07:54 +00:00
< section id = "video" >
2019-10-27 11:43:24 +00:00
< div class = "main-section" >
2018-08-20 19:07:54 +00:00
< div >
< h4 > < i > "{{ .Params.quote | html }}"< / i > < / h4 >
{{ $img := .Resources.GetMatch "video.png" }}
2019-11-17 20:41:41 +00:00
{{ $small := .Resources.GetMatch "**small*.svg" }}
2019-12-24 05:07:29 +00:00
{{ with $small }}< img height = "60px" src = "{{ .RelPermalink }}" alt = "{{ $altText }}" > {{ end }}
2018-08-20 19:07:54 +00:00
< / div >
< div style = "padding-left: 40px;" > < button onclick = "kub.showVideo()" > {{ with $img }}< img src = "{{ .RelPermalink }}" alt = "Box video" > {{ end }}< h6 > Kubernetes at Box< / h6 > < / button > < / div >
2019-10-27 11:43:24 +00:00
< / div >
2018-08-20 19:07:54 +00:00
< div id = "videoPlayer" >
< iframe data-url = "{{ .Params.video | safeURL }}" frameborder = "0" allowfullscreen = "true" > < / iframe >
< button id = "closeButton" > < / button >
< / div >
< / section >
{{ end }}
{{ end }}
< section id = "users" >
2019-10-27 11:43:24 +00:00
< div class = "main-section" >
2018-10-01 19:38:37 +00:00
< h3 > {{ .Title }}< / h3 >
2018-08-20 19:07:54 +00:00
< div id = "usersGrid" >
2018-10-01 19:38:37 +00:00
{{ range $pages.ByTitle }}
2019-10-23 16:02:15 +00:00
{{ $logo := .Resources.GetMatch "**{feature,logo}*.svg" }}
{{ if not $logo }}
{{ $logo = .Resources.GetMatch "**logo*.png" }}
{{ end }}
2018-08-20 19:07:54 +00:00
{{ $p := . }}
2019-10-23 16:02:15 +00:00
< a target = "_blank" href = "{{ with $p.Params.content_url }}{{ . | safeURL }}{{ else }}{{ .RelPermalink }}{{ end }}" >
{{ with $logo }}
2019-11-17 20:41:41 +00:00
< img src = "{{ .RelPermalink }}" width = "215px" height = "127px" alt = "{{ $p.LinkTitle }}" >
2019-10-23 16:02:15 +00:00
{{ else }}
{{ errorf "Case Studies: Missing logo for %s. Put a PNG or SVG with the word 'logo' in the filename into %q" $p.LinkTitle $p.File.Dir }}
{{ end }}
< / a >
2018-08-20 19:07:54 +00:00
{{ end }}
2019-11-17 20:41:41 +00:00
< a target = "_blank" href = "https://docs.google.com/a/google.com/forms/d/e/1FAIpQLScuI7Ye3VQHQTwBASrgkjQDSS5TP0g3AXfFhwSM9YpHgxRKFA/viewform" class = "tell-your-story" > < img height = "127px" src = "/images/case_studies/story.svg" alt = "{{ T " layouts_case_studies_list_tell " } } " > < / a >
2018-08-20 19:07:54 +00:00
< / div >
2019-10-27 11:43:24 +00:00
< / div >
2018-08-20 19:07:54 +00:00
< / section >
{{ .Content }}
{{ end }}
{{ define "case-study-featured-block" }}
2018-10-01 19:38:37 +00:00
{{ $isForeignLanguage := (ne .page.Lang .ctx.Lang)}}
2019-12-24 05:07:29 +00:00
{{ $logo := .page.Resources.GetMatch "**{feature,logo}*.png" }}
{{ $altText := .page.LinkTitle}}
2018-08-20 19:07:54 +00:00
< div class = "case-study" >
2019-12-24 05:07:29 +00:00
{{ with $logo }}< img src = "{{ .RelPermalink }}" alt = "{{ $altText }}" > {{ end }}
2018-10-01 19:38:37 +00:00
< p class = "quote" > "{{ .page.Params.quote | html }}"< / p >
2018-10-04 00:11:55 +00:00
< a href = "{{ .page.RelPermalink }}" { { if $ isForeignLanguage } } target = "_blank" { { end } } > {{ T "main_read_about"}} {{ .page.LinkTitle }}< / a >
2018-08-20 19:07:54 +00:00
< / div >
2019-02-05 16:33:23 +00:00
{{ end }}