Quellcode durchsuchen

修复图文列表缩略图校验

将文章保存时的图文列表缩略图校验从指定红色模板扩展为所有显示方式为图文列表的栏目,发布栏目和抄送栏目都会要求上传缩略图。

调整非繁二级网站模板-红色的首页动态栏目渲染,轮播和网格样式在文章没有缩略图时显示统一占位,不再使用默认校园图顶替。

Validation:

- javac -encoding UTF-8 -cp WebRoot/WEB-INF/classes:WebRoot/WEB-INF/lib/* -d WebRoot/WEB-INF/classes src/space/apps/moudules/website/services/ArticleService.java

- git diff --staged --check

- ./local-run/bin/status-full-local.sh
非繁 vor 5 Monaten
Ursprung
Commit
937fed1339

+ 12 - 6
WebRoot/web/upload/ffkj-template/college-red-index.jsp

@@ -96,6 +96,16 @@
 			font-size: 12px;
 			font-style: normal;
 		}
+		.college-red-page .department-section-slide > em {
+			display: flex;
+			width: 100%;
+			height: 100%;
+			align-items: center;
+			justify-content: center;
+			color: var(--hx-muted);
+			font-size: 13px;
+			font-style: normal;
+		}
 		.college-red-page .department-notice-panel .department-major-graphic-list .department-section-copy {
 			min-width: 0;
 		}
@@ -250,10 +260,8 @@
 												<div class="department-section-carousel" aria-label="${sectionNav.name}轮播">
 													<c:forEach items="${homeSection.articleList}" var="item" varStatus="vs">
 														<c:if test="${vs.count le 5}">
-															<c:set var="sectionImage" value="${assetBase}/official/campus-2.jpg"/>
-															<c:if test="${not empty item.thumbnail}"><c:set var="sectionImage" value="${item.thumbnail}"/></c:if>
 															<a class="department-section-slide ${vs.first ? 'active' : ''}" href="${item.url}" target="${item.target}">
-																<img src="${sectionImage}" alt="${item.title}">
+																<c:choose><c:when test="${not empty item.thumbnail}"><img src="${item.thumbnail}" alt="${item.title}"></c:when><c:otherwise><em>暂无缩略图</em></c:otherwise></c:choose>
 																<span><strong>${item.title}</strong></span>
 															</a>
 														</c:if>
@@ -278,9 +286,7 @@
 												<ul class="department-section-media-grid">
 													<c:forEach items="${homeSection.articleList}" var="item" varStatus="vs">
 														<c:if test="${vs.count le 4}">
-															<c:set var="sectionImage" value="${assetBase}/official/campus-2.jpg"/>
-															<c:if test="${not empty item.thumbnail}"><c:set var="sectionImage" value="${item.thumbnail}"/></c:if>
-															<li><a href="${item.url}" target="${item.target}"><span class="department-section-thumb"><img src="${sectionImage}" alt="${item.title}"></span><b>${item.title}</b></a></li>
+															<li><a href="${item.url}" target="${item.target}"><span class="department-section-thumb"><c:choose><c:when test="${not empty item.thumbnail}"><img src="${item.thumbnail}" alt="${item.title}"></c:when><c:otherwise><em>暂无缩略图</em></c:otherwise></c:choose></span><b>${item.title}</b></a></li>
 														</c:if>
 													</c:forEach>
 												</ul>

+ 1 - 1
src/space/apps/moudules/website/services/ArticleService.java

@@ -445,7 +445,7 @@ public class ArticleService extends BaseTransaction {
 
     private boolean verifyGraphicListThumbnailRequired(GeneralDBAccess gdba, WebsiteNavigation wn, Article article,
             String targetName) throws Exception {
-        if (!isCollegeRedGraphicListNavigation(gdba, wn)) {
+        if (wn == null || !NAVIGATION_STYLE_GRAPHIC_LIST.equals(wn.getWnlscode())) {
             return true;
         }