add Unlisted badge to plugin cards in public directory search results
This commit is contained in:
parent
3752a94d6c
commit
d3af9746b8
@ -39,6 +39,7 @@ public class PublishedPlugin : PublishedVersion
|
||||
get => BuildInfo?["pluginDir"]?.ToString();
|
||||
}
|
||||
|
||||
public bool IsUnlisted { get; set; }
|
||||
public PluginRatingSummary RatingSummary { get; set; } = new();
|
||||
|
||||
public string GetSourceUrl(GitHostingProviderFactory providerFactory)
|
||||
|
||||
@ -230,6 +230,7 @@ public class HomeController(
|
||||
lv.plugin_slug,
|
||||
lv.ver,
|
||||
p.settings,
|
||||
p.visibility,
|
||||
b.id,
|
||||
b.manifest_info,
|
||||
b.build_info,
|
||||
@ -278,7 +279,7 @@ public class HomeController(
|
||||
}
|
||||
|
||||
var rows = await conn
|
||||
.QueryAsync<(string plugin_slug, int[] ver, string settings, long id, string manifest_info, string build_info, decimal avg_rating, int total_reviews
|
||||
.QueryAsync<(string plugin_slug, int[] ver, string settings, string visibility, long id, string manifest_info, string build_info, decimal avg_rating, int total_reviews
|
||||
)>(
|
||||
query,
|
||||
new
|
||||
@ -304,6 +305,7 @@ public class HomeController(
|
||||
BuildInfo = JObject.Parse(r.build_info),
|
||||
ManifestInfo = manifestInfo,
|
||||
PluginLogo = settings?.Logo,
|
||||
IsUnlisted = r.visibility == "unlisted",
|
||||
RatingSummary = new PluginRatingSummary
|
||||
{
|
||||
Average = r.avg_rating,
|
||||
|
||||
@ -111,6 +111,10 @@
|
||||
<h3 style="margin-top: 0; margin-bottom: 5px;">
|
||||
<a asp-action="GetPluginDetails"
|
||||
asp-route-pluginSlug="@plugin.ProjectSlug">@plugin.PluginTitle</a>
|
||||
@if (plugin.IsUnlisted)
|
||||
{
|
||||
<span class="badge bg-secondary ms-2" title="This plugin is not publicly listed">Unlisted</span>
|
||||
}
|
||||
</h3>
|
||||
|
||||
<p style="margin-bottom: 5px;">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user