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:
		| @@ -25,7 +25,6 @@ func MilestoneDetails(milestone *gitea.Milestone) { | ||||
|  | ||||
| // MilestonesList prints a listing of milestones | ||||
| func MilestonesList(miles []*gitea.Milestone, output string, state gitea.StateType) { | ||||
|  | ||||
| 	headers := []string{ | ||||
| 		"Title", | ||||
| 	} | ||||
| @@ -37,7 +36,7 @@ func MilestonesList(miles []*gitea.Milestone, output string, state gitea.StateTy | ||||
| 		"DueDate", | ||||
| 	) | ||||
|  | ||||
| 	var values [][]string | ||||
| 	t := table{headers: headers} | ||||
|  | ||||
| 	for _, m := range miles { | ||||
| 		var deadline = "" | ||||
| @@ -56,8 +55,9 @@ func MilestonesList(miles []*gitea.Milestone, output string, state gitea.StateTy | ||||
| 			fmt.Sprintf("%d/%d", m.OpenIssues, m.ClosedIssues), | ||||
| 			deadline, | ||||
| 		) | ||||
|  | ||||
| 		values = append(values, item) | ||||
| 		t.addRowSlice(item) | ||||
| 	} | ||||
| 	outputList(output, headers, values) | ||||
|  | ||||
| 	t.sort(0, true) | ||||
| 	t.print(output) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Norwin
					Norwin