Update TaxonomyField.cshtml

Re-submit of #6160. Fixed a bug in the taxonomy field editor template that allows you to click on "create some terms" for a non-existent taxonomy. This situation occurs when you assign a taxonomy field to a content type but do not specify a taxonomy.
This commit is contained in:
Westley Harris
2015-12-15 07:34:32 -05:00
parent 70ff08f4b7
commit 4fb1c18a72

View File

@@ -42,7 +42,9 @@
}
</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">
@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>