Skip to content

Commit

Permalink
list: Update search field message and add autofocus
Browse files Browse the repository at this point in the history
  • Loading branch information
doortts committed Jul 11, 2017
1 parent f4c272f commit 0f95473
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
7 changes: 5 additions & 2 deletions app/models/Organization.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/
package models;

import com.avaje.ebean.Expr;
import com.avaje.ebean.Page;
import com.avaje.ebean.PagingList;
import controllers.Application;
Expand Down Expand Up @@ -79,8 +80,10 @@ public static Organization findByName(String name) {
}

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) {
Expand Down
2 changes: 1 addition & 1 deletion app/views/organization/list.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 2 additions & 1 deletion app/views/project/list.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ site.massMail.toProjects = To members of a specific project
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
Expand Down
4 changes: 2 additions & 2 deletions conf/messages.ko-KR
Original file line number Diff line number Diff line change
Expand Up @@ -831,10 +831,10 @@ site.mail.write = 메일 쓰기
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을 브라우저 주소창에 붙여 넣으세요
Expand Down

0 comments on commit 0f95473

Please sign in to comment.