Browse Source

add login link

matsutani 9 years ago
parent
commit
add2048432

+ 2 - 0
src/main/java/org/codelibs/fess/app/web/base/FessSearchAction.java

@@ -121,6 +121,8 @@ public abstract class FessSearchAction extends FessBaseAction {
         }
         runtime.registerData("langItems", systemHelper.getLanguageItems(locale));
         runtime.registerData("username", systemHelper.getUsername());
+        
+        runtime.registerData("pageLoginLink", systemHelper.getPageLoginLink());
     }
 
     // ===================================================================================

+ 4 - 0
src/main/java/org/codelibs/fess/helper/SystemHelper.java

@@ -288,4 +288,8 @@ public class SystemHelper implements Serializable {
     protected String createSearchRole(final String type, final String name) {
         return type + name;
     }
+    
+    public String getPageLoginLink() {
+        return ComponentUtil.getFessConfig().getPageLoginLink();
+    }
 }

+ 4 - 1
src/main/resources/fess_config.properties

@@ -289,6 +289,9 @@ paging.page.range.size = 3
 # The option 'fillLimit' of page range for paging
 paging.page.range.fill.limit = true
 
+# The option 'loginLink' of page link button for search page
+page.login.link = true
+
 # fetch page size
 page.docboost.max.fetch.size=1000
 page.keymatch.max.fetch.size=1000
@@ -372,7 +375,7 @@ online.help.name.crawlinginfo=crawlinginfo
 online.help.name.backup=backup
 online.help.name.upgrade=upgrade
 
-online.help.supported.langs=ja
+online.help.supported.langs=
 
 # ----------------------------------------------------------
 #                                                    Suggest

+ 10 - 1
src/main/webapp/WEB-INF/view/header.jsp

@@ -1,5 +1,6 @@
 <%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
-<la:form action="/search" method="get" styleId="searchForm" role="search">
+<la:form action="/search" method="get" styleId="searchForm"
+	role="search">
 ${fe:facetForm()}${fe:geoForm()}
 <nav class="navbar navbar-dark bg-inverse navbar-fixed-top">
 		<la:link styleClass="navbar-brand" href="/">
@@ -25,6 +26,14 @@ ${fe:facetForm()}${fe:geoForm()}
 					</div>
 				</li>
 			</c:if>
+			<c:if test="${ pageLoginLink == 'true'}">
+				<li class="nav-item username"><la:link href="/login"
+						styleClass="nav-link" role="button" aria-haspopup="true"
+						aria-expanded="false">
+						<i class="fa fa-user"></i>
+						<la:message key="labels.login" />
+					</la:link></li>
+			</c:if>
 		</ul>
 		<div
 			class="search-box navbar-form col-lg-5 col-md-6 col-sm-6 col-xs-8 pull-right"

+ 8 - 0
src/main/webapp/WEB-INF/view/index.jsp

@@ -39,6 +39,14 @@
 						</div>
 					</li>
 				</c:if>
+				<c:if test="${ pageLoginLink == 'true'}">
+					<li class="nav-item username"><la:link href="/login"
+							styleClass="nav-link" role="button" aria-haspopup="true"
+							aria-expanded="false">
+							<i class="fa fa-user"></i>
+							<la:message key="labels.login" />
+						</la:link></li>
+				</c:if>
 				<li class="nav-item"><la:link href="/help"
 						styleClass="nav-link help-link">
 						<i class="fa fa-question-circle"></i>