mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Added missing *Types* property to ContentPicker shape.
This fixes an issue where you could not configure the content picker shape to filter the available content items by types or types with certain parts.
This commit is contained in:
@@ -54,6 +54,7 @@
|
||||
var baseUrl = $(self).data("base-url");
|
||||
var partName = $(self).data("part-name");
|
||||
var fieldName = $(self).data("field-name");
|
||||
var types = $(self).data("types");
|
||||
|
||||
var refreshIds = function() {
|
||||
var id = $("[name='" + selectedItemsFieldname + "']");
|
||||
@@ -90,7 +91,8 @@
|
||||
},
|
||||
baseUrl: baseUrl,
|
||||
part: partName,
|
||||
field: fieldName
|
||||
field: fieldName,
|
||||
types: types
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -15,6 +15,7 @@
|
||||
var partName = Model.PartName;
|
||||
var fieldName = Model.FieldName;
|
||||
var baseUrl = Url.Content("~/") + WorkContext.Resolve<ShellSettings>().RequestUrlPrefix;
|
||||
var types = String.Join(",", (IEnumerable<string>)Model.Types ?? Enumerable.Empty<string>());
|
||||
}
|
||||
|
||||
<fieldset class="content-picker-field"
|
||||
@@ -25,9 +26,10 @@
|
||||
data-part-name="@HttpUtility.JavaScriptStringEncode(partName)"
|
||||
data-field-name="@HttpUtility.JavaScriptStringEncode(fieldName)"
|
||||
data-remove-text="@T("Remove")"
|
||||
data-not-published-text="@T("Not Published")">
|
||||
data-not-published-text="@T("Not Published")"
|
||||
data-types="@types">
|
||||
@if (!String.IsNullOrWhiteSpace(displayName)) {
|
||||
<label @if(required) { <text>class="required"</text> }>@displayName</label>
|
||||
<label @if (required) { <text> class="required" </text> }>@displayName</label>
|
||||
}
|
||||
<div class="message message-Warning content-picker-message">@T("You need to save your changes.")</div>
|
||||
<table class="items content-picker" summary="@displayName">
|
||||
@@ -38,7 +40,7 @@
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" > ↓</th>
|
||||
<th scope="col"> ↓</th>
|
||||
<th scope="col">@T("Content Item")</th>
|
||||
<th scope="col"> </th>
|
||||
</tr>
|
||||
@@ -48,7 +50,7 @@
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<span data-id="@contentItem.Id" data-fieldid="@idsFieldId" class="content-picker-item">@Html.ItemEditLink(contentItem) @if(!contentItem.HasPublished()) {<text> - </text>@T("Not Published")}</span>
|
||||
<span data-id="@contentItem.Id" data-fieldid="@idsFieldId" class="content-picker-item">@Html.ItemEditLink(contentItem) @if (!contentItem.HasPublished()){<text> - </text>@T("Not Published")}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span data-id="@contentItem.Id" class="content-picker-remove button grey">@T("Remove")</span>
|
||||
@@ -59,6 +61,6 @@
|
||||
</table>
|
||||
|
||||
<span class="button add">@T("Add")</span>
|
||||
<input type="hidden" name="@selectedItemsFieldName"/>
|
||||
<input type="hidden" name="@selectedItemsFieldName" />
|
||||
<span class="hint">@hint</span>
|
||||
</fieldset>
|
Reference in New Issue
Block a user