xingong-header.jsp 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <%@ page pageEncoding="UTF-8"%>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
  4. <c:set var="xgDisplayTitle" value="${empty website.seoTitle ? website.name : website.seoTitle}"/>
  5. <header class="header">
  6. <div class="wm" aria-hidden="true">
  7. <svg class="l" viewBox="0 0 300 118" fill="none" stroke="#fff" stroke-width="1.4">
  8. <circle cx="60" cy="59" r="34"/><circle cx="60" cy="59" r="20"/>
  9. <path d="M8 92 L52 60 L18 44 L60 24"/>
  10. <text x="112" y="40" fill="#fff" stroke="none" font-size="20" font-family="serif">∑ ∫ π</text>
  11. <text x="112" y="72" fill="#fff" stroke="none" font-size="16" font-family="serif">f(x)=ax²+bx+c</text>
  12. </svg>
  13. <svg class="r" viewBox="0 0 300 118" fill="none" stroke="#fff" stroke-width="1.4">
  14. <path d="M292 18 H210 V52 H150 V86 H60 M292 58 H240 V96 H150"/>
  15. <circle cx="286" cy="18" r="5"/><circle cx="286" cy="58" r="5"/><circle cx="60" cy="86" r="5"/>
  16. <rect x="150" y="42" width="34" height="20" rx="3"/><path d="M184 52 H210"/>
  17. </svg>
  18. </div>
  19. <div class="wrap">
  20. <a class="brand" href="/" aria-label="${website.name}首页">
  21. <c:choose>
  22. <c:when test="${not empty website.logo}"><img class="brand-logo-image" src="${website.logo}" alt="${website.name}"></c:when>
  23. <c:otherwise><span class="brand-text-fallback"><span class="s1">${website.name}</span><span class="s2">School of Information Engineering</span></span></c:otherwise>
  24. </c:choose>
  25. </a>
  26. <c:if test="${xingongHomePage}">
  27. <c:forEach items="${deptTopLinksNmv.articleList}" var="item">
  28. <c:if test="${item.title eq '学校首页'}">
  29. <a class="school-home-link" href="${item.url}" target="${item.target}" rel="noopener"><span>${item.title}</span><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M7 17 17 7M9 7h8v8"/></svg></a>
  30. </c:if>
  31. </c:forEach>
  32. </c:if>
  33. <form class="search" action="/search" method="get" role="search">
  34. <input type="search" name="str" value="${fn:escapeXml(str)}" placeholder="搜索文章…" aria-label="站内搜索">
  35. <button class="btn" type="submit" aria-label="提交搜索">
  36. <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.4" stroke-linecap="round"><circle cx="10.5" cy="10.5" r="7"/><path d="M20 20 l-4.6-4.6"/></svg>
  37. </button>
  38. </form>
  39. <button class="xg-mobile-menu" type="button" aria-label="打开导航" aria-controls="xg-mobile-drawer" aria-expanded="false"><span></span><span></span><span></span></button>
  40. </div>
  41. </header>
  42. <nav class="nav" aria-label="主导航">
  43. <ul>
  44. <c:forEach items="${navList}" var="item">
  45. <c:if test="${item.name ne '首页子栏目'}">
  46. <li class="${not empty item.children ? 'has-children' : ''}${empty navigation and item.name eq '首页' ? ' on' : ''}">
  47. <a href="${item.href}" target="${item.target}">${item.name}</a>
  48. <c:if test="${not empty item.children}">
  49. <ul class="xg-nav-panel">
  50. <c:forEach items="${item.children}" var="child">
  51. <li><a href="${child.href}" target="${child.target}">${child.name}</a></li>
  52. </c:forEach>
  53. </ul>
  54. </c:if>
  55. </li>
  56. </c:if>
  57. </c:forEach>
  58. </ul>
  59. </nav>
  60. <div class="xg-drawer-layer" id="xg-mobile-drawer" hidden>
  61. <button class="xg-drawer-mask" type="button" aria-label="关闭导航"></button>
  62. <aside class="xg-drawer" aria-label="移动端导航">
  63. <div class="xg-drawer-head"><strong>${xgDisplayTitle}</strong><button type="button" aria-label="关闭导航">×</button></div>
  64. <nav class="xg-drawer-nav">
  65. <a href="/">首页</a>
  66. <c:forEach items="${navList}" var="item">
  67. <c:if test="${item.name ne '首页子栏目'}">
  68. <a href="${item.href}" target="${item.target}">${item.name}</a>
  69. <c:if test="${not empty item.children}">
  70. <div class="xg-drawer-children">
  71. <c:forEach items="${item.children}" var="child"><a href="${child.href}" target="${child.target}">${child.name}</a></c:forEach>
  72. </div>
  73. </c:if>
  74. </c:if>
  75. </c:forEach>
  76. </nav>
  77. </aside>
  78. </div>