Skip to content

Commit 03c2c8c

Browse files
committed
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.
1 parent b9d3ba6 commit 03c2c8c

27 files changed

Lines changed: 18 additions & 19 deletions

File tree

OnTopic.Editor.AspNetCore/Views/Editor/Components/Boolean/Default.cshtml renamed to OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/Boolean/Default.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@model BooleanAttributeViewModel
22

33
@{
4-
Layout = "~/Views/Editor/Components/_Layout.cshtml";
4+
Layout = "~/Areas/Editor/Views/Editor/Components/_Layout.cshtml";
55
}
66

77
<div class="@Model.AttributeDescriptor.CssClass form-check form-check-inline">

OnTopic.Editor.AspNetCore/Views/Editor/Components/ContentTypeList/Default.cshtml renamed to OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/ContentTypeList/Default.cshtml

File renamed without changes.

OnTopic.Editor.AspNetCore/Views/Editor/Components/DateTime/Default.cshtml renamed to OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/DateTime/Default.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@model DateTimeAttributeViewModel
22

33
@{
4-
Layout = "~/Views/Editor/Components/_Layout.cshtml";
4+
Layout = "~/Areas/Editor/Views/Editor/Components/_Layout.cshtml";
55
var includeDatePicker = Model.AttributeDescriptor.IncludeDatePicker?? true;
66
var includeTimePicker = Model.AttributeDescriptor.IncludeTimePicker?? true;
77
}

OnTopic.Editor.AspNetCore/Views/Editor/Components/DisplayOptions/Default.cshtml renamed to OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/DisplayOptions/Default.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@model AttributeViewModel<AttributeDescriptorTopicViewModel>
22

33
@{
4-
Layout = "~/Views/Editor/Components/_Layout.cshtml";
4+
Layout = "~/Areas/Editor/Views/Editor/Components/_Layout.cshtml";
55
}
66

77
<div class="@Model.AttributeDescriptor.CssClass form-check form-check-inline">

OnTopic.Editor.AspNetCore/Views/Editor/Components/FileList/Default.cshtml renamed to OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/FileList/Default.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@model FileListAttributeViewModel
22

33
@{
4-
Layout = "~/Views/Editor/Components/_Layout.cshtml";
4+
Layout = "~/Areas/Editor/Views/Editor/Components/_Layout.cshtml";
55
}
66

77
@if (Model.Files.Count > 0) {

OnTopic.Editor.AspNetCore/Views/Editor/Components/FilePath/Default.cshtml renamed to OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/FilePath/Default.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@model FilePathAttributeViewModel
22

33
@{
4-
Layout = "~/Views/Editor/Components/_Layout.cshtml";
4+
Layout = "~/Areas/Editor/Views/Editor/Components/_Layout.cshtml";
55
}
66

77
<input

OnTopic.Editor.AspNetCore/Views/Editor/Components/HTML/Default.cshtml renamed to OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/HTML/Default.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@model AttributeViewModel<HtmlAttributeTopicViewModel>
22

33
@{
4-
Layout = "~/Views/Editor/Components/_Layout.cshtml";
4+
Layout = "~/Areas/Editor/Views/Editor/Components/_Layout.cshtml";
55
}
66

77
<style type="text/css">

OnTopic.Editor.AspNetCore/Views/Editor/Components/LastModified/Default.cshtml renamed to OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/LastModified/Default.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@model LastModifiedAttributeViewModel
22

33
@{
4-
Layout = "~/Views/Editor/Components/_Layout.cshtml";
4+
Layout = "~/Areas/Editor/Views/Editor/Components/_Layout.cshtml";
55
}
66

77
<div class="label">

OnTopic.Editor.AspNetCore/Views/Editor/Components/LastModifiedBy/Default.cshtml renamed to OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/LastModifiedBy/Default.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@model LastModifiedByAttributeViewModel
22

33
@{
4-
Layout = "~/Views/Editor/Components/_Layout.cshtml";
4+
Layout = "~/Areas/Editor/Views/Editor/Components/_Layout.cshtml";
55
}
66

77
<div class="label">

OnTopic.Editor.AspNetCore/Views/Editor/Components/NestedTopicList/Default.cshtml renamed to OnTopic.Editor.AspNetCore/Areas/Editor/Views/Editor/Components/NestedTopicList/Default.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@model NestedTopicListAttributeViewModel
22

33
@{
4-
Layout = "~/Views/Editor/Components/_Layout.cshtml";
4+
Layout = "~/Areas/Editor/Views/Editor/Components/_Layout.cshtml";
55
}
66

77
<script type="text/javascript">

0 commit comments

Comments
 (0)