Generierung der Menüstruktur aus den JSON-Daten überarbeitet
[website] / dist / templates / layout.html
index f75606d..b8e870c 100644 (file)
@@ -38,7 +38,7 @@
   <body
       th:fragment="body(uri)"
       thymeproxy:variables="${json}"
-      th:with="page=${pages.get(uri)},crumbs=${page['crumbs']}"
+      th:with="crumbs=${_crumbs.get(uri)}"
       id="top"
       class="menu"
       th:class="${contentclass}?:'menu'"
@@ -55,7 +55,7 @@
         <ol class="b" th:include="~{::#crumbs}?:_">
           <li class="b"><a class="b" href="../index.html" th:href="@{/index.html}">Home</a></li>
           <li class="b" th:each="crumb: ${crumbs}">
-            <a class="b" href="../projects.html" th:href="@{${crumb.uri}}" th:text="${crumb.name}">Projects</a>
+            <a class="b" href="../projects.html" th:href="@{${crumb}}" th:text="${_names.get(crumb)}">Projects</a>
           </li>
           <!--/*-->
           <li class="b"><strong class="b" th:text="${title}">Fix SWF</strong></li>
             <h1 class="nav">Navigation</h1>
             <h2 class="nav menu">Section-Menu</h2>
             <ul id="menu" class="cf">
-              <li class="m blog" th:each="entry : ${sections}" th:class="'m ' + ${entry.key}">
-                <a href="../blog/" th:href="@{${entry.value}}" class="m" th:class="${entry.value == section.uri} ? 'm selected' : 'm'" th:text="${pages.get(entry.value).name}">Blog</a>
+              <li class="m blog" th:each="entry : ${_sections}" th:class="'m ' + ${entry.key}">
+                <a href="../blog/" th:href="@{${entry.value}}" class="m" th:class="${entry.value == section} ? 'm selected' : 'm'" th:text="${_names.get(entry.value)}">Blog</a>
               </li>
               <!--/*-->
               <li class="m projects"><a href="../projects.html" class="m selected">Projects</a></li>
             </ul>
             <h2 class="nav submenu">
               <span class="s">Submenu for section</span>
-              <a class="s selected" href="../projects.html" th:href="@{${section.uri}}" th:text="${section.name}">Projects</a>
+              <a class="s selected" href="../projects.html" th:href="@{${section}}" th:text="${_names.get(section)}">Projects</a>
             </h2>
             <ul th:include="${submenu}?:_"
                 th:with="
                   len=${crumbs.size()},
-                  submenu=${pages[section.uri]['childs']},
-                  parent=${crumbs[0].uri},
+                  submenu=${_childs.get(section)},
+                  parent=${crumbs[0]},
                   pos=1"
                 id="submenu"
                 class="s"
-                th:class="'s' + (${len == 1 or (len == 2 and page['childs'] == null)} ? ' selected' : '')"
+                th:class="'s' + (${len == 1 or (len == 2 and _childs.get(uri) == null)} ? ' selected' : '')"
                 >
               <li th:fragment="submenu(submenu, parent, pos)"
                   th:each="entry : ${submenu}"
                   th:with="
                       child=${pos == len},
-                      selected=${!child and crumbs.get(pos).uri == entry.key},
-                      sibling=${pos + 1 == len and (page['childs'] == null or uri == parent)},
-                      childs=${entry.key == parent ? null : pages[entry.key]['childs']}
+                      selected=${!child and crumbs.get(pos) == entry},
+                      sibling=${pos + 1 == len and (_childs.get(uri) == null or uri == parent)},
+                      childs=${entry == parent ? null : _childs.get(entry)}
                       "
                   class="s sub"
                   th:class="'s' + (${childs} ? ' sub' : '') + (${selected or sibling or child} ? '' : ' off')"
                   >
                 <a  href="../potemkin/fix-swf/overview.html"
-                    th:href="@{${entry.key}}"
+                    th:href="@{${entry}}"
                     class="s selected"
                     th:class="${selected} ? 's selected' : 's'"
-                    th:text="${entry.value}"
+                    th:text="${_names.get(entry)}"
                     >fix-swf</a>
                 <ul th:if="${selected and childs != null}"
                     class="s active"
-                    th:class="'s' + (${selected &amp;&amp; pos == crumbs.size()-1} ? ' active' : '') + (${entry.key == uri or (len &gt; 1 and entry.key == crumbs.get(len-2).uri and page['childs'] == null)} ? ' selected' : '')"
+                    th:class="'s' + (${selected &amp;&amp; pos == crumbs.size()-1} ? ' active' : '') + (${entry == uri or (len &gt; 1 and entry == crumbs.get(len-2) and _childs.get(uri) == null)} ? ' selected' : '')"
                     >
-                  <li th:replace="/templates/layout.html :: submenu(submenu=${childs}, parent=${entry.key}, pos=${pos + 1})"
+                  <li th:replace="this :: submenu(submenu=${childs}, parent=${entry}, pos=${pos + 1})"
                       class="s"
                       >
                     <strong class="s">Overview</strong>