mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Implemented Data export step matrix behavior.
This commit is contained in:
@@ -8,3 +8,4 @@ OrchardVersion: 1.9
|
|||||||
Description: Provides content item data import and export capability.
|
Description: Provides content item data import and export capability.
|
||||||
FeatureDescription: Imports and exports content item data
|
FeatureDescription: Imports and exports content item data
|
||||||
Category: Content
|
Category: Content
|
||||||
|
Dependencies: Orchard.jQuery
|
||||||
@@ -108,6 +108,7 @@
|
|||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Content Include="Scripts\exportstep-data.js" />
|
||||||
<Content Include="Styles\images\menu.importexport.png" />
|
<Content Include="Styles\images\menu.importexport.png" />
|
||||||
<Content Include="Styles\exportstep-data.css" />
|
<Content Include="Styles\exportstep-data.css" />
|
||||||
<Content Include="Styles\menu.importexport-admin.css" />
|
<Content Include="Styles\menu.importexport-admin.css" />
|
||||||
@@ -136,6 +137,11 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Views\EditorTemplates\ExportSteps\SetupRecipe.cshtml" />
|
<Content Include="Views\EditorTemplates\ExportSteps\SetupRecipe.cshtml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Scripts\Web.config">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration>
|
||||||
|
<system.webServer>
|
||||||
|
<staticContent>
|
||||||
|
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
|
||||||
|
</staticContent>
|
||||||
|
|
||||||
|
<handlers accessPolicy="Script,Read">
|
||||||
|
<!--
|
||||||
|
iis7 - for any request to a file exists on disk, return it via native http module.
|
||||||
|
accessPolicy 'Script' is to allow for a managed 404 page.
|
||||||
|
-->
|
||||||
|
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
|
||||||
|
</handlers>
|
||||||
|
</system.webServer>
|
||||||
|
</configuration>
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
(function($) {
|
||||||
|
$(function() {
|
||||||
|
$("table.items").each(function() {
|
||||||
|
var table = $(this);
|
||||||
|
|
||||||
|
table.on("click", ".check-schema, .check-data", function (e) {
|
||||||
|
updateState();
|
||||||
|
});
|
||||||
|
|
||||||
|
table.on("click", ".check-both", function (e) {
|
||||||
|
var sender = $(this);
|
||||||
|
var isChecked = sender.is(":checked");
|
||||||
|
var row = sender.closest("tr");
|
||||||
|
|
||||||
|
row.find(".check-schema, .check-data").prop("checked", isChecked);
|
||||||
|
updateState();
|
||||||
|
});
|
||||||
|
|
||||||
|
table.on("click", ".check-all-schema", function (e) {
|
||||||
|
var sender = $(this);
|
||||||
|
var isChecked = sender.is(":checked");
|
||||||
|
|
||||||
|
table.find(".check-schema").prop("checked", isChecked);
|
||||||
|
updateState();
|
||||||
|
});
|
||||||
|
|
||||||
|
table.on("click", ".check-all-data", function (e) {
|
||||||
|
var sender = $(this);
|
||||||
|
var isChecked = sender.is(":checked");
|
||||||
|
|
||||||
|
table.find(".check-data").prop("checked", isChecked);
|
||||||
|
updateState();
|
||||||
|
});
|
||||||
|
|
||||||
|
table.on("click", ".check-all-both", function (e) {
|
||||||
|
var sender = $(this);
|
||||||
|
var isChecked = sender.is(":checked");
|
||||||
|
|
||||||
|
table.find(".check-schema").prop("checked", isChecked);
|
||||||
|
table.find(".check-data").prop("checked", isChecked);
|
||||||
|
updateState();
|
||||||
|
});
|
||||||
|
|
||||||
|
var updateState = function () {
|
||||||
|
table.find("tbody tr").each(function() {
|
||||||
|
var tr = $(this);
|
||||||
|
var checkSchema = tr.find(".check-schema").is(":checked");
|
||||||
|
var checkData = tr.find(".check-data").is(":checked");
|
||||||
|
|
||||||
|
tr.find(".check-both").prop("checked", checkSchema && checkData);
|
||||||
|
});
|
||||||
|
|
||||||
|
var allBothChecked = table.find(".check-both").not(":checked").length === 0;
|
||||||
|
var allSchemaChecked = table.find(".check-schema").not(":checked").length === 0;
|
||||||
|
var allDataChecked = table.find(".check-data").not(":checked").length === 0;
|
||||||
|
|
||||||
|
table.find(".check-all-both").prop("checked", allBothChecked);
|
||||||
|
table.find(".check-all-schema").prop("checked", allSchemaChecked);
|
||||||
|
table.find(".check-all-data").prop("checked", allDataChecked);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})(jQuery);
|
||||||
@@ -1,39 +1,41 @@
|
|||||||
@model Orchard.ImportExport.ViewModels.DataExportStepViewModel
|
@model Orchard.ImportExport.ViewModels.DataExportStepViewModel
|
||||||
@{
|
@{
|
||||||
Style.Include("exportstep-data.css");
|
Style.Include("exportstep-data.css");
|
||||||
|
Script.Require("jQuery");
|
||||||
|
Script.Include("exportstep-data.js");
|
||||||
}
|
}
|
||||||
<div>
|
<div>
|
||||||
<table class="items">
|
<table class="items">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>@T("Content Type")</th>
|
<th>@T("Content Type")</th>
|
||||||
<th>@T("Schema")</th>
|
<th>@T("Schema")</th>
|
||||||
<th>@T("Data")</th>
|
<th>@T("Data")</th>
|
||||||
<th>@T("Both")</th>
|
<th>@T("Both")</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="sub">
|
<tr class="sub">
|
||||||
<th> </th>
|
<th> </th>
|
||||||
<th><input type="checkbox"/></th>
|
<th><input type="checkbox" class="check-all-schema" /></th>
|
||||||
<th><input type="checkbox"/></th>
|
<th><input type="checkbox" class="check-all-data" /></th>
|
||||||
<th><input type="checkbox"/></th>
|
<th><input type="checkbox" class="check-all-both" /></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@{ var contentTypeIndex = 0;}
|
@{ var contentTypeIndex = 0;}
|
||||||
@foreach (var contentType in Model.ContentTypes) {
|
@foreach (var contentType in Model.ContentTypes) {
|
||||||
<tr>
|
<tr>
|
||||||
<td>@contentType.DisplayName</td>
|
<td>@contentType.DisplayName</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="hidden" name="@Html.NameFor(m => m.ContentTypes[contentTypeIndex].Name)" value="@Model.ContentTypes[contentTypeIndex].Name"/>
|
<input type="hidden" name="@Html.NameFor(m => m.ContentTypes[contentTypeIndex].Name)" value="@Model.ContentTypes[contentTypeIndex].Name" />
|
||||||
<input type="checkbox" name="@Html.NameFor(m => m.ContentTypes[contentTypeIndex].ExportSchema)" value="true"/>
|
<input type="checkbox" class="check-schema" name="@Html.NameFor(m => m.ContentTypes[contentTypeIndex].ExportSchema)" value="true" />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="checkbox" name="@Html.NameFor(m => m.ContentTypes[contentTypeIndex].ExportData)" value="true"/>
|
<input type="checkbox" class="check-data" name="@Html.NameFor(m => m.ContentTypes[contentTypeIndex].ExportData)" value="true" />
|
||||||
</td>
|
</td>
|
||||||
<td><input type="checkbox"/></td>
|
<td><input type="checkbox" class="check-both" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
contentTypeIndex++;
|
contentTypeIndex++;
|
||||||
}
|
}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@Html.Hint(T("Choose the types to include in the export file"))
|
@Html.Hint(T("Choose the types to include in the export file"))
|
||||||
|
|||||||
Reference in New Issue
Block a user