mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-26 12:27:06 +00:00 
			
		
		
		
	Add "No data available" display when list is empty (#33517)
Add a "No data available" message to be displayed when the list has no data. This improves the user experience by providing clear feedback in an empty state. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		| @@ -30,6 +30,8 @@ | ||||
| 							<td>{{DateUtils.AbsoluteShort .CreatedUnix}}</td> | ||||
| 							<td><a href="{{AppSubUrl}}/-/admin/auths/{{.ID}}">{{svg "octicon-pencil"}}</a></td> | ||||
| 						</tr> | ||||
| 					{{else}} | ||||
| 						<tr><td class="tw-text-center" colspan="7">{{ctx.Locale.Tr "no_results_found"}}</td></tr> | ||||
| 					{{end}} | ||||
| 				</tbody> | ||||
| 			</table> | ||||
|   | ||||
| @@ -67,6 +67,8 @@ | ||||
| 								>{{svg "octicon-trash"}}</a> | ||||
| 							</td> | ||||
| 						</tr> | ||||
| 					{{else}} | ||||
| 						<tr><td class="tw-text-center" colspan="6">{{ctx.Locale.Tr "no_results_found"}}</td></tr> | ||||
| 					{{end}} | ||||
| 				</tbody> | ||||
| 			</table> | ||||
|   | ||||
| @@ -24,6 +24,8 @@ | ||||
| 						<td nowrap>{{DateUtils.AbsoluteShort .CreatedUnix}}</td> | ||||
| 						<td class="view-detail"><a href="#">{{svg "octicon-note" 16}}</a></td> | ||||
| 					</tr> | ||||
| 				{{else}} | ||||
| 					<tr><td class="tw-text-center" colspan="6">{{ctx.Locale.Tr "no_results_found"}}</td></tr> | ||||
| 				{{end}} | ||||
| 			</tbody> | ||||
| 			{{if .Notices}} | ||||
|   | ||||
| @@ -66,6 +66,8 @@ | ||||
| 							<td>{{DateUtils.AbsoluteShort .CreatedUnix}}</td> | ||||
| 							<td><a href="{{.OrganisationLink}}/settings" data-tooltip-content="{{ctx.Locale.Tr "edit"}}">{{svg "octicon-pencil"}}</a></td> | ||||
| 						</tr> | ||||
| 					{{else}} | ||||
| 						<tr><td class="tw-text-center" colspan="7">{{ctx.Locale.Tr "no_results_found"}}</td></tr> | ||||
| 					{{end}} | ||||
| 				</tbody> | ||||
| 			</table> | ||||
|   | ||||
| @@ -74,6 +74,8 @@ | ||||
| 							<td>{{DateUtils.AbsoluteShort .Version.CreatedUnix}}</td> | ||||
| 							<td><a class="delete-button" href="" data-url="{{$.Link}}/delete?page={{$.Page.Paginater.Current}}&sort={{$.SortType}}" data-id="{{.Version.ID}}" data-name="{{.Package.Name}}" data-data-version="{{.Version.Version}}">{{svg "octicon-trash"}}</a></td> | ||||
| 						</tr> | ||||
| 					{{else}} | ||||
| 						<tr><td class="tw-text-center" colspan="10">{{ctx.Locale.Tr "no_results_found"}}</td></tr> | ||||
| 					{{end}} | ||||
| 				</tbody> | ||||
| 			</table> | ||||
|   | ||||
| @@ -86,6 +86,8 @@ | ||||
| 							<td>{{DateUtils.AbsoluteShort .CreatedUnix}}</td> | ||||
| 							<td><a class="delete-button" href="" data-url="{{$.Link}}/delete?page={{$.Page.Paginater.Current}}&sort={{$.SortType}}" data-id="{{.ID}}" data-name="{{.Name}}">{{svg "octicon-trash"}}</a></td> | ||||
| 						</tr> | ||||
| 					{{else}} | ||||
| 						<tr><td class="tw-text-center" colspan="12">{{ctx.Locale.Tr "no_results_found"}}</td></tr> | ||||
| 					{{end}} | ||||
| 				</tbody> | ||||
| 			</table> | ||||
|   | ||||
| @@ -109,6 +109,8 @@ | ||||
| 								</div> | ||||
| 							</td> | ||||
| 						</tr> | ||||
| 					{{else}} | ||||
| 						<tr class="no-results-row"><td class="tw-text-center" colspan="9">{{ctx.Locale.Tr "no_results_found"}}</td></tr> | ||||
| 					{{end}} | ||||
| 				</tbody> | ||||
| 			</table> | ||||
|   | ||||
| @@ -279,7 +279,7 @@ func TestLDAPUserSyncWithEmptyUsernameAttribute(t *testing.T) { | ||||
|  | ||||
| 		htmlDoc := NewHTMLParser(t, resp.Body) | ||||
|  | ||||
| 		tr := htmlDoc.doc.Find("table.table tbody tr") | ||||
| 		tr := htmlDoc.doc.Find("table.table tbody tr:not(.no-results-row)") | ||||
| 		assert.Equal(t, 0, tr.Length()) | ||||
| 	} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Kerwin Bryant
					Kerwin Bryant