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