@ -362,7 +362,7 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) { 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						var  (   
					 
					 
					 
						var  (   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							viewType    string   
					 
					 
					 
							viewType    string   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							sortType    =  ctx . FormString ( "sort" )   
					 
					 
					 
							sortType    =  ctx . FormString ( "sort" )   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							filterMode  =  models . FilterModeAll   
					 
					 
					 
							filterMode  int   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
						)   
					 
					 
					 
						)   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						// --------------------------------------------------------------------------------
   
					 
					 
					 
						// --------------------------------------------------------------------------------
   
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					 
					@ -388,8 +388,10 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) { 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							filterMode  =  models . FilterModeMention   
					 
					 
					 
							filterMode  =  models . FilterModeMention   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						case  "review_requested" :   
					 
					 
					 
						case  "review_requested" :   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							filterMode  =  models . FilterModeReviewRequested   
					 
					 
					 
							filterMode  =  models . FilterModeReviewRequested   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						case  "your_repositories" :  // filterMode already set to All
   
					 
					 
					 
						case  "your_repositories" :   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
							fallthrough   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						default :   
					 
					 
					 
						default :   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
							filterMode  =  models . FilterModeYourRepositories   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							viewType  =  "your_repositories"   
					 
					 
					 
							viewType  =  "your_repositories"   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						}   
					 
					 
					 
						}   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -419,6 +421,30 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) { 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							User :        ctx . Doer ,   
					 
					 
					 
							User :        ctx . Doer ,   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						}   
					 
					 
					 
						}   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
						// Search all repositories which
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
						//
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
						// As user:
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
						// - Owns the repository.
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
						// - Have collaborator permissions in repository.
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
						//
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
						// As org:
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
						// - Owns the repository.
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
						//
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
						// As team:
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
						// - Team org's owns the repository.
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
						// - Team has read permission to repository.
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
						repoOpts  :=  & models . SearchRepoOptions {   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
							Actor :       ctx . Doer ,   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
							OwnerID :     ctx . Doer . ID ,   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
							Private :     true ,   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
							AllPublic :   false ,   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
							AllLimited :  false ,   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
						}   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
						if  ctxUser . IsOrganization ( )  &&  ctx . Org . Team  !=  nil  {   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
							repoOpts . TeamID  =  ctx . Org . Team . ID   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
						}   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						switch  filterMode  {   
					 
					 
					 
						switch  filterMode  {   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						case  models . FilterModeAll :   
					 
					 
					 
						case  models . FilterModeAll :   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						case  models . FilterModeAssign :   
					 
					 
					 
						case  models . FilterModeAssign :   
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					 
					@ -429,6 +455,19 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) { 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							opts . MentionedID  =  ctx . Doer . ID   
					 
					 
					 
							opts . MentionedID  =  ctx . Doer . ID   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						case  models . FilterModeReviewRequested :   
					 
					 
					 
						case  models . FilterModeReviewRequested :   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							opts . ReviewRequestedID  =  ctx . Doer . ID   
					 
					 
					 
							opts . ReviewRequestedID  =  ctx . Doer . ID   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
						case  models . FilterModeYourRepositories :   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
							if  ctxUser . IsOrganization ( )  &&  ctx . Org . Team  !=  nil  {   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
								// Fixes a issue whereby the user's ID would be used
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
								// to check if it's in the team(which possible isn't the case).
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
								opts . User  =  nil   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
							}   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
							userRepoIDs ,  _ ,  err  :=  models . SearchRepositoryIDs ( repoOpts )   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
							if  err  !=  nil  {   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
								ctx . ServerError ( "models.SearchRepositoryIDs: %v" ,  err )   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
								return   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
							}   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
							opts . RepoIDs  =  userRepoIDs   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						}   
					 
					 
					 
						}   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
						// keyword holds the search term entered into the search field.
   
					 
					 
					 
						// keyword holds the search term entered into the search field.
   
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -560,8 +599,12 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) { 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
								Org :         org ,   
					 
					 
					 
								Org :         org ,   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
								Team :        team ,   
					 
					 
					 
								Team :        team ,   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							}   
					 
					 
					 
							}   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							if  len ( repoIDs )  >  0  {   
					 
					 
					 
							if  filterMode  ==  models . FilterModeYourRepositories  {   
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
								statsOpts . RepoIDs  =  repoIDs   
					 
					 
					 
								statsOpts . RepoCond  =  models . SearchRepositoryCondition ( repoOpts )   
				
			 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
							}   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
							// Detect when we only should search by team.
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
							if  opts . User  ==  nil  {   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					 
					 
					 
					 
								statsOpts . UserID  =  0   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							}   
					 
					 
					 
							}   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							issueStats ,  err  =  models . GetUserIssueStats ( statsOpts )   
					 
					 
					 
							issueStats ,  err  =  models . GetUserIssueStats ( statsOpts )   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
							if  err  !=  nil  {   
					 
					 
					 
							if  err  !=  nil  {