From aea295f7d1cfc6be20ae3908508dbbd524ddf693 Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Tue, 15 May 2018 00:13:48 +0200
Subject: [PATCH] [web] First draft of features-at-a-glance layout.

---
 web/layouts/index.html                       |  8 +++-
 web/layouts/partials/components/feature.html | 41 ++++++++++++++++++++
 web/layouts/partials/components/hero.html    |  9 +++++
 3 files changed, 56 insertions(+), 2 deletions(-)
 create mode 100644 web/layouts/partials/components/feature.html
 create mode 100644 web/layouts/partials/components/hero.html

diff --git a/web/layouts/index.html b/web/layouts/index.html
index 3815937daaf..5f921cbc51c 100644
--- a/web/layouts/index.html
+++ b/web/layouts/index.html
@@ -1,4 +1,8 @@
 {{ define "main" }}
-  <h1>{{ .Title }}</h1>
-  {{.Content}}
+  {{- partial "components/hero" .Params.hero }}
+  {{- range .Params.features -}}
+    {{- partial "components/feature" (dict "pg" $ "feature" .) -}}
+  {{- end -}}
+  <!-- <h1>{{ .Title }}</h1> -->
+  <!-- {{.Content}} -->
 {{ end }}
diff --git a/web/layouts/partials/components/feature.html b/web/layouts/partials/components/feature.html
new file mode 100644
index 00000000000..ef7a1588a95
--- /dev/null
+++ b/web/layouts/partials/components/feature.html
@@ -0,0 +1,41 @@
+{{- with .feature -}}
+  {{- if and .headline .textline -}}
+  <div class="ml-4 py-8 {{ .direction | default "ltr"}} {{ .class }}">
+    <div class="container">
+      <div class="flex -mx-4">
+        {{- if eq .direction "ltr" -}}
+        <div class="w-full md:w-1/2 md:px-4">
+          <h2>{{ markdownify .headline }}</h2>
+          <div>
+            {{ markdownify .textline }}
+          </div>
+        </div>
+        <div class="w-full md:w-1/2 md:px-4">
+          <img src="{{ .visual.permalink }}">
+        </div>
+        {{- else -}}
+        <div class="w-full md:w-1/2 md:px-4">
+          <img src="{{ .visual.permalink }}">
+        </div>
+        <div class="w-full md:w-1/2 md:px-4">
+          <h2>{{ markdownify .headline }}</h2>
+          <div>
+            {{ markdownify .textline }}
+          </div>
+        </div>
+        {{- end -}}
+      </div>
+      <div class="flex -mx-4">
+      {{- range .subfeatures -}}
+        <div class="w-full md:w-1/3 md:px-4">
+          <h4>{{ markdownify .headline }}</h4>
+          <div>
+              {{ markdownify .textline }}
+            </div>
+        </div>
+      {{- end -}}
+      </div>
+    </div>
+  </div>
+  {{- end -}}
+{{- end -}}
diff --git a/web/layouts/partials/components/hero.html b/web/layouts/partials/components/hero.html
new file mode 100644
index 00000000000..c75d2b69381
--- /dev/null
+++ b/web/layouts/partials/components/hero.html
@@ -0,0 +1,9 @@
+{{- if and .headline .textline -}}
+  <div class="pl-4 py-6">
+    <div class="container">
+      <h1>{{ markdownify .headline }}</h1>
+      <div>{{ markdownify .textline }}</div>
+    </div>
+  </div>
+{{- end -}}
+
-- 
GitLab