ContentTypes: Fixing that type listing should show "LIst Items" link if the type is Listable (instead of Creatable)

This commit is contained in:
Lombiq
2019-08-28 19:06:12 +02:00
committed by Benedek Farkas
parent 3d8bb6d460
commit c98e289023

View File

@@ -1,19 +1,27 @@
@model Orchard.ContentTypes.ViewModels.EditTypeViewModel
@using Orchard.Core.Contents.Settings;
@{
var settings = Model.Settings.GetModel<ContentTypeSettings>();
var creatable = settings.Creatable;
var stereotype = Model.Settings.ContainsKey("Stereotype") ? Model.Settings["Stereotype"] : default(string);
var stereotype = Model.Settings.ContainsKey("Stereotype") ? Model.Settings["Stereotype"] : "";
}
<div class="summary">
<div class="properties">
<h3>@Model.DisplayName</h3> @if (!string.IsNullOrWhiteSpace(stereotype)) { <text><span class="stereotype" title="Stereotype">- @stereotype</span></text>}
@if (creatable) {
<p class="pageStatus">@Html.ActionLink(T("Create New {0}", Html.Raw(Model.DisplayName)).Text, "Create", new {area = "Contents", id = Model.Name})</p>
<h3>@Model.DisplayName</h3>
@if (!string.IsNullOrWhiteSpace(stereotype)) { <text><span class="stereotype" title="Stereotype">- @stereotype</span></text> }
@if (settings.Creatable) {
<p class="pageStatus">@Html.ActionLink(T("Create New {0}", Html.Raw(Model.DisplayName)).Text, "Create", new {area = "Contents", id = Model.Name})</p>
}
</div>
<div class="related">@if (creatable) {
@Html.ActionLink(T("List Items").ToString(), "List", new {area = "Contents", id = Model.Name})@T(" | ")}
<div class="related">
@if (settings.Listable) {
@Html.ActionLink(T("List Items").ToString(), "List", new {area = "Contents", id = Model.Name})@T(" | ")
}
@Html.ActionLink(T("Edit").ToString(), "Edit", new {area = "Orchard.ContentTypes", id = Model.Name})
</div>
</div>