mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-02 03:17:32 +08:00
Handling internal taxonomies
--HG-- branch : 1.x extra : rebase_source : a1bf17dca5a81fc0e9d686563aeac01b45fd7279
This commit is contained in:
@@ -57,6 +57,10 @@ namespace Orchard.Taxonomies.Drivers {
|
||||
}
|
||||
|
||||
protected override void Exporting(TaxonomyPart part, ExportContentContext context) {
|
||||
if (part.IsInternal) {
|
||||
context.Exclude = true;
|
||||
}
|
||||
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("TermTypeName", part.TermTypeName);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,19 +31,28 @@
|
||||
</thead>
|
||||
@foreach (var taxonomyEntry in Model.Taxonomies) {
|
||||
ti = taxonomyIndex;
|
||||
<tr>
|
||||
<tr class="@(taxonomyEntry.Taxonomy.IsInternal ? "internal" : null)">
|
||||
<td>
|
||||
<input type="hidden" value="@Model.Taxonomies[taxonomyIndex].Taxonomy.Id" name="@Html.NameOf(m => m.Taxonomies[ti].Taxonomy.Id)"/>
|
||||
@if (!taxonomyEntry.Taxonomy.IsInternal || Authorizer.Authorize(Orchard.Security.StandardPermissions.SiteOwner)) {
|
||||
<input type="checkbox" value="true" name="@Html.NameOf(m => m.Taxonomies[ti].IsChecked)"/>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@if (!taxonomyEntry.Taxonomy.IsInternal || Authorizer.Authorize(Orchard.Security.StandardPermissions.SiteOwner)) {
|
||||
@Html.ActionLink(taxonomyEntry.Taxonomy.Name, "Index", "TermAdmin", new { taxonomyId = taxonomyEntry.Taxonomy.Id }, new object { })
|
||||
}
|
||||
else {
|
||||
@Html.ItemDisplayText(taxonomyEntry.Taxonomy)
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@Html.ItemEditLink(T("Edit").Text, taxonomyEntry.Taxonomy) |
|
||||
@Html.ActionLink(T("Terms").Text, "Index", "TermAdmin", new { taxonomyId = taxonomyEntry.Taxonomy.Id }, new object { }) |
|
||||
@Html.ActionLink(T("Delete").Text, "Delete", new { id = taxonomyEntry.Taxonomy.Id }, new object { }) |
|
||||
@if (!taxonomyEntry.Taxonomy.IsInternal || Authorizer.Authorize(Orchard.Security.StandardPermissions.SiteOwner)) {
|
||||
@Html.ItemEditLink(T("Edit").Text, taxonomyEntry.Taxonomy) <text>|</text>
|
||||
@Html.ActionLink(T("Terms").Text, "Index", "TermAdmin", new { taxonomyId = taxonomyEntry.Taxonomy.Id }, new object { }) <text>|</text>
|
||||
@Html.ActionLink(T("Delete").Text, "Delete", new { id = taxonomyEntry.Taxonomy.Id }, new object { }) <text>|</text>
|
||||
@Html.ActionLink(T("Import").Text, "Import", new { id = taxonomyEntry.Taxonomy.Id }, new object { })
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
taxonomyIndex++;
|
||||
|
||||
@@ -895,6 +895,11 @@ table.items td .add
|
||||
float: right;
|
||||
}
|
||||
|
||||
table.items tr.internal *{
|
||||
background-color: #eee;
|
||||
color: grey;
|
||||
}
|
||||
|
||||
/* Content item lists
|
||||
----------------------------------------------------------*/
|
||||
.contentItems {
|
||||
|
||||
Reference in New Issue
Block a user