mirror of
				https://gitea.com/gitea/tea.git
				synced 2025-10-31 01:05:26 +01:00 
			
		
		
		
	Improved list output (#281)
remove unused debug var move outputList into a struct so we can add additional functionality for all list output rename list output to table.go make table sortable sort milestones sort milestones descending remove unnecessary if Co-authored-by: Norwin Roosen <git@nroo.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/281 Reviewed-by: khmarbaise <khmarbaise@noreply.gitea.io> Reviewed-by: 6543 <6543@obermui.de> Co-Authored-By: Norwin <noerw@noreply.gitea.io> Co-Committed-By: Norwin <noerw@noreply.gitea.io>
This commit is contained in:
		| @@ -17,28 +17,23 @@ func OrganizationsList(organizations []*gitea.Organization, output string) { | ||||
| 		return | ||||
| 	} | ||||
|  | ||||
| 	headers := []string{ | ||||
| 	t := tableWithHeader( | ||||
| 		"Name", | ||||
| 		"FullName", | ||||
| 		"Website", | ||||
| 		"Location", | ||||
| 		"Description", | ||||
| 	} | ||||
|  | ||||
| 	var values [][]string | ||||
| 	) | ||||
|  | ||||
| 	for _, org := range organizations { | ||||
| 		values = append( | ||||
| 			values, | ||||
| 			[]string{ | ||||
| 				org.UserName, | ||||
| 				org.FullName, | ||||
| 				org.Website, | ||||
| 				org.Location, | ||||
| 				org.Description, | ||||
| 			}, | ||||
| 		t.addRow( | ||||
| 			org.UserName, | ||||
| 			org.FullName, | ||||
| 			org.Website, | ||||
| 			org.Location, | ||||
| 			org.Description, | ||||
| 		) | ||||
| 	} | ||||
|  | ||||
| 	outputList(output, headers, values) | ||||
| 	t.print(output) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Norwin
					Norwin