mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-21 19:34:40 +08:00
Adding javascript to the install module details page. Filtering default extension feature out.
--HG-- branch : dev
This commit is contained in:
@@ -50,7 +50,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
var dependencies = (from d in feature.Descriptor.Dependencies
|
var dependencies = (from d in feature.Descriptor.Dependencies
|
||||||
select (from f in Model.Features where f.Descriptor.Id == d select f).SingleOrDefault()).Where(f => f != null).OrderBy(f => f.Descriptor.Name);
|
select (from f in Model.Features where f.Descriptor.Id == d select f).SingleOrDefault()).Where(f => f != null).OrderBy(f => f.Descriptor.Name);
|
||||||
var missingDependencies = feature.Descriptor.Dependencies
|
var missingDependencies = feature.Descriptor.Dependencies
|
||||||
.Where(d => !Model.Features.Any(f => f.Descriptor.Id == d));
|
.Where(d => !Model.Features.Any(f => f.Descriptor.Id == d));
|
||||||
showActions = categoryName.ToString() != "Core" && missingDependencies.Count() == 0;
|
showActions = categoryName.ToString() != "Core" && missingDependencies.Count() == 0;
|
||||||
|
@@ -249,6 +249,8 @@ namespace Orchard.Packaging.Controllers {
|
|||||||
ExtensionDescriptor extensionDescriptor = _packageManager.GetExtensionDescriptor(package);
|
ExtensionDescriptor extensionDescriptor = _packageManager.GetExtensionDescriptor(package);
|
||||||
|
|
||||||
List<PackagingInstallFeatureViewModel> features = extensionDescriptor.Features
|
List<PackagingInstallFeatureViewModel> features = extensionDescriptor.Features
|
||||||
|
.Where(featureDescriptor => !DefaultExtensionTypes.IsTheme(featureDescriptor.Extension.ExtensionType) &&
|
||||||
|
!featureDescriptor.Id.Equals(featureDescriptor.Extension.Id))
|
||||||
.Select(featureDescriptor => new PackagingInstallFeatureViewModel {
|
.Select(featureDescriptor => new PackagingInstallFeatureViewModel {
|
||||||
Enable = true, // by default all features are enabled
|
Enable = true, // by default all features are enabled
|
||||||
FeatureDescriptor = featureDescriptor
|
FeatureDescriptor = featureDescriptor
|
||||||
|
@@ -106,6 +106,7 @@
|
|||||||
<Content Include="Content\Images\moduleDefaultIcon.png" />
|
<Content Include="Content\Images\moduleDefaultIcon.png" />
|
||||||
<Content Include="Content\Images\stars.png" />
|
<Content Include="Content\Images\stars.png" />
|
||||||
<Content Include="Module.txt" />
|
<Content Include="Module.txt" />
|
||||||
|
<Content Include="Scripts\orchard-packaging-admin.js" />
|
||||||
<Content Include="Service References\GalleryServer\Reference.datasvcmap">
|
<Content Include="Service References\GalleryServer\Reference.datasvcmap">
|
||||||
<Generator>DataServiceClientGenerator</Generator>
|
<Generator>DataServiceClientGenerator</Generator>
|
||||||
<LastGenOutput>Reference.cs</LastGenOutput>
|
<LastGenOutput>Reference.cs</LastGenOutput>
|
||||||
@@ -164,6 +165,11 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="Views\Gallery\InstallModule.cshtml" />
|
<Content Include="Views\Gallery\InstallModule.cshtml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Scripts\Web.config">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
@@ -5,7 +5,9 @@ namespace Orchard.Packaging {
|
|||||||
[OrchardFeature("Gallery")]
|
[OrchardFeature("Gallery")]
|
||||||
public class ResourceManifest : IResourceManifestProvider {
|
public class ResourceManifest : IResourceManifestProvider {
|
||||||
public void BuildManifests(ResourceManifestBuilder builder) {
|
public void BuildManifests(ResourceManifestBuilder builder) {
|
||||||
builder.Add().DefineStyle("PackagingAdmin").SetUrl("orchard-packaging-admin.css");
|
UI.Resources.ResourceManifest resourceManifest = builder.Add();
|
||||||
|
resourceManifest.DefineScript("PackagingModulesAdmin").SetUrl("orchard-packaging-admin.js");
|
||||||
|
resourceManifest.DefineStyle("PackagingAdmin").SetUrl("orchard-packaging-admin.css");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
21
src/Orchard.Web/Modules/Orchard.Packaging/Scripts/Web.config
Normal file
21
src/Orchard.Web/Modules/Orchard.Packaging/Scripts/Web.config
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration>
|
||||||
|
<appSettings>
|
||||||
|
<add key="webpages:Enabled" value="false" />
|
||||||
|
</appSettings>
|
||||||
|
<system.web>
|
||||||
|
<httpHandlers>
|
||||||
|
<!-- iis6 - for any request in this location, return via managed static file handler -->
|
||||||
|
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
|
||||||
|
</httpHandlers>
|
||||||
|
</system.web>
|
||||||
|
<system.webServer>
|
||||||
|
<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,24 @@
|
|||||||
|
function checkCustom() {
|
||||||
|
setDisabled(document.getElementById("custom_features"), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkAll() {
|
||||||
|
setDisabled(document.getElementById("custom_features"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function setDisabled(el, state) {
|
||||||
|
try {
|
||||||
|
el.disabled = state;
|
||||||
|
}
|
||||||
|
catch (E) { }
|
||||||
|
|
||||||
|
if (el.childNodes && el.childNodes.length > 0) {
|
||||||
|
for (var x = 0; x < el.childNodes.length; x++) {
|
||||||
|
setDisabled(el.childNodes[x]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
(function ($) {
|
||||||
|
$(checkAll)
|
||||||
|
})(jQuery);
|
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
@{
|
@{
|
||||||
Style.Require("PackagingAdmin");
|
Style.Require("PackagingAdmin");
|
||||||
|
Script.Require("PackagingModulesAdmin").AtFoot();
|
||||||
|
|
||||||
Layout.Title = T("{0} - {1} Details", Model.ExtensionDescriptor.Name, Model.ExtensionDescriptor.Version).ToString();
|
Layout.Title = T("{0} - {1} Details", Model.ExtensionDescriptor.Name, Model.ExtensionDescriptor.Version).ToString();
|
||||||
}
|
}
|
||||||
@@ -13,16 +14,16 @@
|
|||||||
<h3>@T("Which type of installation do you want?").ToString()</h3>
|
<h3>@T("Which type of installation do you want?").ToString()</h3>
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
@Html.RadioButton("PackagingInstallMode", "All", (Model.PackagingInstallMode == PackagingInstallMode.All), new { id = "PackagingInstallMode_All" })
|
@Html.RadioButton("PackagingInstallMode", "All", (Model.PackagingInstallMode == PackagingInstallMode.All), new { id = "PackagingInstallMode_All", onClick = "checkAll();" })
|
||||||
<label for="Features_All" class="forcheckbox">@T("Install and enable all features")</label>
|
<label for="Features_All" class="forcheckbox">@T("Install and enable all features")</label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
if (Model.Features.Count > 0) {
|
if (Model.Features.Count > 0) {
|
||||||
<fieldset>
|
<fieldset>
|
||||||
@Html.RadioButton("PackagingInstallMode", "Custom", (Model.PackagingInstallMode == PackagingInstallMode.Custom), new { id = "PackagingInstallMode_Custom" })
|
@Html.RadioButton("PackagingInstallMode", "Custom", (Model.PackagingInstallMode == PackagingInstallMode.Custom), new { id = "PackagingInstallMode_Custom", onClick = "checkCustom();" })
|
||||||
<label for="Features_Custom" class="forcheckbox">@T("Custom")</label>
|
<label for="Features_Custom" class="forcheckbox">@T("Custom")</label>
|
||||||
|
|
||||||
<div class="custom_details">
|
<div class="custom_details" id="custom_features">
|
||||||
<legend>@T("Pick the features you want enabled during install").ToString()</legend>
|
<legend>@T("Pick the features you want enabled during install").ToString()</legend>
|
||||||
|
|
||||||
@{ var index = 0; }
|
@{ var index = 0; }
|
||||||
@@ -32,6 +33,7 @@
|
|||||||
@Html.HiddenFor(m => m.Features[index].FeatureDescriptor.Name)
|
@Html.HiddenFor(m => m.Features[index].FeatureDescriptor.Name)
|
||||||
|
|
||||||
@Html.EditorFor(m => m.Features[index].Enable)
|
@Html.EditorFor(m => m.Features[index].Enable)
|
||||||
|
|
||||||
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.Features[index].Enable)">@feature.FeatureDescriptor.Name</label>
|
<label class="forcheckbox" for="@Html.FieldIdFor(m => m.Features[index].Enable)">@feature.FeatureDescriptor.Name</label>
|
||||||
@{ index++; }
|
@{ index++; }
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user