Skip to content

Commit

Permalink
fix project list search (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
phachon committed Aug 29, 2018
1 parent c66c136 commit 922c0df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/controllers/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (this *ProjectController) List() {
var err error
var count int64
var projects []map[string]string
if (len(keywords) > 0) {
if len(keywords) > 0 {
count, err = models.ProjectModel.CountProjectsByKeywords(keywords)
projects, err = models.ProjectModel.GetProjectsByKeywordsAndLimit(keywords, limit, number)
}else {
Expand Down
6 changes: 3 additions & 3 deletions views/project/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
<div class="input-group">
<span class="input-group-addon"> 项目组</span>
<select class="form-control" name="group_id">
<option value="">全部</option>
<option name="group_id" value="">全部</option>
{{range $group := .groups}}
<option value="{{$group.group_id}}">{{$group.name}}</option>
<option value="{{$group.group_id}}" {{if eq $.keywords.group_id $group.group_id}} selected="selected" {{end}}>{{$group.name}}</option>
{{end}}
</select>
</div>
</div>
<div class="col-md-3">
<div class="input-group">
<input class="form-control" name="name" type="text" value="" placeholder=" 项目名">
<input class="form-control" name="keyword" type="text" value="{{.keywords.keyword}}" placeholder=" 项目名">
<span class="input-group-btn">
<button type="submit" class="btn btn-primary"><i class="glyphicon glyphicon-search"></i></button>
</span>
Expand Down

0 comments on commit 922c0df

Please # to comment.