dept-red-index.jsp 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=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="defaultDeptImage" value="/main/ffkj-portal/news-red/hero-building.jpg"/>
  5. <!doctype html>
  6. <html lang="zh-CN">
  7. <head>
  8. <meta charset="UTF-8">
  9. <meta name="viewport" content="width=device-width, initial-scale=1">
  10. <meta name="keywords" content="${website.seoKeywords}">
  11. <meta name="description" content="${website.seoDescription}">
  12. <title>${website.seoTitle}</title>
  13. <link rel="stylesheet" href="/main/ffkj-portal/dept-red.css?v=20261019-footer-1">
  14. </head>
  15. <body class="screen-red-theme dept-red-page">
  16. <%@ include file="dept-red-header.jsp"%>
  17. <main id="home" class="dept-home-main">
  18. <section class="section dept-hero-notice-section">
  19. <div class="dept-hero-notice-grid">
  20. <div class="dept-hero-carousel" data-dept-hero-carousel>
  21. <div class="dept-hero-slides">
  22. <c:forEach items="${deptHeroNmv.articleList}" var="item" varStatus="vs">
  23. <a class="dept-hero-slide${vs.first ? ' is-active' : ''}" data-dept-hero-slide="${vs.index}" href="${item.url}" target="${item.target}" aria-hidden="${vs.first ? 'false' : 'true'}">
  24. <img src="${empty item.thumbnail ? defaultDeptImage : item.thumbnail}" alt="${item.title}">
  25. <span><strong>${item.title}</strong></span>
  26. </a>
  27. </c:forEach>
  28. <c:if test="${empty deptHeroNmv.articleList}">
  29. <a class="dept-hero-slide is-active" href="/"><img src="${defaultDeptImage}" alt="${website.name}"><span><strong>${website.name}</strong></span></a>
  30. </c:if>
  31. </div>
  32. <c:if test="${fn:length(deptHeroNmv.articleList) > 1}">
  33. <button class="dept-hero-arrow prev" type="button" aria-label="上一张">‹</button>
  34. <button class="dept-hero-arrow next" type="button" aria-label="下一张">›</button>
  35. <div class="dept-hero-dots">
  36. <c:forEach items="${deptHeroNmv.articleList}" var="item" varStatus="vs"><button type="button" class="${vs.first ? 'is-active' : ''}" data-dept-hero-dot="${vs.index}" aria-label="切换到第 ${vs.count} 张"></button></c:forEach>
  37. </div>
  38. </c:if>
  39. </div>
  40. <div class="dept-notice-panel">
  41. <div class="section-title dept-notice-title">
  42. <h2>${empty deptNoticeNmv.navigationMap.name ? '公告' : deptNoticeNmv.navigationMap.name}</h2>
  43. <em>${empty deptNoticeNmv.navigationMap.nameAssistant ? 'NOTICES' : deptNoticeNmv.navigationMap.nameAssistant}</em>
  44. <c:if test="${not empty deptNoticeNmv.navigationMap.href}"><a class="more" href="${deptNoticeNmv.navigationMap.href}" target="${deptNoticeNmv.navigationMap.target}">更多 →</a></c:if>
  45. </div>
  46. <ul class="plain-list dept-notice-list">
  47. <c:forEach items="${deptNoticeNmv.articleList}" var="item">
  48. <li><a href="${item.url}" target="${item.target}">${item.title}<time>${fn:substring(item.release_time, 5, 10)}</time></a></li>
  49. </c:forEach>
  50. </ul>
  51. <c:if test="${empty deptNoticeNmv.articleList}"><div class="empty-line">暂无公告</div></c:if>
  52. </div>
  53. </div>
  54. </section>
  55. <c:forEach items="${deptHomeSections}" var="section" varStatus="sectionVs">
  56. <c:set var="sectionNav" value="${section.navigationMap}"/>
  57. <c:if test="${sectionNav.idcard eq 'FFKJ_DEPT_HOME_MAJOR'}">
  58. <section class="section dept-major-showcase-section">
  59. <div class="dept-two-module-grid">
  60. <article class="dept-side-module dept-major-panel">
  61. <div class="section-title">
  62. <h2>${empty deptMajorNmv.navigationMap.name ? '专业建设' : deptMajorNmv.navigationMap.name}</h2>
  63. <em>${empty deptMajorNmv.navigationMap.nameAssistant ? 'MAJORS' : deptMajorNmv.navigationMap.nameAssistant}</em>
  64. <c:if test="${not empty deptMajorNmv.navigationMap.href}"><a class="more" href="${deptMajorNmv.navigationMap.href}" target="${deptMajorNmv.navigationMap.target}">更多 →</a></c:if>
  65. </div>
  66. <ul class="plain-list dept-side-list">
  67. <c:forEach items="${deptMajorNmv.articleList}" var="item">
  68. <li><a href="${item.url}" target="${item.target}">${item.title}<time>${fn:substring(item.release_time, 0, 10)}</time></a></li>
  69. </c:forEach>
  70. </ul>
  71. <c:if test="${empty deptMajorNmv.articleList}"><div class="empty-line">暂无内容</div></c:if>
  72. </article>
  73. <article class="dept-side-module dept-showcase-panel">
  74. <div class="section-title">
  75. <h2>${empty deptShowcaseNmv.navigationMap.name ? '学院风采' : deptShowcaseNmv.navigationMap.name}</h2>
  76. <em>${empty deptShowcaseNmv.navigationMap.nameAssistant ? 'CAMPUS LIFE' : deptShowcaseNmv.navigationMap.nameAssistant}</em>
  77. <c:if test="${not empty deptShowcaseNmv.navigationMap.href}"><a class="more" href="${deptShowcaseNmv.navigationMap.href}" target="${deptShowcaseNmv.navigationMap.target}">更多 →</a></c:if>
  78. </div>
  79. <div class="dept-card-grid dept-showcase-grid">
  80. <c:forEach items="${deptShowcaseNmv.articleList}" var="item">
  81. <a class="dept-card dept-showcase-card" href="${item.url}" target="${item.target}">
  82. <c:if test="${not empty item.thumbnail}"><img src="${item.thumbnail}" alt="${item.title}"></c:if>
  83. <span><strong>${item.title}</strong></span>
  84. </a>
  85. </c:forEach>
  86. </div>
  87. <c:if test="${empty deptShowcaseNmv.articleList}"><div class="empty-line">暂无内容</div></c:if>
  88. </article>
  89. </div>
  90. </section>
  91. </c:if>
  92. <c:if test="${sectionNav.idcard ne 'FFKJ_DEPT_HOME_HERO' and sectionNav.idcard ne 'FFKJ_DEPT_HOME_NOTICE' and sectionNav.idcard ne 'FFKJ_DEPT_HOME_NEWS' and sectionNav.idcard ne 'FFKJ_DEPT_HOME_MAJOR' and sectionNav.idcard ne 'FFKJ_DEPT_HOME_SHOWCASE'}">
  93. <section class="section dept-home-section dept-section-${sectionNav.idcard}" id="section-${sectionVs.index}">
  94. <div class="section-title">
  95. <h2>${sectionNav.name}</h2>
  96. <em>${empty sectionNav.nameAssistant ? 'DEPARTMENT' : sectionNav.nameAssistant}</em>
  97. <c:if test="${not empty sectionNav.href}"><a class="more" href="${sectionNav.href}" target="${sectionNav.target}">更多 →</a></c:if>
  98. </div>
  99. <c:choose>
  100. <c:when test="${sectionNav.idcard eq 'FFKJ_DEPT_HOME_VIDEO' or sectionNav.wnlscode eq 10050}">
  101. <div class="media-grid dept-media-grid">
  102. <c:forEach items="${section.articleList}" var="item">
  103. <a class="media-card dept-media-card" href="${item.url}" target="${item.target}">
  104. <img src="${empty item.thumbnail ? defaultDeptImage : item.thumbnail}" alt="${item.title}">
  105. <div class="meta"><small class="is-video">视频</small><h3>${item.title}</h3><time>${fn:substring(item.release_time, 0, 10)}</time></div>
  106. </a>
  107. </c:forEach>
  108. </div>
  109. </c:when>
  110. <c:when test="${sectionNav.idcard eq 'FFKJ_DEPT_HOME_AWARDS' or sectionNav.idcard eq 'FFKJ_DEPT_HOME_SHOWCASE' or sectionNav.wnlscode eq 10010}">
  111. <div class="dept-card-grid">
  112. <c:forEach items="${section.articleList}" var="item">
  113. <a class="dept-card" href="${item.url}" target="${item.target}">
  114. <c:if test="${not empty item.thumbnail}"><img src="${item.thumbnail}" alt="${item.title}"></c:if>
  115. <span><strong>${item.title}</strong><time>${fn:substring(item.release_time, 0, 10)}</time></span>
  116. </a>
  117. </c:forEach>
  118. </div>
  119. </c:when>
  120. <c:otherwise>
  121. <ul class="plain-list dept-news-list">
  122. <c:forEach items="${section.articleList}" var="item">
  123. <li><a href="${item.url}" target="${item.target}">${item.title}<time>${fn:substring(item.release_time, 0, 10)}</time></a></li>
  124. </c:forEach>
  125. </ul>
  126. </c:otherwise>
  127. </c:choose>
  128. <c:if test="${empty section.articleList}"><div class="empty-line">暂无内容</div></c:if>
  129. </section>
  130. </c:if>
  131. </c:forEach>
  132. </main>
  133. <%@ include file="dept-red-footer.jsp"%>
  134. <script>
  135. (function () {
  136. var root = document.querySelector('[data-dept-hero-carousel]');
  137. if (!root) return;
  138. var slides = Array.prototype.slice.call(root.querySelectorAll('[data-dept-hero-slide]'));
  139. var dots = Array.prototype.slice.call(root.querySelectorAll('[data-dept-hero-dot]'));
  140. var current = 0;
  141. var timer = null;
  142. if (slides.length < 2) return;
  143. function activate(index) {
  144. current = (index + slides.length) % slides.length;
  145. slides.forEach(function (slide, i) {
  146. slide.classList.toggle('is-active', i === current);
  147. slide.setAttribute('aria-hidden', i === current ? 'false' : 'true');
  148. });
  149. dots.forEach(function (dot, i) { dot.classList.toggle('is-active', i === current); });
  150. }
  151. function stop() { if (timer) { window.clearInterval(timer); timer = null; } }
  152. function start() { stop(); timer = window.setInterval(function () { activate(current + 1); }, 5200); }
  153. root.querySelector('.dept-hero-arrow.prev').addEventListener('click', function () { activate(current - 1); start(); });
  154. root.querySelector('.dept-hero-arrow.next').addEventListener('click', function () { activate(current + 1); start(); });
  155. dots.forEach(function (dot) {
  156. dot.addEventListener('click', function () { activate(Number(dot.getAttribute('data-dept-hero-dot'))); start(); });
  157. });
  158. root.addEventListener('mouseenter', stop);
  159. root.addEventListener('mouseleave', start);
  160. activate(0);
  161. start();
  162. })();
  163. </script>
  164. </body>
  165. </html>