From a694aed9de3338c15e93ef96f3dbb5f7e71e798d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Tue, 18 Dec 2018 16:55:28 +0100 Subject: [PATCH 1/2] Update assets references to use app-relative paths --- .../LinkAdminNode.Fields.TreeEdit.cshtml | 8 ++--- ...laceholderAdminNode.Fields.TreeEdit.cshtml | 8 ++--- .../Views/Node/List.cshtml | 4 +-- .../Views/Tree/Edit.cshtml | 2 +- .../Views/Tree/List.cshtml | 4 +-- .../Views/Admin/Index.cshtml | 20 +++++------ .../Views/ContentPickerField.Edit.cshtml | 4 +-- .../Views/HtmlField-Wysiwyg.Edit.cshtml | 4 +-- .../Views/Media-HtmlField.Modal.cshtml | 6 ++-- .../Views/NumericField-Slider.Edit.cshtml | 4 +-- .../Views/TextField-IconPicker.Edit.cshtml | 8 ++--- ...ldPredefinedListEditorSettings.Edit.cshtml | 4 +-- .../Views/ContentPreview.Button.cshtml | 2 +- .../Views/Preview/Index.cshtml | 2 +- .../Views/Content.Edit.cshtml | 2 +- ...ntentTypesAdminNode.Fields.TreeEdit.cshtml | 6 ++-- .../CreateContentTask.Fields.Edit.cshtml | 2 +- .../Views/Items/EmailTask.Fields.Edit.cshtml | 2 +- .../Views/BagPart.Edit.cshtml | 4 +-- .../Views/FlowPart.Edit.cshtml | 4 +-- .../Views/HtmlBodyPart-Wysiwyg.Edit.cshtml | 4 +-- .../Views/Media-HtmlBodyPart.Modal.cshtml | 6 ++-- .../Views/LiquidPart.Edit.cshtml | 2 +- .../ListsAdminNode.Fields.TreeEdit.cshtml | 4 +-- .../MarkdownBodyPart-Wysiwyg.Edit.cshtml | 4 +-- .../Views/MarkdownField-Wysiwyg.Edit.cshtml | 4 +-- .../Views/Media-MarkdownBodyPart.Modal.cshtml | 6 ++-- .../OrchardCore.Media/README.md | 6 ++-- .../Views/Admin/Index.cshtml | 4 +-- .../Views/MediaField.Edit.cshtml | 4 +-- .../Views/MenuItem.Edit.cshtml | 2 +- .../Views/MenuPart.Edit.cshtml | 4 +-- .../OrchardCore.Resources/README.md | 4 +-- .../OrchardCore.Resources/ResourceManifest.cs | 34 +++++++++---------- .../Views/Setup/Index.cshtml | 2 +- .../OrchardCore.Setup/Views/_Layout.cshtml | 4 +-- .../Views/TaxonomyPart.Edit.cshtml | 4 +-- .../Views/Term.Edit.cshtml | 2 +- .../Views/Preview/Index.cshtml | 2 +- .../Views/Template/Create.cshtml | 4 +-- .../Views/Template/Edit.cshtml | 4 +-- .../Views/Admin/Create.cshtml | 2 +- .../Views/Admin/Edit.cshtml | 2 +- .../Views/Admin/Index.cshtml | 2 +- .../Views/WidgetsListPart.Edit.cshtml | 4 +-- .../Items/HttpRequestTask.Fields.Edit.cshtml | 2 +- .../Items/HttpResponseTask.Fields.Edit.cshtml | 2 +- .../TheAdmin/Views/Layout-Login.cshtml | 4 +-- .../TheAdmin/Views/Layout.cshtml | 8 ++--- .../TheComingSoonTheme/Views/layout.liquid | 14 ++++---- .../TheTheme/Views/Layout.cshtml | 4 +-- .../Views/Layout.liquid | 2 +- .../Theme.Pages/Views/Layout.cshtml | 2 +- 53 files changed, 129 insertions(+), 129 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Items/LinkAdminNode.Fields.TreeEdit.cshtml b/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Items/LinkAdminNode.Fields.TreeEdit.cshtml index a10336000bc..34720dce1a0 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Items/LinkAdminNode.Fields.TreeEdit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Items/LinkAdminNode.Fields.TreeEdit.cshtml @@ -1,11 +1,11 @@ @model LinkAdminNodeViewModel - - + + - - + +
@T["Link"]
diff --git a/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Items/PlaceholderAdminNode.Fields.TreeEdit.cshtml b/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Items/PlaceholderAdminNode.Fields.TreeEdit.cshtml index edece7fc421..181a8b87d2e 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Items/PlaceholderAdminNode.Fields.TreeEdit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Items/PlaceholderAdminNode.Fields.TreeEdit.cshtml @@ -1,11 +1,11 @@ @model PlaceholderAdminNodeViewModel - - + + - - + +
@T["Placeholder"]
diff --git a/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Node/List.cshtml b/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Node/List.cshtml index 11f6dbca2ab..6963de75122 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Node/List.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Node/List.cshtml @@ -6,8 +6,8 @@ var index = 0; } - - + +
diff --git a/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Tree/Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Tree/Edit.cshtml index 75d40e829bb..92e59e25706 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Tree/Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Tree/Edit.cshtml @@ -1,5 +1,5 @@ @model AdminTreeEditViewModel - +

@RenderTitleSegments(T["Edit Admin Tree: {0}", Model.Name])

