Browse Source

提交任务搜索结果

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.3.2^2
zouap 3 years ago
parent
commit
880de5d9a9
2 changed files with 21 additions and 8 deletions
  1. +14
    -1
      public/home/search.js
  2. +7
    -7
      templates/explore/search_new.tmpl

+ 14
- 1
public/home/search.js View File

@@ -64,7 +64,7 @@ function search(){
var pageSize=15;
if(!isEmpty(keyword)){
doSearch("repository",keyword,page,pageSize,false,sortBy[11]);
//doSearch("issue",keyword,page,pageSize,true);
doSearch("issue",keyword,page,pageSize,true);
//doSearch("user",keyword,page,pageSize,true);
//doSearch("org",keyword,page,pageSize,true);
//doSearch("dataset",keyword,page,pageSize,true);
@@ -165,6 +165,7 @@ function displayIssueResult(page,jsonResult,onlyReturnNum,keyword){
var total = jsonResult.Total;
$('#issue_total').text(total);
if(!onlyReturnNum){
setActivate("issue_item");
$('#keyword_desc').text(keyword);
$('#obj_desc').text("任务");
$('#child_total').text(total);
@@ -202,12 +203,24 @@ function displayIssueResult(page,jsonResult,onlyReturnNum,keyword){
}
}

function setActivate(name){
$('#repo_item').removeClass("active");
$('#user_item').removeClass("active");
$('#issue_item').removeClass("active");
$('#dataset_item').removeClass("active");
$('#org_item').removeClass("active");
$('#pr_item').removeClass("active");
var tmp = "#" + name;
$(tmp).addClass("active");
}

function displayRepoResult(page,jsonResult,onlyReturnNum,keyword){
var data = jsonResult.Result;
var total = jsonResult.Total;
$('#repo_total').text(total);

if(!onlyReturnNum){
setActivate("repo_item");
$('#keyword_desc').text(keyword);
$('#obj_desc').text("项目");
$('#child_total').text(total);


+ 7
- 7
templates/explore/search_new.tmpl View File

@@ -17,30 +17,30 @@
</div>
</div>
</div>
<div class="ui container seachnav">
<div class="ui secondary pointing menu">
<a class="active item" href="javascript:searchItem(1,11);">
<a id="repo_item" class="item" href="javascript:searchItem(1,11);">
项目
<span class="ui circular mini label" id="repo_total"></span>
</a>
<a class="item" href="javascript:searchItem(2,21);">
<a id="dataset_item" class="item" href="javascript:searchItem(5,51);">
数据集
<span class="ui circular mini label" id="dataset_total"></span>
</a>
<a class="item" href="javascript:searchItem(3,31);">
<a id="issue_item" class="item" href="javascript:searchItem(2,21);">
任务
<span class="ui circular mini label" id="issue_total"></span>
</a>
<a class="item" href="javascript:searchItem(4,41);">
<a id="pr_item" class="item" href="javascript:searchItem(6,61);">
合并请求
<span class="ui circular mini label" id="pr_total"></span>
</a>
<a class="item" href="javascript:searchItem(5,51);">
<a id="user_item" class="item" href="javascript:searchItem(3,31);">
用户
<span class="ui circular mini label" id="user_total"></span>
</a>
<a class="item" href="javascript:searchItem(6,61);">
<a id="org_item" class="item" href="javascript:searchItem(4,41);">
组织 <span class="ui circular mini label" id="org_total"></span>
</a>
</div>


Loading…
Cancel
Save