Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/BootstrapBlazor/Components/Upload/CardUpload.razor
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
<div class="upload-item-size"><span>@item.GetFileName()</span> (@item.Size.ToFileSizeString())</div>
<div class="upload-item-actions">
<div class="btn-group">
@if (ActionButtonTemplate != null)
@if (BeforeActionButtonTemplate != null)
{
@ActionButtonTemplate(item)
@BeforeActionButtonTemplate(item)
}
@if (ShowZoomButton)
{
Expand All @@ -54,6 +54,10 @@
<i class="@CancelIcon"></i>
</button>
}
@if (ActionButtonTemplate != null)
{
@ActionButtonTemplate(item)
}
Comment on lines +57 to +60
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation detected. Lines 57-60 use tabs instead of spaces, while the rest of the file uses spaces for indentation. Convert tabs to spaces to match the file's indentation style.

Suggested change
@if (ActionButtonTemplate != null)
{
@ActionButtonTemplate(item)
}
@if (ActionButtonTemplate != null)
{
@ActionButtonTemplate(item)
}

Copilot uses AI. Check for mistakes.
</div>
@if (ShowDeleteButton)
{
Expand Down
6 changes: 6 additions & 0 deletions src/BootstrapBlazor/Components/Upload/CardUpload.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ public partial class CardUpload<TValue>
[Parameter]
public RenderFragment<UploadFile>? IconTemplate { get; set; }

/// <summary>
/// 获得/设置 操作按钮模板
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation comment for BeforeActionButtonTemplate is identical to ActionButtonTemplate (line 70). Update the comment to clarify that this template renders action buttons before the built-in buttons, e.g., '获得/设置 操作按钮前置模板' or '获得/设置 在内置操作按钮之前渲染的操作按钮模板'.

Suggested change
/// 获得/设置 操作按钮模板
/// 获得/设置 在内置操作按钮之前渲染的操作按钮模板

Copilot uses AI. Check for mistakes.
/// </summary>
[Parameter]
public RenderFragment<UploadFile>? BeforeActionButtonTemplate { get; set; }

/// <summary>
/// 获得/设置 操作按钮模板
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions test/UnitTest/Components/UploadCardTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,17 @@ public void ActionButtonTemplate_Ok()
[
new() { FileName = "test.png" }
]);
pb.Add(a => a.BeforeActionButtonTemplate, file => pb =>
{
pb.AddMarkupContent(0, "<button class=\"before-action-button-test\"></button>");
});
pb.Add(a => a.ActionButtonTemplate, file => pb =>
{
pb.AddMarkupContent(0, "<button class=\"action-button-test\"></button>");
});
});

cut.Contains("before-action-button-test");
cut.Contains("action-button-test");
}

Expand Down
Loading