Merge pull request #6180 from wharri220/patch-2

Prevent terms creationg when taxonomy doesn't exist
This commit is contained in:
Sébastien Ros
2015-12-15 10:46:36 -08:00

View File

@@ -42,7 +42,9 @@
} }
</ul> </ul>
@if (!Model.Terms.Any() && AuthorizedFor(Orchard.Taxonomies.Permissions.CreateTerm)) { @if (Model.TaxonomyId == 0) {
<p>@T("Your haven't specified a taxonomy for {0}", Model.DisplayName)</p>
}else if (!Model.Terms.Any() && AuthorizedFor(Orchard.Taxonomies.Permissions.CreateTerm)) {
<div class="no-terms"> <div class="no-terms">
@T("There are no terms defined for {0} yet.", Model.DisplayName) @T("There are no terms defined for {0} yet.", Model.DisplayName)
<a href="@Url.Action("Index", "TermAdmin", new { taxonomyId = Model.TaxonomyId, area = "Orchard.Taxonomies" })">@T("Create some terms")</a> <a href="@Url.Action("Index", "TermAdmin", new { taxonomyId = Model.TaxonomyId, area = "Orchard.Taxonomies" })">@T("Create some terms")</a>