Skip to content
This repository was archived by the owner on Dec 21, 2023. It is now read-only.

Commit c5e95f2

Browse files
Merge pull request #9 from OpenTabletDriver/button-visibility
Hide plugin buttons when URL is null
2 parents 9636ecc + 438421e commit c5e95f2

1 file changed

Lines changed: 18 additions & 15 deletions

File tree

OpenTabletDriver.Web/Views/Plugins/Index.cshtml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,24 @@
4646
</div>
4747
</div>
4848
<div class="mt-auto text-center">
49-
<a role="button" class="btn-sm btn-primary me-1"
50-
@(string.IsNullOrWhiteSpace(metadata.DownloadUrl) ? "disabled" : string.Empty)
51-
href="@metadata.DownloadUrl">
52-
Download
53-
</a>
54-
<a role="button" class="btn-sm btn-info me-1"
55-
@(string.IsNullOrWhiteSpace(metadata.RepositoryUrl) ? "disabled" : string.Empty)
56-
href="@metadata.WikiUrl">
57-
Wiki
58-
</a>
59-
<a role="button" class="btn-sm btn-info"
60-
@(string.IsNullOrWhiteSpace(metadata.RepositoryUrl) ? "disabled" : string.Empty)
61-
href="@metadata.RepositoryUrl">
62-
Source
63-
</a>
49+
@if (!string.IsNullOrWhiteSpace(metadata.DownloadUrl))
50+
{
51+
<a role="button" class="btn btn-primary me-1 w-10" href="@metadata.DownloadUrl">
52+
Download
53+
</a>
54+
}
55+
@if (!string.IsNullOrWhiteSpace(metadata.WikiUrl))
56+
{
57+
<a role="button" class="btn btn-info me-1" href="@metadata.WikiUrl">
58+
Wiki
59+
</a>
60+
}
61+
@if (!string.IsNullOrWhiteSpace(metadata.RepositoryUrl))
62+
{
63+
<a role="button" class="btn btn-info" href="@metadata.RepositoryUrl">
64+
Source
65+
</a>
66+
}
6467
</div>
6568
</div>
6669
</div>

0 commit comments

Comments
 (0)