diff --git a/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Tree/List.cshtml b/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Tree/List.cshtml index 20a917ce5ea..90da3c224a9 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Tree/List.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.AdminTrees/Views/Tree/List.cshtml @@ -1,7 +1,7 @@ @model AdminTreeListViewModel - - + +

@RenderTitleSegments(T["Admin Trees"])

diff --git a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/Views/Admin/Index.cshtml b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/Views/Admin/Index.cshtml index ff250026b68..d497bb91b84 100644 --- a/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/Views/Admin/Index.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Apis.GraphQL/Views/Admin/Index.cshtml @@ -1,23 +1,23 @@ - - - - - diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/ContentPickerField.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/ContentPickerField.Edit.cshtml index 226a3e17726..850dbb59128 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/ContentPickerField.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/ContentPickerField.Edit.cshtml @@ -17,8 +17,8 @@ var multiple = settings.Multiple.ToString().ToLowerInvariant(); } - - + + diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Wysiwyg.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Wysiwyg.Edit.cshtml index b1cfda3a212..02bbbaabc53 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Wysiwyg.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/HtmlField-Wysiwyg.Edit.cshtml @@ -6,8 +6,8 @@ var settings = Model.PartFieldDefinition.Settings.ToObject(); } - - + +
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/Media-HtmlField.Modal.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/Media-HtmlField.Modal.cshtml index 38ff36f1bb3..0da85f4982c 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/Media-HtmlField.Modal.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/Media-HtmlField.Modal.cshtml @@ -1,4 +1,4 @@ - + - - + + diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Slider.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Slider.Edit.cshtml index d351c2b3cf4..f0a6e9077fe 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Slider.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/NumericField-Slider.Edit.cshtml @@ -11,8 +11,8 @@ string id = Html.IdFor(m => m.Value); } - - + +
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-IconPicker.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-IconPicker.Edit.cshtml index 18f78d35bce..b55f47f0f99 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-IconPicker.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextField-IconPicker.Edit.cshtml @@ -6,12 +6,12 @@ var settings = Model.PartFieldDefinition.Settings.ToObject(); } - - + + - - + +
diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextFieldPredefinedListEditorSettings.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextFieldPredefinedListEditorSettings.Edit.cshtml index b74d6df1cad..30795ea4a63 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextFieldPredefinedListEditorSettings.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Views/TextFieldPredefinedListEditorSettings.Edit.cshtml @@ -1,8 +1,8 @@ @using OrchardCore.ContentFields.Settings @model OrchardCore.ContentFields.ViewModels.PredefinedListSettingsViewModel - - + + diff --git a/src/OrchardCore.Modules/OrchardCore.ContentPreview/Views/ContentPreview.Button.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentPreview/Views/ContentPreview.Button.cshtml index 51176c74d5d..afe80e36ebf 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentPreview/Views/ContentPreview.Button.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentPreview/Views/ContentPreview.Button.cshtml @@ -10,4 +10,4 @@ - + diff --git a/src/OrchardCore.Modules/OrchardCore.ContentPreview/Views/Preview/Index.cshtml b/src/OrchardCore.Modules/OrchardCore.ContentPreview/Views/Preview/Index.cshtml index 6f12a68e2f2..f774d0686f5 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentPreview/Views/Preview/Index.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.ContentPreview/Views/Preview/Index.cshtml @@ -5,7 +5,7 @@ - + diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Views/Content.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Contents/Views/Content.Edit.cshtml index cc2f57814cd..906f9a22fc8 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Views/Content.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Views/Content.Edit.cshtml @@ -4,7 +4,7 @@ Display.LocalNavigation(Tabs: tabs); }*@ - +
diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Views/Items/ContentTypesAdminNode.Fields.TreeEdit.cshtml b/src/OrchardCore.Modules/OrchardCore.Contents/Views/Items/ContentTypesAdminNode.Fields.TreeEdit.cshtml index 6a73bd1dd4e..c1373790b16 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Views/Items/ContentTypesAdminNode.Fields.TreeEdit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Views/Items/ContentTypesAdminNode.Fields.TreeEdit.cshtml @@ -1,10 +1,10 @@ @model ContentTypesAdminNodeViewModel - - + + - +
@T["Content Types"]
diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Views/Items/CreateContentTask.Fields.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Contents/Views/Items/CreateContentTask.Fields.Edit.cshtml index 5649c6060d6..f4f1f662f83 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Views/Items/CreateContentTask.Fields.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Views/Items/CreateContentTask.Fields.Edit.cshtml @@ -28,7 +28,7 @@ - + - + - + + } @* Rendered only once per type to initialize the scripts its editor will need *@ diff --git a/src/OrchardCore.Modules/OrchardCore.Flows/Views/FlowPart.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Flows/Views/FlowPart.Edit.cshtml index 1f356957d23..ebb9baba697 100644 --- a/src/OrchardCore.Modules/OrchardCore.Flows/Views/FlowPart.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Flows/Views/FlowPart.Edit.cshtml @@ -71,8 +71,8 @@ await DisplayAsync(await ContentItemDisplayManager.BuildEditorAsync(contentItem, Model.Updater, true, "", Guid.NewGuid().ToString("n"))); } - - + + } - + +
diff --git a/src/OrchardCore.Modules/OrchardCore.Html/Views/Media-HtmlBodyPart.Modal.cshtml b/src/OrchardCore.Modules/OrchardCore.Html/Views/Media-HtmlBodyPart.Modal.cshtml index afcfb7065e9..23137285e51 100644 --- a/src/OrchardCore.Modules/OrchardCore.Html/Views/Media-HtmlBodyPart.Modal.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Html/Views/Media-HtmlBodyPart.Modal.cshtml @@ -1,4 +1,4 @@ - + - - + + diff --git a/src/OrchardCore.Modules/OrchardCore.Liquid/Views/LiquidPart.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Liquid/Views/LiquidPart.Edit.cshtml index 03ae97cb3ce..8b43a10a5bf 100644 --- a/src/OrchardCore.Modules/OrchardCore.Liquid/Views/LiquidPart.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Liquid/Views/LiquidPart.Edit.cshtml @@ -6,7 +6,7 @@ - +
diff --git a/src/OrchardCore.Modules/OrchardCore.Lists/Views/Items/ListsAdminNode.Fields.TreeEdit.cshtml b/src/OrchardCore.Modules/OrchardCore.Lists/Views/Items/ListsAdminNode.Fields.TreeEdit.cshtml index 766189c93b5..19a837edfbb 100644 --- a/src/OrchardCore.Modules/OrchardCore.Lists/Views/Items/ListsAdminNode.Fields.TreeEdit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Lists/Views/Items/ListsAdminNode.Fields.TreeEdit.cshtml @@ -1,9 +1,9 @@ @model ListsAdminNodeViewModel - + - +
@T["Lists"]
diff --git a/src/OrchardCore.Modules/OrchardCore.Markdown/Views/MarkdownBodyPart-Wysiwyg.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Markdown/Views/MarkdownBodyPart-Wysiwyg.Edit.cshtml index 129fb0d8aca..911e5a936ab 100644 --- a/src/OrchardCore.Modules/OrchardCore.Markdown/Views/MarkdownBodyPart-Wysiwyg.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Markdown/Views/MarkdownBodyPart-Wysiwyg.Edit.cshtml @@ -7,8 +7,8 @@ var settings = Model.TypePartDefinition.Settings.ToObject(); } - - + +
diff --git a/src/OrchardCore.Modules/OrchardCore.Markdown/Views/MarkdownField-Wysiwyg.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Markdown/Views/MarkdownField-Wysiwyg.Edit.cshtml index 916114d9ec3..7449adfd300 100644 --- a/src/OrchardCore.Modules/OrchardCore.Markdown/Views/MarkdownField-Wysiwyg.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Markdown/Views/MarkdownField-Wysiwyg.Edit.cshtml @@ -6,8 +6,8 @@ var settings = Model.PartFieldDefinition.Settings.ToObject(); } - - + +
diff --git a/src/OrchardCore.Modules/OrchardCore.Markdown/Views/Media-MarkdownBodyPart.Modal.cshtml b/src/OrchardCore.Modules/OrchardCore.Markdown/Views/Media-MarkdownBodyPart.Modal.cshtml index 50421d74c1f..d6b191172d2 100644 --- a/src/OrchardCore.Modules/OrchardCore.Markdown/Views/Media-MarkdownBodyPart.Modal.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Markdown/Views/Media-MarkdownBodyPart.Modal.cshtml @@ -1,4 +1,4 @@ - + - - + + diff --git a/src/OrchardCore.Modules/OrchardCore.Media/README.md b/src/OrchardCore.Modules/OrchardCore.Media/README.md index 17845b3eb51..e43c048626b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/README.md +++ b/src/OrchardCore.Modules/OrchardCore.Media/README.md @@ -34,7 +34,7 @@ Renders an `` HTML tag. #### Output -`` +`` #### Options @@ -54,7 +54,7 @@ Convert the input URL to create a resized image with the specified size argument #### Output -`` +`` #### Arguments @@ -102,7 +102,7 @@ Stretches the resized image to fit the bounds of its container. ### Output -`` +`` ## Razor Helpers diff --git a/src/OrchardCore.Modules/OrchardCore.Media/Views/Admin/Index.cshtml b/src/OrchardCore.Modules/OrchardCore.Media/Views/Admin/Index.cshtml index 3b971847a23..dcd45988104 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/Views/Admin/Index.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Media/Views/Admin/Index.cshtml @@ -1,5 +1,5 @@ - - + + diff --git a/src/OrchardCore.Modules/OrchardCore.Media/Views/MediaField.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Media/Views/MediaField.Edit.cshtml index ee271cbf5af..4ca92c43ec0 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/Views/MediaField.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Media/Views/MediaField.Edit.cshtml @@ -2,8 +2,8 @@ @using OrchardCore.Media.Settings; @using OrchardCore.ContentManagement.Metadata.Models - - + + diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/Views/MenuItem.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Menu/Views/MenuItem.Edit.cshtml index 8b7f03f85c9..312be9c27b8 100644 --- a/src/OrchardCore.Modules/OrchardCore.Menu/Views/MenuItem.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Menu/Views/MenuItem.Edit.cshtml @@ -1,4 +1,4 @@ - +
diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/Views/MenuPart.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Menu/Views/MenuPart.Edit.cshtml index 2ea8f2d7726..a671b31d6f5 100644 --- a/src/OrchardCore.Modules/OrchardCore.Menu/Views/MenuPart.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Menu/Views/MenuPart.Edit.cshtml @@ -9,8 +9,8 @@ The shape is created from MenuPartDisplayDriver *@ - - + + @using OrchardCore.ContentManagement.Metadata.Settings; diff --git a/src/OrchardCore.Modules/OrchardCore.Resources/README.md b/src/OrchardCore.Modules/OrchardCore.Resources/README.md index 6c7889fe943..b8b9f94b40a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Resources/README.md +++ b/src/OrchardCore.Modules/OrchardCore.Resources/README.md @@ -156,7 +156,7 @@ You can declare a new resource directly from a view, and it will be injected onl ``` ```razor - + ``` In this example we also define a dependency on the script named `baz` with the version `1.0`. If the version was not set @@ -169,7 +169,7 @@ You can also do the same for a stylesheet: ``` ```razor - + ``` #### Custom scripts diff --git a/src/OrchardCore.Modules/OrchardCore.Resources/ResourceManifest.cs b/src/OrchardCore.Modules/OrchardCore.Resources/ResourceManifest.cs index 2352673c277..74f2f081f46 100644 --- a/src/OrchardCore.Modules/OrchardCore.Resources/ResourceManifest.cs +++ b/src/OrchardCore.Modules/OrchardCore.Resources/ResourceManifest.cs @@ -10,7 +10,7 @@ public void BuildManifests(IResourceManifestBuilder builder) manifest .DefineScript("jQuery") - .SetUrl("/OrchardCore.Resources/Scripts/jquery.min.js", "/OrchardCore.Resources/Scripts/jquery.js") + .SetUrl("~/OrchardCore.Resources/Scripts/jquery.min.js", "~/OrchardCore.Resources/Scripts/jquery.js") .SetCdn("https://code.jquery.com/jquery-3.3.1.min.js", "https://code.jquery.com/jquery-3.3.1.js") .SetCdnIntegrity("sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=", "sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=") .SetVersion("3.3.1") @@ -18,7 +18,7 @@ public void BuildManifests(IResourceManifestBuilder builder) manifest .DefineScript("jQuery.slim") - .SetUrl("/OrchardCore.Resources/Scripts/jquery.slim.min.js", "/OrchardCore.Resources/Scripts/jquery.slim.js") + .SetUrl("~/OrchardCore.Resources/Scripts/jquery.slim.min.js", "~/OrchardCore.Resources/Scripts/jquery.slim.js") .SetCdn("https://code.jquery.com/jquery-3.3.1.slim.min.js", "https://code.jquery.com/jquery-3.3.1.slim.js") .SetCdnIntegrity("sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo", "sha384-sh6iinGECmk2oNezd0GDVuXqoHrZzF3PTML2nyt/lC61v2p1W7hGll/JkRFCOcMf") .SetVersion("3.3.1") @@ -27,7 +27,7 @@ public void BuildManifests(IResourceManifestBuilder builder) manifest .DefineScript("jQuery-ui") .SetDependencies("jQuery") - .SetUrl("/OrchardCore.Resources/Scripts/jquery-ui.min.js", "/OrchardCore.Resources/Scripts/jquery-ui.js") + .SetUrl("~/OrchardCore.Resources/Scripts/jquery-ui.min.js", "~/OrchardCore.Resources/Scripts/jquery-ui.js") .SetCdn("https://code.jquery.com/ui/1.12.1/jquery-ui.min.js", "https://code.jquery.com/ui/1.12.1/jquery-ui.js") .SetCdnIntegrity("sha384-Dziy8F2VlJQLMShA6FHWNul/veM9bCkRUaLqr199K94ntO5QUrLJBEbYegdSkkqX", "sha384-JPbtLYL10d/Z1crlc6GGGGM3PavCzzoUJ1UxH0bXHOfguWHQ6XAWrIzW+MBGGXe5") .SetVersion("1.12.1") @@ -35,7 +35,7 @@ public void BuildManifests(IResourceManifestBuilder builder) manifest .DefineStyle("jQuery-ui") - .SetUrl("/OrchardCore.Resources/Styles/jquery-ui.min.css", "/OrchardCore.Resources/Styles/jquery-ui.css") + .SetUrl("~/OrchardCore.Resources/Styles/jquery-ui.min.css", "~/OrchardCore.Resources/Styles/jquery-ui.css") .SetCdn("https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.min.css", "https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css") .SetCdnIntegrity("sha384-kcAOn9fN4XSd+TGsNu2OQKSuV5ngOwt7tg73O4EpaD91QXvrfgvf0MR7/2dUjoI6", "sha384-xewr6kSkq3dBbEtB6Z/3oFZmknWn7nHqhLVLrYgzEFRbU/DHSxW7K3B44yWUN60D") .SetVersion("1.12.1") @@ -65,7 +65,7 @@ public void BuildManifests(IResourceManifestBuilder builder) manifest .DefineScript("popper") - .SetUrl("/OrchardCore.Resources/Scripts/popper.min.js", "/OrchardCore.Resources/Scripts/popper.js") + .SetUrl("~/OrchardCore.Resources/Scripts/popper.min.js", "~/OrchardCore.Resources/Scripts/popper.js") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js", "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.js") .SetCdnIntegrity("sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut", "sha384-HzqOR2vfXkFlYAX/3YipGekTG6pn/9zeXoTLZZpSdO3w94laYDd5KXyKA22nTfuQ") .SetVersion("1.14.6") @@ -74,7 +74,7 @@ public void BuildManifests(IResourceManifestBuilder builder) manifest .DefineScript("bootstrap") .SetDependencies("jQuery") - .SetUrl("/OrchardCore.Resources/Scripts/bootstrap.min.js", "/OrchardCore.Resources/Scripts/bootstrap.js") + .SetUrl("~/OrchardCore.Resources/Scripts/bootstrap.min.js", "~/OrchardCore.Resources/Scripts/bootstrap.js") .SetCdn("https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js", "https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.js") .SetCdnIntegrity("sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy", "sha384-fyOlGC+soQAvVFysE2KxkXaVKf75M1Zyo6RG7thLEEwD7p6/Cso7G/iV9tPM0C/a") .SetVersion("4.1.3") @@ -83,7 +83,7 @@ public void BuildManifests(IResourceManifestBuilder builder) manifest .DefineScript("bootstrap-bundle") .SetDependencies("jQuery", "popper") - .SetUrl("/OrchardCore.Resources/Scripts/bootstrap.bundle.min.js", "/OrchardCore.Resources/Scripts/bootstrap.bundle.js") + .SetUrl("~/OrchardCore.Resources/Scripts/bootstrap.bundle.min.js", "~/OrchardCore.Resources/Scripts/bootstrap.bundle.js") .SetCdn("https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.bundle.min.js", "https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.bundle.js") .SetCdnIntegrity("sha384-pjaaA8dDz/5BgdFUPX6M/9SUZv4d12SUPF0axWc+VRZkx5xU3daN+lYb49+Ax+Tl", "sha384-DWBJ4L0qV7ffH95jHsoooM04DWR2qtntWspYadu41Wx5kw6d0Cs7W+7C2v2bh7vX") .SetVersion("4.1.3") @@ -91,7 +91,7 @@ public void BuildManifests(IResourceManifestBuilder builder) manifest .DefineStyle("bootstrap") - .SetUrl("/OrchardCore.Resources/Styles/bootstrap.min.css", "/OrchardCore.Resources/Styles/bootstrap.css") + .SetUrl("~/OrchardCore.Resources/Styles/bootstrap.min.css", "~/OrchardCore.Resources/Styles/bootstrap.css") .SetCdn("https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css", "https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.css") .SetCdnIntegrity("sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO", "sha384-2QMA5oZ3MEXJddkHyZE/e/C1bd30ZUPdzqHrsaHMP3aGDbPA9yh77XDHXC9Imxw+") .SetVersion("4.1.3") @@ -99,7 +99,7 @@ public void BuildManifests(IResourceManifestBuilder builder) manifest .DefineScript("codemirror") - .SetUrl("/OrchardCore.Resources/Scripts/codemirror/codemirror.min.js", "/OrchardCore.Resources/Scripts/codemirror/codemirror.js") + .SetUrl("~/OrchardCore.Resources/Scripts/codemirror/codemirror.min.js", "~/OrchardCore.Resources/Scripts/codemirror/codemirror.js") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.42.0/codemirror.min.js", "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.42.0/codemirror.js") .SetCdnIntegrity("sha384-1WlqTuBkhlft5hld74c3aAcO43Mp2uFKAl/z/6tYuEF0kDEnQRWnSIExi+EApxkW", "sha384-x1QKAzaJ+REY7xvp6SmcWnnyQdLJJaudAcV2KGSzDytetEOxiaYyaZ5PFLzBuvwR") .SetVersion("4.1.3") @@ -107,7 +107,7 @@ public void BuildManifests(IResourceManifestBuilder builder) manifest .DefineScript("codemirror") - .SetUrl("/OrchardCore.Resources/Scripts/codemirror/mode.min.js", "/OrchardCore.Resources/Scripts/codemirror/codemirror.js") + .SetUrl("~/OrchardCore.Resources/Scripts/codemirror/mode.min.js", "~/OrchardCore.Resources/Scripts/codemirror/codemirror.js") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.42.0/codemirror.min.js", "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.42.0/codemirror.js") .SetCdnIntegrity("sha384-1WlqTuBkhlft5hld74c3aAcO43Mp2uFKAl/z/6tYuEF0kDEnQRWnSIExi+EApxkW", "sha384-x1QKAzaJ+REY7xvp6SmcWnnyQdLJJaudAcV2KGSzDytetEOxiaYyaZ5PFLzBuvwR") .SetVersion("4.1.3") @@ -115,42 +115,42 @@ public void BuildManifests(IResourceManifestBuilder builder) manifest .DefineScript("codemirror-addon-mode-multiplex") - .SetUrl("/OrchardCore.Resources/Scripts/codemirror/addon/mode/multiplex.min.js", "/OrchardCore.Resources/Scripts/codemirror/addon/mode/multiplex.js") + .SetUrl("~/OrchardCore.Resources/Scripts/codemirror/addon/mode/multiplex.min.js", "~/OrchardCore.Resources/Scripts/codemirror/addon/mode/multiplex.js") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.42.0/addon/mode/multiplex.min.js", "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.42.0/addon/mode/multiplex.js") .SetVersion("4.1.3") ; manifest .DefineScript("codemirror-addon-mode-simple") - .SetUrl("/OrchardCore.Resources/Scripts/codemirror/addon/mode/simple.min.js", "/OrchardCore.Resources/Scripts/codemirror/addon/mode/simple.js") + .SetUrl("~/OrchardCore.Resources/Scripts/codemirror/addon/mode/simple.min.js", "~/OrchardCore.Resources/Scripts/codemirror/addon/mode/simple.js") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.42.0/addon/mode/simple.min.js", "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.42.0/addon/mode/simple.js") .SetVersion("4.1.3") ; manifest .DefineScript("codemirror-mode-javascript") - .SetUrl("/OrchardCore.Resources/Scripts/codemirror/mode/javascript/javascript.min.js", "/OrchardCore.Resources/Scripts/codemirror/mode/javascript/javascript.js") + .SetUrl("~/OrchardCore.Resources/Scripts/codemirror/mode/javascript/javascript.min.js", "~/OrchardCore.Resources/Scripts/codemirror/mode/javascript/javascript.js") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.42.0/mode/javascript/javascript.min.js", "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.42.0/mode/javascript/javascript.js") .SetVersion("4.1.3") ; manifest .DefineScript("codemirror-mode-sql") - .SetUrl("/OrchardCore.Resources/Scripts/codemirror/mode/sql/sql.min.js", "/OrchardCore.Resources/Scripts/codemirror/mode/sql/sql.js") + .SetUrl("~/OrchardCore.Resources/Scripts/codemirror/mode/sql/sql.min.js", "~/OrchardCore.Resources/Scripts/codemirror/mode/sql/sql.js") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.42.0/mode/sql/sql.min.js", "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.42.0/mode/sql/sql.js") .SetVersion("4.1.3") ; manifest .DefineScript("codemirror-mode-xml") - .SetUrl("/OrchardCore.Resources/Scripts/codemirror/mode/xml/xml.min.js", "/OrchardCore.Resources/Scripts/codemirror/mode/xml/xml.js") + .SetUrl("~/OrchardCore.Resources/Scripts/codemirror/mode/xml/xml.min.js", "~/OrchardCore.Resources/Scripts/codemirror/mode/xml/xml.js") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.42.0/mode/xml/xml.min.js", "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.42.0/mode/xml/xml.js") .SetVersion("4.1.3") ; manifest .DefineStyle("codemirror") - .SetUrl("/OrchardCore.Resources/Styles/codemirror/codemirror.min.css", "/OrchardCore.Resources/Styles/codemirror/codemirror.css") + .SetUrl("~/OrchardCore.Resources/Styles/codemirror/codemirror.min.css", "~/OrchardCore.Resources/Styles/codemirror/codemirror.css") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.42.0/codemirror.min.css", "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.42.0/codemirror.css") .SetCdnIntegrity("sha384-T6md2jYuokZmxpt4u/OxutZZs2NFnA/5oVdjrDkapBl/HHH3NfxhUMbFxEv5NTlh", "sha384-rTt9i9SnVCkukyC4WSJmDVMachnmXt3NchukWtR1miRFWpcgnyeOFxq2FBzsKltl") .SetVersion("5.42.0") @@ -158,7 +158,7 @@ public void BuildManifests(IResourceManifestBuilder builder) manifest .DefineStyle("font-awesome") - .SetUrl("/OrchardCore.Resources/Styles/font-awesome.min.css", "/OrchardCore.Resources/Styles/font-awesome.css") + .SetUrl("~/OrchardCore.Resources/Styles/font-awesome.min.css", "~/OrchardCore.Resources/Styles/font-awesome.css") .SetCdn("https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css", "https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.css") .SetCdnIntegrity("sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN", "sha384-FckWOBo7yuyMS7In0aXZ0aoVvnInlnFMwCv77x9sZpFgOonQgnBj1uLwenWVtsEj") .SetVersion("4.7.0") diff --git a/src/OrchardCore.Modules/OrchardCore.Setup/Views/Setup/Index.cshtml b/src/OrchardCore.Modules/OrchardCore.Setup/Views/Setup/Index.cshtml index 0f7d9ca78b5..2d8614608af 100644 --- a/src/OrchardCore.Modules/OrchardCore.Setup/Views/Setup/Index.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Setup/Views/Setup/Index.cshtml @@ -227,7 +227,7 @@
- + - + + @{ var updater = ModelUpdaterAccessor.ModelUpdater; diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/Term.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/Term.Edit.cshtml index 8b7f03f85c9..312be9c27b8 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/Term.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/Term.Edit.cshtml @@ -1,4 +1,4 @@ - +
diff --git a/src/OrchardCore.Modules/OrchardCore.Templates/Views/Preview/Index.cshtml b/src/OrchardCore.Modules/OrchardCore.Templates/Views/Preview/Index.cshtml index fdaea10471a..7d5d4ffec7c 100644 --- a/src/OrchardCore.Modules/OrchardCore.Templates/Views/Preview/Index.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Templates/Views/Preview/Index.cshtml @@ -5,7 +5,7 @@ - + diff --git a/src/OrchardCore.Modules/OrchardCore.Templates/Views/Template/Create.cshtml b/src/OrchardCore.Modules/OrchardCore.Templates/Views/Template/Create.cshtml index ceb5559cae6..0b0b8b95891 100644 --- a/src/OrchardCore.Modules/OrchardCore.Templates/Views/Template/Create.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Templates/Views/Template/Create.cshtml @@ -9,8 +9,8 @@ - - + +

@RenderTitleSegments(T["Create Template"])

diff --git a/src/OrchardCore.Modules/OrchardCore.Templates/Views/Template/Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Templates/Views/Template/Edit.cshtml index 39f4eb0bfed..c5de8debf15 100644 --- a/src/OrchardCore.Modules/OrchardCore.Templates/Views/Template/Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Templates/Views/Template/Edit.cshtml @@ -9,8 +9,8 @@ - - + +

@RenderTitleSegments(T["Edit Template"])

diff --git a/src/OrchardCore.Modules/OrchardCore.Tenants/Views/Admin/Create.cshtml b/src/OrchardCore.Modules/OrchardCore.Tenants/Views/Admin/Create.cshtml index 4a39a799bc6..7773a450740 100644 --- a/src/OrchardCore.Modules/OrchardCore.Tenants/Views/Admin/Create.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Tenants/Views/Admin/Create.cshtml @@ -86,4 +86,4 @@
- \ No newline at end of file + diff --git a/src/OrchardCore.Modules/OrchardCore.Tenants/Views/Admin/Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Tenants/Views/Admin/Edit.cshtml index eb3f4993245..cb15e627402 100644 --- a/src/OrchardCore.Modules/OrchardCore.Tenants/Views/Admin/Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Tenants/Views/Admin/Edit.cshtml @@ -89,4 +89,4 @@
- \ No newline at end of file + diff --git a/src/OrchardCore.Modules/OrchardCore.Themes/Views/Admin/Index.cshtml b/src/OrchardCore.Modules/OrchardCore.Themes/Views/Admin/Index.cshtml index d725035d2f1..9930ce4de67 100644 --- a/src/OrchardCore.Modules/OrchardCore.Themes/Views/Admin/Index.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Themes/Views/Admin/Index.cshtml @@ -1,5 +1,5 @@ @model OrchardCore.Themes.Models.SelectThemesViewModel - +

@T["Changing default themes"]

@T["This page lets you change the site's default themes for both the front-end and the back-end."]

diff --git a/src/OrchardCore.Modules/OrchardCore.Widgets/Views/WidgetsListPart.Edit.cshtml b/src/OrchardCore.Modules/OrchardCore.Widgets/Views/WidgetsListPart.Edit.cshtml index c7101ff788a..ed6ed7870cd 100644 --- a/src/OrchardCore.Modules/OrchardCore.Widgets/Views/WidgetsListPart.Edit.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Widgets/Views/WidgetsListPart.Edit.cshtml @@ -88,8 +88,8 @@ await DisplayAsync(await ContentItemDisplayManager.BuildEditorAsync(contentItem, Model.Updater, true, "", Guid.NewGuid().ToString("n"))); } - - + + } - + - + diff --git a/src/OrchardCore.Themes/TheAdmin/Views/Layout.cshtml b/src/OrchardCore.Themes/TheAdmin/Views/Layout.cshtml index 11dfe8d3d41..7d9587c66eb 100644 --- a/src/OrchardCore.Themes/TheAdmin/Views/Layout.cshtml +++ b/src/OrchardCore.Themes/TheAdmin/Views/Layout.cshtml @@ -5,21 +5,21 @@ - + - + - + - + @await RenderSectionAsync("Header", required: false) diff --git a/src/OrchardCore.Themes/TheComingSoonTheme/Views/layout.liquid b/src/OrchardCore.Themes/TheComingSoonTheme/Views/layout.liquid index d39dd1c6014..c19047ae7ab 100644 --- a/src/OrchardCore.Themes/TheComingSoonTheme/Views/layout.liquid +++ b/src/OrchardCore.Themes/TheComingSoonTheme/Views/layout.liquid @@ -13,16 +13,16 @@ {% page_title Site.SiteName %} - + - {% comment %}{% endcomment %} + {% comment %}{% endcomment %} {% style name:"font-awesome", version:"5" %} - + {% resources type: "Meta" %} {% resources type: "HeadLink" %} {% resources type: "Stylesheet" %} @@ -33,7 +33,7 @@
{% render_section "Header", required: false %} @@ -41,11 +41,11 @@ {% render_section "Footer", required: false %} - - + + - + {% resources type: "FootScript" %} diff --git a/src/OrchardCore.Themes/TheTheme/Views/Layout.cshtml b/src/OrchardCore.Themes/TheTheme/Views/Layout.cshtml index 712ca202b9d..ba6dc84c83e 100644 --- a/src/OrchardCore.Themes/TheTheme/Views/Layout.cshtml +++ b/src/OrchardCore.Themes/TheTheme/Views/Layout.cshtml @@ -5,11 +5,11 @@ @RenderTitleSegments(Site.SiteName, "before") - + - + diff --git a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Theme/Views/Layout.liquid b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Theme/Views/Layout.liquid index 25a1a271806..e6dbc5d5a5d 100644 --- a/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Theme/Views/Layout.liquid +++ b/src/Templates/OrchardCore.ProjectTemplates/content/OrchardCore.Templates.Theme/Views/Layout.liquid @@ -5,7 +5,7 @@ {% page_title Site.SiteName, position: "before", separator: " - " %} - + {% style src:"https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" %} {% style src:"/OrchardCore.Templates.Theme/Styles/sticky-footer-navbar.css" %} diff --git a/test/OrchardCore.Tests.Pages/OrchardCore.Themes.Pages/Theme.Pages/Views/Layout.cshtml b/test/OrchardCore.Tests.Pages/OrchardCore.Themes.Pages/Theme.Pages/Views/Layout.cshtml index ade4ef91846..43663e60c58 100644 --- a/test/OrchardCore.Tests.Pages/OrchardCore.Themes.Pages/Theme.Pages/Views/Layout.cshtml +++ b/test/OrchardCore.Tests.Pages/OrchardCore.Themes.Pages/Theme.Pages/Views/Layout.cshtml @@ -5,7 +5,7 @@ @RenderTitleSegments(Site.SiteName, "before") - + From 0f796e875cd425b8905ff311d16fa24a4c72ca70 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Tue, 18 Dec 2018 10:58:34 -0800 Subject: [PATCH 2/2] Handling PathBase in resource management --- .../ResourceDefinition.cs | 11 +++++- .../ResourceManager.cs | 38 ++++++++++--------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/src/OrchardCore/OrchardCore.ResourceManagement.Abstractions/ResourceDefinition.cs b/src/OrchardCore/OrchardCore.ResourceManagement.Abstractions/ResourceDefinition.cs index f1dd30e18a0..07f1e5acb8e 100644 --- a/src/OrchardCore/OrchardCore.ResourceManagement.Abstractions/ResourceDefinition.cs +++ b/src/OrchardCore/OrchardCore.ResourceManagement.Abstractions/ResourceDefinition.cs @@ -213,8 +213,15 @@ public TagBuilder GetTagBuilder(RequireSettings settings, string applicationPath if (url.StartsWith("~/", StringComparison.Ordinal)) { - // For tilde slash paths, drop the leading ~ to make it work with the underlying IFileProvider. - url = url.Substring(1); + if (!String.IsNullOrEmpty(_basePath)) + { + url = _basePath + url.Substring(1); + } + else + { + url = applicationPath + url.Substring(1); + } + } var tagBuilder = new TagBuilder(TagName) diff --git a/src/OrchardCore/OrchardCore.ResourceManagement/ResourceManager.cs b/src/OrchardCore/OrchardCore.ResourceManagement/ResourceManager.cs index d3885b0cc37..2174be805be 100644 --- a/src/OrchardCore/OrchardCore.ResourceManagement/ResourceManager.cs +++ b/src/OrchardCore/OrchardCore.ResourceManagement/ResourceManager.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Text; using Microsoft.AspNetCore.Html; +using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Options; namespace OrchardCore.ResourceManagement @@ -13,6 +14,7 @@ public class ResourceManager : IResourceManager { private readonly Dictionary _required = new Dictionary(); private readonly Dictionary> _builtResources; + private readonly string _pathBase; private readonly IEnumerable _providers; private ResourceManifest _dynamicManifest; @@ -25,12 +27,14 @@ public class ResourceManager : IResourceManager private readonly IOptions _options; public ResourceManager( + IHttpContextAccessor httpContextAccessor, IEnumerable resourceProviders, IResourceManifestState resourceManifestState, IOptions options) { _resourceManifestState = resourceManifestState; _options = options; + _pathBase = httpContextAccessor.HttpContext.Request.PathBase; _providers = resourceProviders; _builtResources = new Dictionary>(StringComparer.OrdinalIgnoreCase); @@ -100,21 +104,22 @@ public RequireSettings RegisterUrl(string resourceType, string resourcePath, str { throw new ArgumentNullException(nameof(resourceType)); } + if (resourcePath == null) { throw new ArgumentNullException(nameof(resourcePath)); } // ~/ ==> convert to absolute path (e.g. /orchard/..) + if (resourcePath.StartsWith("~/", StringComparison.Ordinal)) { - // For tilde slash paths, drop the leading ~ to make it work with the underlying IFileProvider. - resourcePath = resourcePath.Substring(1); + resourcePath = _pathBase + resourcePath.Substring(1); } + if (resourceDebugPath != null && resourceDebugPath.StartsWith("~/", StringComparison.Ordinal)) { - // For tilde slash paths, drop the leading ~ to make it work with the underlying IFileProvider. - resourceDebugPath = resourceDebugPath.Substring(1); + resourceDebugPath = _pathBase + resourceDebugPath.Substring(1); } return RegisterResource(resourceType, resourcePath).Define(d => d.SetUrl(resourcePath, resourceDebugPath)); @@ -500,7 +505,7 @@ public void RenderStylesheet(IHtmlContentBuilder builder) first = false; - builder.AppendHtml(context.GetHtmlContent("/")); + builder.AppendHtml(context.GetHtmlContent(_pathBase)); } } @@ -519,7 +524,7 @@ public void RenderHeadScript(IHtmlContentBuilder builder) first = false; - builder.AppendHtml(context.GetHtmlContent("/")); + builder.AppendHtml(context.GetHtmlContent(_pathBase)); } foreach (var context in GetRegisteredHeadScripts()) @@ -550,7 +555,7 @@ public void RenderFootScript(IHtmlContentBuilder builder) first = false; - builder.AppendHtml(context.GetHtmlContent("/")); + builder.AppendHtml( context.GetHtmlContent(_pathBase)); } foreach (var context in GetRegisteredFootScripts()) @@ -568,16 +573,13 @@ public void RenderFootScript(IHtmlContentBuilder builder) private class ResourceTypeName : IEquatable { - private readonly string _type; - private readonly string _name; - - public string Type { get { return _type; } } - public string Name { get { return _name; } } + public string Type { get; } + public string Name { get; } public ResourceTypeName(string resourceType, string resourceName) { - _type = resourceType; - _name = resourceName; + Type = resourceType; + Name = resourceName; } public bool Equals(ResourceTypeName other) @@ -587,21 +589,21 @@ public bool Equals(ResourceTypeName other) return false; } - return _type.Equals(other._type) && _name.Equals(other._name); + return Type.Equals(other.Type) && Name.Equals(other.Name); } public override int GetHashCode() { - return _type.GetHashCode() << 17 + _name.GetHashCode(); + return Type.GetHashCode() << 17 + Name.GetHashCode(); } public override string ToString() { var sb = new StringBuilder(); sb.Append("("); - sb.Append(_type); + sb.Append(Type); sb.Append(", "); - sb.Append(_name); + sb.Append(Name); sb.Append(")"); return sb.ToString(); }