xingong-header.jsp 5.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. <div class="header-search-group">
  27. <c:if test="${xingongHomePage}">
  28. <c:set var="xgSchoolHomeFound" value="${false}" scope="request"/>
  29. <c:forEach items="${deptTopLinksNmv.articleList}" var="item">
  30. <c:if test="${item.title eq '学校首页'}">
  31. <c:set var="xgSchoolHomeFound" value="${true}" scope="request"/>
  32. <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>
  33. </c:if>
  34. </c:forEach>
  35. <c:if test="${not xgSchoolHomeFound}">
  36. <a class="school-home-link" href="https://www.gzhxtc.edu.cn/" target="_blank" rel="noopener"><span>学校首页</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>
  37. </c:if>
  38. </c:if>
  39. <form class="search" action="/search" method="get" role="search">
  40. <input type="search" name="str" value="${fn:escapeXml(str)}" placeholder="搜索文章…" aria-label="站内搜索">
  41. <button class="btn" type="submit" aria-label="提交搜索">
  42. <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>
  43. </button>
  44. </form>
  45. </div>
  46. <button class="xg-mobile-menu" type="button" aria-label="打开导航" aria-controls="xg-mobile-drawer" aria-expanded="false"><span></span><span></span><span></span></button>
  47. </div>
  48. </header>
  49. <nav class="nav" aria-label="主导航">
  50. <ul>
  51. <c:forEach items="${navList}" var="item">
  52. <c:if test="${item.name ne '首页子栏目'}">
  53. <li class="${not empty item.children ? 'has-children' : ''}${(empty navigation and item.name eq '首页') or item.navigationid eq navigation.navigationid or item.navigationid eq navigation.parentNid ? ' on' : ''}">
  54. <a href="${empty item.href ? (empty item.children ? '/' : item.children[0].href) : item.href}" target="${item.target}">${item.name}</a>
  55. <c:if test="${not empty item.children}">
  56. <ul class="xg-nav-panel">
  57. <c:forEach items="${item.children}" var="child">
  58. <li><a href="${child.href}" target="${child.target}">${child.name}</a></li>
  59. </c:forEach>
  60. </ul>
  61. </c:if>
  62. </li>
  63. </c:if>
  64. </c:forEach>
  65. </ul>
  66. </nav>
  67. <div class="xg-drawer-layer" id="xg-mobile-drawer" hidden>
  68. <button class="xg-drawer-mask" type="button" aria-label="关闭导航"></button>
  69. <aside class="xg-drawer" aria-label="移动端导航">
  70. <div class="xg-drawer-head"><strong>${xgDisplayTitle}</strong><button type="button" aria-label="关闭导航">×</button></div>
  71. <nav class="xg-drawer-nav">
  72. <a href="/">首页</a>
  73. <c:forEach items="${navList}" var="item">
  74. <c:if test="${item.name ne '首页子栏目'}">
  75. <a href="${empty item.href ? (empty item.children ? '/' : item.children[0].href) : item.href}" target="${item.target}">${item.name}</a>
  76. <c:if test="${not empty item.children}">
  77. <div class="xg-drawer-children">
  78. <c:forEach items="${item.children}" var="child"><a href="${child.href}" target="${child.target}">${child.name}</a></c:forEach>
  79. </div>
  80. </c:if>
  81. </c:if>
  82. </c:forEach>
  83. </nav>
  84. </aside>
  85. </div>