From 03c2c8cd16be277d1ed5d71fdad19946243d2561 Mon Sep 17 00:00:00 2001 From: JeremyCaney Date: Tue, 31 Dec 2019 13:34:44 -0800 Subject: [PATCH] Move views back into `/Areas` This effectively reverts a portion of #f618fc8, which removed the interstitial `/Areas/Editor` folders in order to flatten the folder structure. It turns out that views in a **Razor Class Library** are not namespaced, unlike `/wwwroot`, and are thus subject to being subsequently overwritten by host sites embedding the library. This is especially concerning for `/Views/Shared` where common file names, such as `_Layout.cshtml`, could easily take priority. This is actually a useful behavior in some contexts, as it allows more flexibility on overriding elements. But it's peculiar that Microsoft applied this to `/wwwroot` but not `/Views` (e.g., by creating some type of assembly based namespacing convention). Having the files buried a couple additional levels is less than ideal organizationally, but at least we can keep the `.cs` files in (children of) the root directory. --- .../Editor}/Views/Editor/Components/Boolean/Default.cshtml | 2 +- .../Views/Editor/Components/ContentTypeList/Default.cshtml | 0 .../Editor}/Views/Editor/Components/DateTime/Default.cshtml | 2 +- .../Views/Editor/Components/DisplayOptions/Default.cshtml | 2 +- .../Editor}/Views/Editor/Components/FileList/Default.cshtml | 2 +- .../Editor}/Views/Editor/Components/FilePath/Default.cshtml | 2 +- .../Editor}/Views/Editor/Components/HTML/Default.cshtml | 2 +- .../Views/Editor/Components/LastModified/Default.cshtml | 2 +- .../Views/Editor/Components/LastModifiedBy/Default.cshtml | 2 +- .../Views/Editor/Components/NestedTopicList/Default.cshtml | 2 +- .../Editor}/Views/Editor/Components/Number/Default.cshtml | 2 +- .../Views/Editor/Components/Relationship/Default.cshtml | 2 +- .../Editor}/Views/Editor/Components/Text/Default.cshtml | 2 +- .../Editor}/Views/Editor/Components/TextArea/Default.cshtml | 2 +- .../Views/Editor/Components/TokenizedTopicList/Default.cshtml | 2 +- .../Editor}/Views/Editor/Components/TopicList/Default.cshtml | 2 +- .../Views/Editor/Components/TopicReference/Default.cshtml | 0 .../{ => Areas/Editor}/Views/Editor/Components/_Layout.cshtml | 0 .../{ => Areas/Editor}/Views/Editor/Edit.cshtml | 1 - .../{ => Areas/Editor}/Views/Shared/CloseModal.cshtml | 0 .../{ => Areas/Editor}/Views/Shared/Error.cshtml | 0 .../{ => Areas/Editor}/Views/Shared/_Layout.cshtml | 0 .../{ => Areas/Editor}/Views/Shared/_Toolbar.cshtml | 0 .../{ => Areas/Editor}/Views/Shared/_TreeViewScript.cshtml | 0 .../{ => Areas/Editor}/Views/_ViewImports.cshtml | 0 OnTopic.Editor.AspNetCore/Areas/Editor/Views/_ViewStart.cshtml | 3 +++ OnTopic.Editor.AspNetCore/Views/_ViewStart.cshtml | 3 --- 27 files changed, 18 insertions(+), 19 deletions(-) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Editor/Components/Boolean/Default.cshtml (90%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Editor/Components/ContentTypeList/Default.cshtml (100%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Editor/Components/DateTime/Default.cshtml (95%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Editor/Components/DisplayOptions/Default.cshtml (93%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Editor/Components/FileList/Default.cshtml (90%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Editor/Components/FilePath/Default.cshtml (86%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Editor/Components/HTML/Default.cshtml (96%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Editor/Components/LastModified/Default.cshtml (66%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Editor/Components/LastModifiedBy/Default.cshtml (67%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Editor/Components/NestedTopicList/Default.cshtml (98%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Editor/Components/Number/Default.cshtml (89%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Editor/Components/Relationship/Default.cshtml (97%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Editor/Components/Text/Default.cshtml (88%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Editor/Components/TextArea/Default.cshtml (90%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Editor/Components/TokenizedTopicList/Default.cshtml (95%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Editor/Components/TopicList/Default.cshtml (85%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Editor/Components/TopicReference/Default.cshtml (100%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Editor/Components/_Layout.cshtml (100%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Editor/Edit.cshtml (98%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Shared/CloseModal.cshtml (100%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Shared/Error.cshtml (100%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Shared/_Layout.cshtml (100%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Shared/_Toolbar.cshtml (100%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/Shared/_TreeViewScript.cshtml (100%) rename OnTopic.Editor.AspNetCore/{ => Areas/Editor}/Views/_ViewImports.cshtml (100%) create mode 100644 OnTopic.Editor.AspNetCore/Areas/Editor/Views/_ViewStart.cshtml delete mode 100644 OnTopic.Editor.AspNetCore/Views/_ViewStart.cshtml diff --git a/OnTopic.Editor.AspNetCore/Views/Editor/Components/Boolean/Default.cshtml b/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/Boolean/Default.cshtml similarity index 90% rename from OnTopic.Editor.AspNetCore/Views/Editor/Components/Boolean/Default.cshtml rename to OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/Boolean/Default.cshtml index a52c2970..a2a0b23e 100644 --- a/OnTopic.Editor.AspNetCore/Views/Editor/Components/Boolean/Default.cshtml +++ b/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/Boolean/Default.cshtml @@ -1,7 +1,7 @@ @model BooleanAttributeViewModel @{ - Layout = "~/Views/Editor/Components/_Layout.cshtml"; + Layout = "~/Areas/Editor/Views/Editor/Components/_Layout.cshtml"; }
diff --git a/OnTopic.Editor.AspNetCore/Views/Editor/Components/ContentTypeList/Default.cshtml b/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/ContentTypeList/Default.cshtml similarity index 100% rename from OnTopic.Editor.AspNetCore/Views/Editor/Components/ContentTypeList/Default.cshtml rename to OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/ContentTypeList/Default.cshtml diff --git a/OnTopic.Editor.AspNetCore/Views/Editor/Components/DateTime/Default.cshtml b/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/DateTime/Default.cshtml similarity index 95% rename from OnTopic.Editor.AspNetCore/Views/Editor/Components/DateTime/Default.cshtml rename to OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/DateTime/Default.cshtml index df1a34c9..103285a4 100644 --- a/OnTopic.Editor.AspNetCore/Views/Editor/Components/DateTime/Default.cshtml +++ b/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/DateTime/Default.cshtml @@ -1,7 +1,7 @@ @model DateTimeAttributeViewModel @{ - Layout = "~/Views/Editor/Components/_Layout.cshtml"; + Layout = "~/Areas/Editor/Views/Editor/Components/_Layout.cshtml"; var includeDatePicker = Model.AttributeDescriptor.IncludeDatePicker?? true; var includeTimePicker = Model.AttributeDescriptor.IncludeTimePicker?? true; } diff --git a/OnTopic.Editor.AspNetCore/Views/Editor/Components/DisplayOptions/Default.cshtml b/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/DisplayOptions/Default.cshtml similarity index 93% rename from OnTopic.Editor.AspNetCore/Views/Editor/Components/DisplayOptions/Default.cshtml rename to OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/DisplayOptions/Default.cshtml index 4d974669..dbf4f77e 100644 --- a/OnTopic.Editor.AspNetCore/Views/Editor/Components/DisplayOptions/Default.cshtml +++ b/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/DisplayOptions/Default.cshtml @@ -1,7 +1,7 @@ @model AttributeViewModel @{ - Layout = "~/Views/Editor/Components/_Layout.cshtml"; + Layout = "~/Areas/Editor/Views/Editor/Components/_Layout.cshtml"; }
diff --git a/OnTopic.Editor.AspNetCore/Views/Editor/Components/FileList/Default.cshtml b/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/FileList/Default.cshtml similarity index 90% rename from OnTopic.Editor.AspNetCore/Views/Editor/Components/FileList/Default.cshtml rename to OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/FileList/Default.cshtml index 970a890f..549cbfa3 100644 --- a/OnTopic.Editor.AspNetCore/Views/Editor/Components/FileList/Default.cshtml +++ b/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/FileList/Default.cshtml @@ -1,7 +1,7 @@ @model FileListAttributeViewModel @{ - Layout = "~/Views/Editor/Components/_Layout.cshtml"; + Layout = "~/Areas/Editor/Views/Editor/Components/_Layout.cshtml"; } @if (Model.Files.Count > 0) { diff --git a/OnTopic.Editor.AspNetCore/Views/Editor/Components/FilePath/Default.cshtml b/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/FilePath/Default.cshtml similarity index 86% rename from OnTopic.Editor.AspNetCore/Views/Editor/Components/FilePath/Default.cshtml rename to OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/FilePath/Default.cshtml index 7f3a4aaa..d5445027 100644 --- a/OnTopic.Editor.AspNetCore/Views/Editor/Components/FilePath/Default.cshtml +++ b/OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/FilePath/Default.cshtml @@ -1,7 +1,7 @@ @model FilePathAttributeViewModel @{ - Layout = "~/Views/Editor/Components/_Layout.cshtml"; + Layout = "~/Areas/Editor/Views/Editor/Components/_Layout.cshtml"; } @{ - Layout = "~/Views/Editor/Components/_Layout.cshtml"; + Layout = "~/Areas/Editor/Views/Editor/Components/_Layout.cshtml"; }