Test-Inhalte in ein anderes Verzeichnis (/potemkin/) verschoben
[website] / dist / templates / layout.html
index caaca4a..36b9535 100644 (file)
@@ -26,7 +26,8 @@
     <script src="../js/less-1.7.0.min.js" th:remove="all"></script>
   </head>
   <body
     <script src="../js/less-1.7.0.min.js" th:remove="all"></script>
   </head>
   <body
-      th:with="crumbs=${crumbs.get(uri)}"
+      juplo:variables="${json}"
+      th:with="page=${pages.get(uri)},crumbs=${page['crumbs']}"
       id="top"
       class="menu"
       th:class="${contentclass}?:'menu'"
       id="top"
       class="menu"
       th:class="${contentclass}?:'menu'"
           <div th:fragment="maincontent">
             <p>
               <strong>Lorem ipsum</strong> dolor
           <div th:fragment="maincontent">
             <p>
               <strong>Lorem ipsum</strong> dolor
-              <a href="../projects/typo.html" th:href="@{/projects/typo.html}">sit amet</a>,
+              <a href="../potemkin/typo.html" th:href="@{/potemkin/typo.html}">sit amet</a>,
               consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
               labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
               consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
               labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
-              <a href="#" th:href="@{/projects/html-experimente.html}">exercitation</a>
+              <a href="../potemkin/html-experimente.html" th:href="@{/potemkin/html-experimente.html}">exercitation</a>
               ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute
               irure dolor in reprehenderit in voluptate velit esse cillum dolore
               eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
               ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute
               irure dolor in reprehenderit in voluptate velit esse cillum dolore
               eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
             <h1 class="nav">Navigation</h1>
             <h2 class="nav menu">Section-Menu</h2>
             <ul id="menu" class="cf">
             <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.value.key}">
-                <a href="../blog.html" th:href="@{${entry.key}}" class="m" th:class="${entry.key == section.uri} ? 'm selected' : 'm'" th:text="${entry.value.name}">Blog</a>
+              <li class="m blog" th:each="entry : ${sections}" th:class="'m ' + ${entry.key}">
+                <a href="../blog.html" 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>
               <!--/*-->
               <li class="m projects"><a href="../projects" class="m selected">Projects</a></li>
               </li>
               <!--/*-->
               <li class="m projects"><a href="../projects" class="m selected">Projects</a></li>
             </h2>
             <ul layout:fragment="submenu"
                 th:with="
             </h2>
             <ul layout:fragment="submenu"
                 th:with="
-                  submenu=${menu[section.uri]},
-                  parent=${(crumbs.size() == 2 and submenu.get(uri)['childs'] == null) ? crumbs[0].uri : null},
+                  len=${crumbs.size()},
+                  submenu=${pages[section.uri]['childs']},
+                  parent=${crumbs[0].uri},
                   pos=1"
                 id="submenu"
                 class="s"
                   pos=1"
                 id="submenu"
                 class="s"
+                th:class="'s' + (${len == 1 or (len == 2 and page['childs'] == null)} ? ' selected' : '')"
                 >
               <li th:fragment="submenu(submenu, parent, pos)"
                   th:each="entry : ${submenu}"
                   th:with="
                 >
               <li th:fragment="submenu(submenu, parent, pos)"
                   th:each="entry : ${submenu}"
                   th:with="
-                      child=${pos == crumbs.size()},
+                      child=${pos == len},
                       selected=${!child and crumbs.get(pos).uri == entry.key},
                       selected=${!child and crumbs.get(pos).uri == entry.key},
-                      last=${crumbs.get(pos-1).uri == parent and crumbs.size() &gt; pos},
-                      childs=${entry.value['childs']}
+                      sibling=${pos + 1 == len and (page['childs'] == null or uri == parent)},
+                      childs=${entry.key == parent ? null : pages[entry.key]['childs']}
                       "
                   class="s sub"
                       "
                   class="s sub"
-                  th:class="'s' + (${childs} ? ' sub' : '') + (${selected or last or child} ? '' : ' off')"
+                  th:class="'s' + (${childs} ? ' sub' : '') + (${selected or sibling or child} ? '' : ' off')"
                   >
                   >
-                <a  href="../projects/fix-swf.html"
+                <a  href="../potemkin/fix-swf.html"
                     th:href="@{${entry.key}}"
                     class="s selected"
                     th:class="${selected} ? 's selected' : 's'"
                     th:href="@{${entry.key}}"
                     class="s selected"
                     th:class="${selected} ? 's selected' : 's'"
-                    th:text="${entry.value.name}"
+                    th:text="${entry.value}"
                     >fix-swf</a>
                 <ul th:if="${selected and childs != null}"
                     class="s active"
                     >fix-swf</a>
                 <ul th:if="${selected and childs != null}"
                     class="s active"
-                    th:class="${selected} ? 's active' : 's'"
+                    th:class="'s' + (${selected} ? ' active' : '') + (${entry.key == uri or (len &gt; 1 and entry.key == crumbs.get(len-2).uri and page['childs'] == null)} ? ' selected' : '')"
                     >
                   <li th:replace="templates/layout :: submenu(submenu=${childs}, parent=${entry.key}, pos=${pos + 1})"
                       class="s"
                     >
                   <li th:replace="templates/layout :: submenu(submenu=${childs}, parent=${entry.key}, pos=${pos + 1})"
                       class="s"
                     <strong class="s">Overview</strong>
                   </li>
                   <!--/*-->
                     <strong class="s">Overview</strong>
                   </li>
                   <!--/*-->
-                  <li class="s"><a href="../projects/fix-swf/getting-started.html" class="s">Getting Started</a></li>
+                  <li class="s"><a href="../potemkin/fix-swf/getting-started.html" class="s">Getting Started</a></li>
                   <li class="s"><a href="#" class="s">FAQ</a></li>
                   <li class="s"><a href="#" class="s">Documentation</a></li>
                   <!--*/-->
                   <li class="s"><a href="#" class="s">FAQ</a></li>
                   <li class="s"><a href="#" class="s">Documentation</a></li>
                   <!--*/-->
               <!--/*-->
               <li class="s sub off"><a href="#" class="s">hibernate4-maven-plugin</a></li>
               <li class="s off"><a href="#" class="s">jquery.openx</a></li>
               <!--/*-->
               <li class="s sub off"><a href="#" class="s">hibernate4-maven-plugin</a></li>
               <li class="s off"><a href="#" class="s">jquery.openx</a></li>
-              <li class="s sub off"><a href="../projects/html-experimente.html" th:href="@{/projects/html-experimente.html}" class="s">HTML-Experimente</a></li>
+              <li class="s sub off"><a href="../potemkin/html-experimente.html" th:href="@{/potemkin/html-experimente.html}" class="s">HTML-Experimente</a></li>
               <li class="s sub off"><a href="#" class="s">accelerator</a></li>
               <li class="s sub off"><a href="#" class="s">accelerator</a></li>
-              <li class="s off"><a href="../projects/typo.html" th:href="@{/projects/typo.html}" class="s">Typography</a></li>
+              <li class="s off"><a href="../potemkin/typo.html" th:href="@{/potemkin/typo.html}" class="s">Typography</a></li>
               <!--*/-->
             </ul>
             <hr class="n"/>
               <!--*/-->
             </ul>
             <hr class="n"/>