This commit is contained in:
Shinsuke Sugaya 2014-03-04 23:48:04 +09:00
parent 7a83663782
commit d9b441a374
6 changed files with 105 additions and 4 deletions

View file

@ -51,6 +51,7 @@ import jp.sf.fess.db.exentity.ClickLog;
import jp.sf.fess.db.exentity.SearchLog;
import jp.sf.fess.db.exentity.UserInfo;
import jp.sf.fess.entity.FieldAnalysisResponse;
import jp.sf.fess.entity.LoginInfo;
import jp.sf.fess.entity.SuggestResponse;
import jp.sf.fess.form.IndexForm;
import jp.sf.fess.helper.BrowserTypeHelper;
@ -80,6 +81,7 @@ import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.codelibs.core.util.DynamicProperties;
import org.codelibs.core.util.StringUtil;
import org.codelibs.sastruts.core.SSCConstants;
import org.codelibs.sastruts.core.exception.SSCActionMessagesException;
import org.codelibs.solr.lib.exception.SolrLibQueryException;
import org.seasar.framework.beans.util.Beans;
@ -206,6 +208,8 @@ public class IndexAction {
public boolean screenShotSupport;
public String username;
public String getPagingQuery() {
if (pagingQuery == null) {
final StringBuilder buf = new StringBuilder();
@ -1189,6 +1193,14 @@ public class IndexAction {
favoriteSupport = Constants.TRUE.equals(crawlerProperties.getProperty(
Constants.USER_FAVORITE_PROPERTY, Constants.FALSE));
final HttpSession session = request.getSession(false);
if (session != null) {
final Object obj = session.getAttribute(SSCConstants.USER_INFO);
if (obj instanceof LoginInfo) {
final LoginInfo loginInfo = (LoginInfo) obj;
username = loginInfo.getUsername();
}
}
}
protected void buildInitParams() {

View file

@ -382,6 +382,15 @@ label.facet_filetype_powerpoint=PowerPoint
label.facet_filetype_pdf=PDF
label.facet_filetype_others=PDF
labels.searchoptions_all=All
labels.searchoptions_score=Score
labels.searchoptions_menu_sort=Sort:
labels.searchoptions_menu_num=Result Per Page:
labels.searchoptions_num={0} results
labels.searchoptions_menu_lang=Language:
labels.searchoptions_menu_labels=Labels:
labels.searchheader_username=Username: {0}
# view/error.jsp
labels.error_title=Error

View file

@ -382,6 +382,15 @@ label.facet_filetype_powerpoint=PowerPoint
label.facet_filetype_pdf=PDF
label.facet_filetype_others=\u305d\u306e\u4ed6
labels.searchoptions_all=\u3059\u3079\u3066
labels.searchoptions_score=\u30b9\u30b3\u30a2
labels.searchoptions_menu_sort=\u30bd\u30fc\u30c8:
labels.searchoptions_menu_num=\u8868\u793a\u4ef6\u6570:
labels.searchoptions_num={0} \u4ef6
labels.searchoptions_menu_lang=\u8a00\u8a9e:
labels.searchoptions_menu_labels=\u30e9\u30d9\u30eb:
labels.searchheader_username=\u30e6\u30fc\u30b6\u30fc\u540d: {0}
# view/error.jsp
labels.error_title=\u30a8\u30e9\u30fc

View file

@ -1,5 +1,5 @@
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<s:form action="search" method="get" styleId="searchForm">
<s:form action="search" method="get" styleId="searchForm" styleClass="searchResultForm">
${fe:facetForm()}${fe:mltForm()}${fe:geoForm()}
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">

View file

@ -21,7 +21,62 @@
<jsp:include page="header.jsp" />
<div class="container">
<div class="row">
<c:if test="${fe:hswsize(null) != 0}">
<div class="span9">
<p id="searchOptionMenu" class="ellipsis">
<span>
<bean:message key="labels.searchoptions_menu_sort" />
<c:if test="${empty sort}"><bean:message key="labels.searchoptions_score" /></c:if>
<c:if test="${sort=='created.asc'}"><bean:message key="labels.search_result_sort_created_asc" /></c:if>
<c:if test="${sort=='created.desc'}"><bean:message key="labels.search_result_sort_created_desc" /></c:if>
<c:if test="${sort=='contentLength.asc'}"><bean:message key="labels.search_result_sort_contentLength_asc" /></c:if>
<c:if test="${sort=='contentLength.desc'}"><bean:message key="labels.search_result_sort_contentLength_desc" /></c:if>
<c:if test="${sort=='lastModified.asc'}"><bean:message key="labels.search_result_sort_lastModified_asc" /></c:if>
<c:if test="${sort=='lastModified.desc'}"><bean:message key="labels.search_result_sort_lastModified_desc" /></c:if>
<c:if test="${sort=='clickCount_l_x_dv.asc'}"><bean:message key="labels.search_result_sort_clickCount_asc" /></c:if>
<c:if test="${sort=='clickCount_l_x_dv.desc'}"><bean:message key="labels.search_result_sort_clickCount_desc" /></c:if>
<c:if test="${sort=='favoriteCount_l_x_dv.asc'}"><bean:message key="labels.search_result_sort_favoriteCount_asc" /></c:if>
<c:if test="${sort=='favoriteCount_l_x_dv.desc'}"><bean:message key="labels.search_result_sort_favoriteCount_desc" /></c:if>
</span>
<span>
<bean:message key="labels.searchoptions_menu_num" />
<bean:message key="labels.searchoptions_num" arg0="${f:h(num)}" />
</span>
<span>
<bean:message key="labels.searchoptions_menu_lang" />
<c:if test="${empty lang}"><bean:message key="labels.searchoptions_all" /></c:if>
<c:if test="${!empty lang}">
<c:forEach var="sLang" items="${lang}">
<c:forEach var="item" items="${langItems}">
<c:if test="${item.value==sLang}">${f:h(item.label)}</c:if>
</c:forEach>
</c:forEach>
</c:if>
</span>
<c:if test="${displayLabelTypeItems}">
<span>
<bean:message key="labels.searchoptions_menu_labels" />
<c:if test="${empty fields.label}"><bean:message key="labels.searchoptions_all" /></c:if>
<c:if test="${!empty fields.label}">
<c:forEach var="sLabel" items="${fields.label}">
<c:forEach var="item" items="${labelTypeItems}">
<c:if test="${item.value==sLabel}">${f:h(item.label)}</c:if>
</c:forEach>
</c:forEach>
</c:if>
</span>
</c:if>
</p>
</div>
<div class="span3">
<c:if test="${!empty username}">
<p class="username">
<bean:message key="labels.searchheader_username" arg0="${f:h(username)}" />
</p>
</c:if>
</div>
</div>
<c:if test="${fe:hswsize(null) != 0}">
<div class="row">
<div class="span12">
<p class="hotSearchWordBody ellipsis">
<bean:message key="labels.search_hot_search_word" />
@ -30,8 +85,8 @@
</c:forEach>
</p>
</div>
</c:if>
</div>
</div>
</c:if>
<c:choose>
<c:when test="${f:h(allRecordCount) != 0}">
<jsp:include page="searchResults.jsp" />

View file

@ -4,6 +4,10 @@
min-height: 500px;
}
body {
padding-top:55px;
}
h1,
h2,
h3 {
@ -95,6 +99,18 @@ h3 {
-o-text-overflow: ellipsis;
}
.searchResultForm {
margin:0;
}
#searchOptionMenu span {
margin-right:10px;
}
.username {
text-align:right;
}
/* Large desktop */
@media (min-width: 1200px) {
#query {