From 69ae465046779c60eb8009a5dd92d8a33238dff3 Mon Sep 17 00:00:00 2001
From: Olivia206 <olivia.simonet@mmibordeaux.com>
Date: Wed, 15 Feb 2023 11:52:01 +0100
Subject: [PATCH] created template for programs children list

---
 assets/sass/_theme/sections/diplomas.sass |  7 ++++-
 layouts/partials/diplomas/diplomas.html   | 36 +++++++++++++----------
 2 files changed, 27 insertions(+), 16 deletions(-)

diff --git a/assets/sass/_theme/sections/diplomas.sass b/assets/sass/_theme/sections/diplomas.sass
index c5b2d68c..05c8bdc8 100644
--- a/assets/sass/_theme/sections/diplomas.sass
+++ b/assets/sass/_theme/sections/diplomas.sass
@@ -42,10 +42,15 @@ ul.diplomas
                 display: block
                 border-bottom: 0
                 padding: 0
-                + li
+                + li, > ol
                     margin-top: $spacing1
                 a:hover
                     color: $color-accent
+                ol 
+                    ol
+                        margin-left: $spacing1
+                    li 
+                        @include icon(list-hyphen, before)
                         
         .program
             div
diff --git a/layouts/partials/diplomas/diplomas.html b/layouts/partials/diplomas/diplomas.html
index 5743339a..1f9b6302 100644
--- a/layouts/partials/diplomas/diplomas.html
+++ b/layouts/partials/diplomas/diplomas.html
@@ -16,24 +16,30 @@
 
         <ol class="programs">
           {{- range .Params.programs -}}
-            <li>
-              <a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" .label)) }}">
-                {{- partial "PrepareHTML" .label -}}
-              </a>
-              {{- range .children -}}
-                <ol>
-                  <li>
-                    <a href="{{ .path }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" .label)) }}">
-                      {{- partial "PrepareHTML" .label -}}
-                    </a>
-                  </li>
-                </ol>
-              {{ end }}
-            </li>
+            {{- template "programsList" . -}}
           {{- end -}}
         </ol>
-
       </div>
     </li>
   {{ end }}
 </ul>
+
+{{- define "programsList" -}}
+  <li>
+    <a href="{{ .Permalink }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" .label)) }}">
+      {{- partial "PrepareHTML" .label -}}
+    </a>
+    <ol>
+      {{- range .children -}}
+      <li>
+        <a href="{{ .path }}" title="{{ safeHTML (i18n "commons.more_aria" (dict "Title" .label)) }}">
+          {{- partial "PrepareHTML" .label -}}
+        </a>
+        {{ if .children }}
+          {{- template "programsList" . -}}
+        {{ end }}
+      </li>
+      {{ end }}
+    </ol>
+  </li>
+{{- end -}}
\ No newline at end of file
-- 
GitLab