Merge pull request #627 from reasonerjt/master

remove creator field from top repos list
This commit is contained in:
kun wang 2016-08-03 12:33:53 +08:00 committed by GitHub
commit bb5bcd4da3
4 changed files with 9 additions and 8 deletions

View File

@ -184,7 +184,7 @@ func GetTopRepos(countNum int) ([]models.TopRepo, error) {
for i := 0; i < len(list); i++ {
for _, v := range usrnameList {
if v.RepoName == list[i].RepoName {
list[i].Creator = v.Creator
// list[i].Creator = v.Creator
break
}
}

View File

@ -770,9 +770,11 @@ func TestGetTopRepos(t *testing.T) {
if topRepos[0].AccessCount != 1 {
t.Errorf("error occured in get top reop's access count, expected: %v, actual: %v", 1, topRepos[0].AccessCount)
}
if topRepos[0].Creator != currentUser.Username {
t.Errorf("error occured in get top reop's creator, expected: %v, actual: %v", currentUser.Username, topRepos[0].Creator)
}
/*
if topRepos[0].Creator != currentUser.Username {
t.Errorf("error occured in get top reop's creator, expected: %v, actual: %v", currentUser.Username, topRepos[0].Creator)
}
*/
err = ToggleProjectPublicity(currentProject.ProjectID, publicityOff)
if err != nil {
t.Errorf("Error occurred in ToggleProjectPublicity: %v", err)

View File

@ -19,5 +19,5 @@ package models
type TopRepo struct {
RepoName string `json:"name"`
AccessCount int64 `json:"count"`
Creator string `json:"creator"`
// Creator string `json:"creator"`
}

View File

@ -18,8 +18,7 @@
<table class="table table-pane table-header">
<thead>
<th width="60%">// 'repository_name' | tr //</th>
<th width="15%">// 'count' | tr //</th>
<th width="25%">// 'creator' | tr //</th>
<th width="40%">// 'count' | tr //</th>
</thead>
</table>
</div>
@ -30,7 +29,7 @@
<td colspan="5" height="120px" class="empty-hint" ng-if="vm.top10Repositories.length === 0"><h4 class="text-muted">// 'no_top_repositories' | tr //</h4></td>
</tr>
<tr ng-if="vm.top10Repositories.length > 0" ng-repeat="t in vm.top10Repositories">
<td width="60%">//t.name//</td><td width="15%">//t.count//</td><td width="25%">//t.creator === '' ? '-' : t.creator //</td>
<td width="60%">//t.name//</td><td width="40%">//t.count//</td>
</tr>
</tbody>
</table>