Просмотр исходного кода

调整学校首页入口到搜索框上方

将首页头部改为右侧纵向搜索组,学校首页位于搜索框上方并右对齐;移动端搜索框仍与三横线菜单同排。同步更新 CSS 缓存版本。

Validation: 1440px 和 390px 下均满足入口在搜索框上方、右边缘对齐;详情页不显示;无横向溢出。
非繁 1 месяц назад
Родитель
Сommit
a0f922e598

+ 10 - 7
WebRoot/main/ffkj-portal/xingong-blue.css

@@ -507,13 +507,16 @@ ul.list li .ds{font-size:12.5px;color:var(--ink-3);margin-top:4px;line-height:1.
   .tabbox .sec-title>.more{order:2;margin-left:auto}
 }
 
-/* 首页右上角学校主站入口:数据来自“顶部链接”栏目文章 */
-.school-home-link{display:inline-flex;align-items:center;gap:5px;margin-left:auto;padding:6px 9px;border-bottom:1px solid transparent;color:#fff;font-size:13px;line-height:1.2;white-space:nowrap;transition:color .18s ease,border-color .18s ease}
+/* 首页右上角学校主站入口:位于搜索框上方并右对齐 */
+.header-search-group{display:flex;width:238px;flex:0 0 238px;flex-direction:column;align-items:stretch;gap:6px;min-width:0}
+.header-search-group .search{width:100%}
+.school-home-link{display:inline-flex;align-self:flex-end;align-items:center;gap:5px;padding:0 2px 3px;border-bottom:1px solid transparent;color:#fff;font-size:13px;line-height:1.2;white-space:nowrap;transition:color .18s ease,border-color .18s ease}
 .school-home-link:hover{border-bottom-color:rgba(255,255,255,.72);color:#FFE49A}
 @media (max-width:980px){
-  .header .wrap{grid-template-columns:minmax(0,1fr) auto}
-  .brand{grid-column:1;grid-row:1}
-  .school-home-link{grid-column:2;grid-row:1;align-self:center;justify-self:end;margin-left:0;padding:5px 0 5px 6px;font-size:12px}
-  .search{grid-column:1;grid-row:2}
-  .xg-mobile-menu{grid-column:2;grid-row:2;justify-self:end}
+  .header .wrap{grid-template-columns:minmax(0,1fr) 46px}
+  .brand{grid-column:1/-1;grid-row:1}
+  .header-search-group{grid-column:1;grid-row:2;width:100%;min-width:0;gap:4px}
+  .school-home-link{align-self:flex-end;padding:0 0 3px;font-size:12px}
+  .search{grid-column:auto;grid-row:auto}
+  .xg-mobile-menu{grid-column:2;grid-row:2;align-self:end;justify-self:end}
 }

+ 1 - 1
WebRoot/web/upload/ffkj-template/xingong-catalog.jsp

@@ -8,7 +8,7 @@
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta name="description" content="${navigation.desc}">
   <title>${navigation.name}_${website.seoTitle}</title>
-  <link rel="stylesheet" href="/main/ffkj-portal/xingong-blue.css?v=20261027-school-home-1">
+  <link rel="stylesheet" href="/main/ffkj-portal/xingong-blue.css?v=20261027-school-home-2">
   <%@ include file="school-schema-jsonld-include.jsp"%>
 </head>
 <body>

+ 1 - 1
WebRoot/web/upload/ffkj-template/xingong-details.jsp

@@ -7,7 +7,7 @@
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta name="description" content="${articleDescription}">
   <title>${articleTitle}_${navigation.name}_${website.seoTitle}</title>
-  <link rel="stylesheet" href="/main/ffkj-portal/xingong-blue.css?v=20261027-school-home-1">
+  <link rel="stylesheet" href="/main/ffkj-portal/xingong-blue.css?v=20261027-school-home-2">
   <%@ include file="school-schema-jsonld-include.jsp"%>
 </head>
 <body>

+ 15 - 13
WebRoot/web/upload/ffkj-template/xingong-header.jsp

@@ -23,19 +23,21 @@
         <c:otherwise><span class="brand-text-fallback"><span class="s1">${website.name}</span><span class="s2">School of Information Engineering</span></span></c:otherwise>
       </c:choose>
     </a>
-    <c:if test="${xingongHomePage}">
-      <c:forEach items="${deptTopLinksNmv.articleList}" var="item">
-        <c:if test="${item.title eq '学校首页'}">
-          <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>
-        </c:if>
-      </c:forEach>
-    </c:if>
-    <form class="search" action="/search" method="get" role="search">
-      <input type="search" name="str" value="${fn:escapeXml(str)}" placeholder="搜索文章…" aria-label="站内搜索">
-      <button class="btn" type="submit" aria-label="提交搜索">
-        <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>
-      </button>
-    </form>
+    <div class="header-search-group">
+      <c:if test="${xingongHomePage}">
+        <c:forEach items="${deptTopLinksNmv.articleList}" var="item">
+          <c:if test="${item.title eq '学校首页'}">
+            <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>
+          </c:if>
+        </c:forEach>
+      </c:if>
+      <form class="search" action="/search" method="get" role="search">
+        <input type="search" name="str" value="${fn:escapeXml(str)}" placeholder="搜索文章…" aria-label="站内搜索">
+        <button class="btn" type="submit" aria-label="提交搜索">
+          <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>
+        </button>
+      </form>
+    </div>
     <button class="xg-mobile-menu" type="button" aria-label="打开导航" aria-controls="xg-mobile-drawer" aria-expanded="false"><span></span><span></span><span></span></button>
   </div>
 </header>

+ 1 - 1
WebRoot/web/upload/ffkj-template/xingong-index.jsp

@@ -10,7 +10,7 @@
   <meta name="keywords" content="${website.seoKeywords}">
   <meta name="description" content="${website.seoDescription}">
   <title>${website.seoTitle}</title>
-  <link rel="stylesheet" href="/main/ffkj-portal/xingong-blue.css?v=20261027-school-home-1">
+  <link rel="stylesheet" href="/main/ffkj-portal/xingong-blue.css?v=20261027-school-home-2">
   <%@ include file="school-schema-jsonld-include.jsp"%>
 </head>
 <body>

+ 1 - 1
WebRoot/web/upload/ffkj-template/xingong-list.jsp

@@ -13,7 +13,7 @@
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta name="description" content="${navigation.desc}">
   <title>${navigation.name}_${website.seoTitle}</title>
-  <link rel="stylesheet" href="/main/ffkj-portal/xingong-blue.css?v=20261027-school-home-1">
+  <link rel="stylesheet" href="/main/ffkj-portal/xingong-blue.css?v=20261027-school-home-2">
   <%@ include file="school-schema-jsonld-include.jsp"%>
 </head>
 <body>

+ 1 - 1
WebRoot/web/upload/ffkj-template/xingong-search.jsp

@@ -8,7 +8,7 @@
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta name="description" content="${website.seoDescription}">
   <title>站内搜索_${website.seoTitle}</title>
-  <link rel="stylesheet" href="/main/ffkj-portal/xingong-blue.css?v=20261027-school-home-1">
+  <link rel="stylesheet" href="/main/ffkj-portal/xingong-blue.css?v=20261027-school-home-2">
   <%@ include file="school-schema-jsonld-include.jsp"%>
 </head>
 <body>