Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9be3dd4a5 | ||
|
|
8ff1d49346 | ||
|
|
1473e41a20 | ||
|
|
2038898f4c | ||
|
|
40c08f81c4 |
+1
-1
@@ -19,4 +19,4 @@ using System.Resources;
|
||||
|
||||
// these are FYI and changed automatically
|
||||
[assembly: AssemblyFileVersion("8.18.0")]
|
||||
[assembly: AssemblyInformationalVersion("8.18.0-rc")]
|
||||
[assembly: AssemblyInformationalVersion("8.18.0")]
|
||||
|
||||
@@ -213,6 +213,7 @@ namespace Umbraco.Core.Migrations.Upgrade
|
||||
|
||||
//FINAL
|
||||
To<AddContentVersionCleanupFeature>("{8BAF5E6C-DCB7-41AE-824F-4215AE4F1F98}");
|
||||
To<NoopMigration>("{03482BB0-CF13-475C-845E-ECB8319DBE3C}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
-7
@@ -182,23 +182,31 @@
|
||||
}
|
||||
);
|
||||
|
||||
$scope.propertyEditorDisabled = function (property) {
|
||||
$scope.propertyEditorInherited = function (property) {
|
||||
if (property.unlockInvariantValue) {
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
var contentLanguage = $scope.content.language;
|
||||
|
||||
var canEditCulture = !contentLanguage ||
|
||||
// If the property culture equals the content culture it can be edited
|
||||
property.culture === contentLanguage.culture ||
|
||||
// A culture-invariant property can only be edited by the default language variant
|
||||
(property.culture == null && contentLanguage.isDefault);
|
||||
// If the property culture equals the content culture it can be edited
|
||||
property.culture === contentLanguage.culture ||
|
||||
// A culture-invariant property can only be edited by the default language variant
|
||||
(property.culture == null && contentLanguage.isDefault);
|
||||
|
||||
var canEditSegment = property.segment === $scope.content.segment;
|
||||
|
||||
return !canEditCulture || !canEditSegment;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.propertyEditorDisabled = function (property) {
|
||||
if (property.readonly) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $scope.propertyEditorInherited(property);
|
||||
};
|
||||
}
|
||||
|
||||
var directive = {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
data-element="property-{{property.alias}}"
|
||||
ng-repeat="property in tab.properties track by property.alias"
|
||||
property="property"
|
||||
show-inherit="propertyEditorDisabled(property)"
|
||||
show-inherit="propertyEditorInherited(property)"
|
||||
inherits-from="defaultVariant.displayName">
|
||||
|
||||
<div ng-class="{'o-40 cursor-not-allowed': propertyEditorDisabled(property) }">
|
||||
@@ -41,7 +41,7 @@
|
||||
data-element="property-{{property.alias}}"
|
||||
ng-repeat="property in group.properties track by property.alias"
|
||||
property="property"
|
||||
show-inherit="propertyEditorDisabled(property)"
|
||||
show-inherit="propertyEditorInherited(property)"
|
||||
inherits-from="defaultVariant.displayName">
|
||||
|
||||
<div ng-class="{'o-40 cursor-not-allowed': propertyEditorDisabled(property) }">
|
||||
|
||||
+2
-2
@@ -45,10 +45,10 @@
|
||||
show-inherit="vm.model.variants.length > 1 && !property.culture && !activeVariant.language.isDefault"
|
||||
inherits-from="defaultVariant.language.name">
|
||||
|
||||
<div ng-class="{'o-40 cursor-not-allowed': vm.model.variants.length > 1 && !activeVariant.language.isDefault && !property.culture && !property.unlockInvariantValue}">
|
||||
<div ng-class="{'o-40 cursor-not-allowed': property.readonly || (vm.model.variants.length > 1 && !activeVariant.language.isDefault && !property.culture && !property.unlockInvariantValue)}">
|
||||
<umb-property-editor
|
||||
model="property"
|
||||
preview="vm.model.variants.length > 1 && !activeVariant.language.isDefault && !property.culture && !property.unlockInvariantValue">
|
||||
preview="property.readonly || (vm.model.variants.length > 1 && !activeVariant.language.isDefault && !property.culture && !property.unlockInvariantValue)">
|
||||
</umb-property-editor>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -306,7 +306,7 @@ namespace Umbraco.Web.Editors
|
||||
switch (type)
|
||||
{
|
||||
case Core.Constants.Trees.PartialViews:
|
||||
if (IsDirectory(virtualPath, SystemDirectories.PartialViews))
|
||||
if (IsDirectory(virtualPath, SystemDirectories.PartialViews, Current.FileSystems.PartialViewsFileSystem))
|
||||
{
|
||||
Services.FileService.DeletePartialViewFolder(virtualPath);
|
||||
return Request.CreateResponse(HttpStatusCode.OK);
|
||||
@@ -318,7 +318,7 @@ namespace Umbraco.Web.Editors
|
||||
return Request.CreateErrorResponse(HttpStatusCode.NotFound, "No Partial View or folder found with the specified path");
|
||||
|
||||
case Core.Constants.Trees.PartialViewMacros:
|
||||
if (IsDirectory(virtualPath, SystemDirectories.MacroPartials))
|
||||
if (IsDirectory(virtualPath, SystemDirectories.MacroPartials, Current.FileSystems.MacroPartialsFileSystem))
|
||||
{
|
||||
Services.FileService.DeletePartialViewMacroFolder(virtualPath);
|
||||
return Request.CreateResponse(HttpStatusCode.OK);
|
||||
@@ -330,7 +330,7 @@ namespace Umbraco.Web.Editors
|
||||
return Request.CreateErrorResponse(HttpStatusCode.NotFound, "No Partial View Macro or folder found with the specified path");
|
||||
|
||||
case Core.Constants.Trees.Scripts:
|
||||
if (IsDirectory(virtualPath, SystemDirectories.Scripts))
|
||||
if (IsDirectory(virtualPath, SystemDirectories.Scripts, Current.FileSystems.ScriptsFileSystem))
|
||||
{
|
||||
Services.FileService.DeleteScriptFolder(virtualPath);
|
||||
return Request.CreateResponse(HttpStatusCode.OK);
|
||||
@@ -343,7 +343,7 @@ namespace Umbraco.Web.Editors
|
||||
return Request.CreateErrorResponse(HttpStatusCode.NotFound, "No Script or folder found with the specified path");
|
||||
|
||||
case Core.Constants.Trees.Stylesheets:
|
||||
if (IsDirectory(virtualPath, SystemDirectories.Css))
|
||||
if (IsDirectory(virtualPath, SystemDirectories.Css, Current.FileSystems.StylesheetsFileSystem))
|
||||
{
|
||||
Services.FileService.DeleteStyleSheetFolder(virtualPath);
|
||||
return Request.CreateResponse(HttpStatusCode.OK);
|
||||
@@ -634,14 +634,23 @@ namespace Umbraco.Web.Editors
|
||||
return value;
|
||||
}
|
||||
|
||||
private bool IsDirectory(string virtualPath, string systemDirectory)
|
||||
private bool IsDirectory(string virtualPath, string systemDirectory, IFileSystem fileSystem)
|
||||
{
|
||||
var path = IOHelper.MapPath(systemDirectory + "/" + virtualPath);
|
||||
var dirInfo = new DirectoryInfo(path);
|
||||
|
||||
// If you turn off indexing in Windows this will have the attribute:
|
||||
// `FileAttributes.Directory | FileAttributes.NotContentIndexed`
|
||||
return (dirInfo.Attributes & FileAttributes.Directory) != 0;
|
||||
// If it's a physical filesystem check with directory info
|
||||
if (fileSystem.CanAddPhysical)
|
||||
{
|
||||
var dirInfo = new DirectoryInfo(path);
|
||||
|
||||
// If you turn off indexing in Windows this will have the attribute:
|
||||
// `FileAttributes.Directory | FileAttributes.NotContentIndexed`
|
||||
return (dirInfo.Attributes & FileAttributes.Directory) != 0;
|
||||
}
|
||||
|
||||
// Otherwise check the filesystem abstraction to see if the folder exists
|
||||
// Since this is used for delete, it presumably exists if we're trying to delete it
|
||||
return fileSystem.DirectoryExists(path);
|
||||
}
|
||||
|
||||
// this is an internal class for passing stylesheet data from the client to the controller while editing
|
||||
|
||||
Reference in New Issue
Block a user