doortts doortts 2017-07-11
list: Update search field message and add autofocus
@0f95473dc004e0c5f060db1f1cbbf883374bac29
app/models/Organization.java
--- app/models/Organization.java
+++ app/models/Organization.java
@@ -20,6 +20,7 @@
  */
 package models;
 
+import com.avaje.ebean.Expr;
 import com.avaje.ebean.Page;
 import com.avaje.ebean.PagingList;
 import controllers.Application;
@@ -79,8 +80,10 @@
     }
 
     public static PagingList<Organization> findByNameLike(String name) {
-        return find.where().ilike("name", "%" + name + "%")
-                .findPagingList(30);
+        return find.where().or(
+                Expr.like("name", "%" + name + "%"),
+                Expr.like("descr", "%" + name + "%")
+        ).findPagingList(30);
     }
 
     public static boolean isNameExist(String name) {
app/views/organization/list.scala.html
--- app/views/organization/list.scala.html
+++ app/views/organization/list.scala.html
@@ -33,7 +33,7 @@
     		<div id="search" class="pull-left">
     			<form action="@routes.OrganizationApp.orgList()" method="get">
     				<div class="search-bar">
-                        <input name="filter" class="textbox" type="text" placeholder="@Messages("site.project.filter")" value="@filter">
+                        <input name="filter" class="textbox" type="text" placeholder="@Messages("site.organization.filter")" value="@filter" autofocus>
                         <button type="submit" class="search-btn"><i class="yobicon-search"></i></button>
                     </div>
     			</form>
app/views/project/list.scala.html
--- app/views/project/list.scala.html
+++ app/views/project/list.scala.html
@@ -29,7 +29,8 @@
     		<div id="search" class="pull-left">
     			<form action="@routes.ProjectApp.projects()" method="get">
     				<div class="search-bar">
-                        <input name="filter" class="textbox" type="text" placeholder="@Messages("site.project.filter")" value="@filter">
+                        <input name="filter" class="textbox" type="text" placeholder="@Messages("site.project" +
+                                ".filter")" value="@filter" autofocus>
                         <button type="submit" class="search-btn"><i class="yobicon-search"></i></button>
                     </div>
     			</form>
conf/messages
--- conf/messages
+++ conf/messages
@@ -840,7 +840,7 @@
 site.organization.filter = Find organization by name
 site.project.delete = Delete project
 site.project.deleteConfirm = Do you really want to delete this project?
-site.project.filter = Find project by name
+site.project.filter = Search by keyword
 site.resetPasswordEmail.invalidRequest = Invalid password reset request
 site.resetPasswordEmail.wrongUrl = Wrong url to reset password.
 site.resetPasswordEmail.mailContents = Copy the following URL and paste it to browser''s URL bar
conf/messages.ko-KR
--- conf/messages.ko-KR
+++ conf/messages.ko-KR
@@ -831,10 +831,10 @@
 site.massMail.loading = 불러오는중...
 site.massMail.toAll = 모두에게
 site.massMail.toProjects = 특정 프로젝트의 멤버들에게
-site.organization.filter = 그룹 이름으로 찾기
+site.organization.filter = 키워드로 그룹 찾기
 site.project.delete = 프로젝트 삭제
 site.project.deleteConfirm = 정말로 해당 프로젝트를 사이트에서 삭제하겠습니까?
-site.project.filter = 프로젝트 이름으로 찾기
+site.project.filter = 키워드로 프로젝트 찾기
 site.resetPasswordEmail.invalidRequest = 잘못된 비밀번호 재 설정 요청입니다.
 site.resetPasswordEmail.wrongUrl = 비밀번호 재설정 URL이 잘못되었습니다.
 site.resetPasswordEmail.mailContents = 아래 URL을 브라우저 주소창에 붙여 넣으세요
Add a comment
List